diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2021-02-16 17:12:42 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2021-02-16 17:12:42 +0300 |
commit | 74210ae9451887932122e6d790b101297f8a51d9 (patch) | |
tree | da8cafb9ca345167a051b53a7a54a610e35b12b6 /src | |
parent | 710f366bdaa32b45651ad9ecd7290d592442d388 (diff) |
Fixing selections, bnold and cursor colors, fixes #2216
Signed-off-by: Antenore Gatta <antenore@simbiosi.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina_pref.c | 10 | ||||
-rw-r--r-- | src/remmina_pref.h | 5 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 31 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 5 | ||||
-rw-r--r-- | src/remmina_ssh_plugin.c | 62 |
5 files changed, 87 insertions, 26 deletions
diff --git a/src/remmina_pref.c b/src/remmina_pref.c index ae1165c0a..baddd0972 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -181,7 +181,10 @@ void remmina_pref_file_load_colors(GKeyFile *gkeyfile, RemminaColorPref *color_p } colors[] = { { "background", &color_pref->background, "#d5ccba" }, { "cursor", &color_pref->cursor, "#45373c" }, - { "bold", &color_pref->bold, "#45373c" }, + { "cursor_foreground", &color_pref->cursor_foreground, "#d5ccba" }, + { "highlight", &color_pref->highlight, "#45373c" }, + { "highlight_foreground", &color_pref->highlight_foreground, "#d5ccba" }, + { "colorBD", &color_pref->colorBD, "#45373c" }, { "foreground", &color_pref->foreground, "#45373c" }, { "color0", &color_pref->color0, "#20111b" }, { "color1", &color_pref->color1, "#be100e" }, @@ -837,7 +840,10 @@ gboolean remmina_pref_save(void) g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_lines", remmina_pref.vte_lines); g_key_file_set_string(gkeyfile, "ssh_colors", "background", remmina_pref.color_pref.background ? remmina_pref.color_pref.background : ""); g_key_file_set_string(gkeyfile, "ssh_colors", "cursor", remmina_pref.color_pref.cursor ? remmina_pref.color_pref.cursor : ""); - g_key_file_set_string(gkeyfile, "ssh_colors", "bold", remmina_pref.color_pref.bold ? remmina_pref.color_pref.bold : ""); + g_key_file_set_string(gkeyfile, "ssh_colors", "cursor_foreground", remmina_pref.color_pref.cursor_foreground ? remmina_pref.color_pref.cursor_foreground : ""); + g_key_file_set_string(gkeyfile, "ssh_colors", "highlight", remmina_pref.color_pref.highlight ? remmina_pref.color_pref.highlight : ""); + g_key_file_set_string(gkeyfile, "ssh_colors", "highlight_foreground", remmina_pref.color_pref.highlight_foreground ? remmina_pref.color_pref.highlight_foreground : ""); + g_key_file_set_string(gkeyfile, "ssh_colors", "colorBD", remmina_pref.color_pref.colorBD ? remmina_pref.color_pref.colorBD : ""); g_key_file_set_string(gkeyfile, "ssh_colors", "foreground", remmina_pref.color_pref.foreground ? remmina_pref.color_pref.foreground : ""); g_key_file_set_string(gkeyfile, "ssh_colors", "color0", remmina_pref.color_pref.color0 ? remmina_pref.color_pref.color0 : ""); g_key_file_set_string(gkeyfile, "ssh_colors", "color1", remmina_pref.color_pref.color1 ? remmina_pref.color_pref.color1 : ""); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index 4b6385a2b..6edb4d63f 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -90,7 +90,10 @@ typedef struct _RemminaColorPref { /* Color palette for VTE terminal */ gchar * background; gchar * cursor; - gchar * bold; + gchar * cursor_foreground; + gchar * highlight; + gchar * highlight_foreground; + gchar * colorBD; gchar * foreground; gchar * color0; gchar * color1; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 30722a182..2a298f915 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -340,8 +340,14 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) remmina_pref.color_pref.background = gdk_rgba_to_string(&color); gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_cursor), &color); remmina_pref.color_pref.cursor = gdk_rgba_to_string(&color); - gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_bold), &color); - remmina_pref.color_pref.bold = gdk_rgba_to_string(&color); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_cursor_foreground), &color); + remmina_pref.color_pref.cursor_foreground = gdk_rgba_to_string(&color); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_highlight), &color); + remmina_pref.color_pref.highlight = gdk_rgba_to_string(&color); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_highlight_foreground), &color); + remmina_pref.color_pref.highlight_foreground = gdk_rgba_to_string(&color); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_colorBD), &color); + remmina_pref.color_pref.colorBD = gdk_rgba_to_string(&color); gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_color0), &color); remmina_pref.color_pref.color0 = gdk_rgba_to_string(&color); gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_color1), &color); @@ -549,9 +555,16 @@ static void remmina_pref_dialog_init(void) /* Cursor color option */ gdk_rgba_parse(&color, remmina_pref.color_pref.cursor); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_cursor), &color); + gdk_rgba_parse(&color, remmina_pref.color_pref.cursor_foreground); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_cursor_foreground), &color); + /* Highlight color option */ + gdk_rgba_parse(&color, remmina_pref.color_pref.highlight); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_highlight), &color); + gdk_rgba_parse(&color, remmina_pref.color_pref.highlight_foreground); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_highlight_foreground), &color); /* Bold color option */ - gdk_rgba_parse(&color, remmina_pref.color_pref.bold); - gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_bold), &color); + gdk_rgba_parse(&color, remmina_pref.color_pref.colorBD); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_colorBD), &color); /* 16 colors */ gdk_rgba_parse(&color, remmina_pref.color_pref.color0); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_color0), &color); @@ -589,7 +602,10 @@ static void remmina_pref_dialog_init(void) #if !VTE_CHECK_VERSION(0, 38, 0) /* Disable color scheme buttons if old version of VTE */ gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_cursor), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_bold), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_cursor_foreground), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_highlight), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_highlight_foreground), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_colorBD), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_color0), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_color1), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(remmina_pref_dialog->colorbutton_color2), FALSE); @@ -753,8 +769,11 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->colorbutton_background = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_background")); remmina_pref_dialog->label_terminal_cursor_color = GTK_LABEL(GET_OBJECT("label_terminal_cursor_color")); remmina_pref_dialog->colorbutton_cursor = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_cursor")); + remmina_pref_dialog->colorbutton_cursor_foreground = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_cursor_foreground")); + remmina_pref_dialog->colorbutton_highlight = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_highlight")); + remmina_pref_dialog->colorbutton_highlight_foreground = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_highlight_foreground")); remmina_pref_dialog->label_terminal_bold_color = GTK_LABEL(GET_OBJECT("label_terminal_bold_color")); - remmina_pref_dialog->colorbutton_bold = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_bold")); + remmina_pref_dialog->colorbutton_colorBD = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_colorBD")); remmina_pref_dialog->label_terminal_normal_colors = GTK_LABEL(GET_OBJECT("label_terminal_normal_colors")); remmina_pref_dialog->colorbutton_color0 = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_color0")); remmina_pref_dialog->colorbutton_color1 = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_color1")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index 7d3ea0676..f777f0f08 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -125,7 +125,10 @@ typedef struct _RemminaPrefDialog { GtkLabel * label_terminal_normal_colors; GtkLabel * label_terminal_bright_colors; GtkColorButton * colorbutton_cursor; - GtkColorButton * colorbutton_bold; + GtkColorButton * colorbutton_cursor_foreground; + GtkColorButton * colorbutton_highlight; + GtkColorButton * colorbutton_highlight_foreground; + GtkColorButton * colorbutton_colorBD; GtkColorButton * colorbutton_color0; GtkColorButton * colorbutton_color1; GtkColorButton * colorbutton_color2; diff --git a/src/remmina_ssh_plugin.c b/src/remmina_ssh_plugin.c index 901d5e973..dda05f968 100644 --- a/src/remmina_ssh_plugin.c +++ b/src/remmina_ssh_plugin.c @@ -891,7 +891,10 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) #if VTE_CHECK_VERSION(0, 38, 0) GdkRGBA cp[PALETTE_SIZE]; GdkRGBA cursor_color; - GdkRGBA bold_color; + GdkRGBA cursor_foreground; + GdkRGBA highlight; + GdkRGBA highlight_foreground; + GdkRGBA colorBD; /* * custom colors reside inside of the 'theme' subdir of the remmina config folder (.config/remmina/theme) @@ -944,7 +947,10 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) gdk_rgba_parse(&foreground_color, color_pref.foreground); gdk_rgba_parse(&background_color, color_pref.background); gdk_rgba_parse(&cursor_color, color_pref.cursor); - gdk_rgba_parse(&bold_color, color_pref.bold); + gdk_rgba_parse(&cursor_foreground, color_pref.cursor_foreground); + gdk_rgba_parse(&highlight, color_pref.highlight); + gdk_rgba_parse(&highlight_foreground, color_pref.highlight_foreground); + gdk_rgba_parse(&colorBD, color_pref.colorBD); gdk_rgba_parse(&cp[0], color_pref.color0); gdk_rgba_parse(&cp[1], color_pref.color1); @@ -978,49 +984,70 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) gdk_rgba_parse(&foreground_color, "#ffffff"); gdk_rgba_parse(&background_color, "#000000"); gdk_rgba_parse(&cursor_color, "#ffffff"); - gdk_rgba_parse(&bold_color, "#ffffff"); + gdk_rgba_parse(&cursor_foreground, "#00000"); + gdk_rgba_parse(&highlight, "#ffffff"); + gdk_rgba_parse(&highlight_foreground, "#00000"); + gdk_rgba_parse(&colorBD, "#ffffff"); remminavte.palette = linux_palette; break; case TANGO: - gdk_rgba_parse(&foreground_color, "#eeeeec"); - gdk_rgba_parse(&background_color, "#2e3436"); - gdk_rgba_parse(&cursor_color, "#8ae234"); - gdk_rgba_parse(&bold_color, "#eeeeec"); + gdk_rgba_parse(&foreground_color, "#ffffff"); + gdk_rgba_parse(&background_color, "#000000"); + gdk_rgba_parse(&cursor_color, "#000000"); + gdk_rgba_parse(&cursor_foreground, "#ffffff"); + gdk_rgba_parse(&highlight, "#ffffff"); + gdk_rgba_parse(&highlight_foreground, "#00000"); + gdk_rgba_parse(&colorBD, "#000000"); remminavte.palette = tango_palette; break; case GRUVBOX: - gdk_rgba_parse(&foreground_color, "#ebdbb2"); - gdk_rgba_parse(&background_color, "#282828"); - gdk_rgba_parse(&cursor_color, "#d3869b"); - gdk_rgba_parse(&bold_color, "#ffffff"); + gdk_rgba_parse(&foreground_color, "#e6d4a3"); + gdk_rgba_parse(&background_color, "#1e1e1e"); + gdk_rgba_parse(&cursor_color, "#e6d4a3"); + gdk_rgba_parse(&cursor_foreground, "#e6d4a3"); + gdk_rgba_parse(&highlight, "#e6d4a3"); + gdk_rgba_parse(&highlight_foreground, "#1e1e1e"); + gdk_rgba_parse(&colorBD, "#ffffff"); remminavte.palette = gruvbox_palette; break; case SOLARIZED_DARK: gdk_rgba_parse(&foreground_color, "#839496"); gdk_rgba_parse(&background_color, "#002b36"); gdk_rgba_parse(&cursor_color, "#93a1a1"); - gdk_rgba_parse(&bold_color, "#819090"); + gdk_rgba_parse(&cursor_foreground, "#839496"); + gdk_rgba_parse(&highlight, "#839496"); + gdk_rgba_parse(&highlight_foreground, "#002b36"); + gdk_rgba_parse(&colorBD, "#819090"); remminavte.palette = solarized_dark_palette; break; case SOLARIZED_LIGHT: gdk_rgba_parse(&foreground_color, "#657b83"); gdk_rgba_parse(&background_color, "#fdf6e3"); gdk_rgba_parse(&cursor_color, "#586e75"); - gdk_rgba_parse(&bold_color, "#475b62"); + gdk_rgba_parse(&cursor_foreground, "#657b83"); + gdk_rgba_parse(&highlight, "#657b83"); + gdk_rgba_parse(&highlight_foreground, "#fdf6e3"); + gdk_rgba_parse(&colorBD, "#475b62"); remminavte.palette = solarized_light_palette; break; case XTERM: gdk_rgba_parse(&foreground_color, "#000000"); gdk_rgba_parse(&background_color, "#ffffff"); gdk_rgba_parse(&cursor_color, "#000000"); - gdk_rgba_parse(&bold_color, "#000000"); + gdk_rgba_parse(&cursor_foreground, "#ffffff"); + gdk_rgba_parse(&highlight, "#000000"); + gdk_rgba_parse(&highlight_foreground, "#ffffff"); + gdk_rgba_parse(&colorBD, "#000000"); remminavte.palette = xterm_palette; break; case CUSTOM: gdk_rgba_parse(&foreground_color, remmina_pref.color_pref.foreground); gdk_rgba_parse(&background_color, remmina_pref.color_pref.background); gdk_rgba_parse(&cursor_color, remmina_pref.color_pref.cursor); - gdk_rgba_parse(&bold_color, remmina_pref.color_pref.bold); + gdk_rgba_parse(&cursor_foreground, remmina_pref.color_pref.cursor_foreground); + gdk_rgba_parse(&highlight, remmina_pref.color_pref.highlight); + gdk_rgba_parse(&highlight_foreground, remmina_pref.color_pref.highlight_foreground); + gdk_rgba_parse(&colorBD, remmina_pref.color_pref.colorBD); gdk_rgba_parse(&cp[0], remmina_pref.color_pref.color0); gdk_rgba_parse(&cp[1], remmina_pref.color_pref.color1); @@ -1058,7 +1085,10 @@ remmina_plugin_ssh_init(RemminaProtocolWidget *gp) vte_terminal_set_color_foreground(VTE_TERMINAL(vte), &foreground_color); vte_terminal_set_color_background(VTE_TERMINAL(vte), &background_color); vte_terminal_set_color_cursor(VTE_TERMINAL(vte), &cursor_color); - vte_terminal_set_color_bold(VTE_TERMINAL(vte), &bold_color); + vte_terminal_set_color_cursor_foreground(VTE_TERMINAL(vte), &cursor_foreground); + vte_terminal_set_color_highlight(VTE_TERMINAL(vte), &highlight); + vte_terminal_set_color_highlight_foreground(VTE_TERMINAL(vte), &highlight_foreground); + vte_terminal_set_color_bold(VTE_TERMINAL(vte), &colorBD); #else /* VTE <= 2.90 doesn’t support GdkRGBA so we must convert GdkRGBA to GdkColor */ |