diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2018-06-06 01:25:11 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2018-06-06 01:25:11 +0300 |
commit | 4dc3f8f1d3115da74c5513a0df7b09b1738b3da4 (patch) | |
tree | b47bf369e8ca631993b3cf5baa662d0434e52364 | |
parent | 6331df869887094d8f2ed5314a96077bffdbaa41 (diff) |
Icons colour chooser dialog
-rw-r--r-- | data/ui/remmina_preferences.glade | 33 | ||||
-rw-r--r-- | src/remmina_pref.c | 7 | ||||
-rw-r--r-- | src/remmina_pref.h | 3 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 7 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 2 |
5 files changed, 50 insertions, 2 deletions
diff --git a/data/ui/remmina_preferences.glade b/data/ui/remmina_preferences.glade index c2bf00f5b..bde6fa713 100644 --- a/data/ui/remmina_preferences.glade +++ b/data/ui/remmina_preferences.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 +<!-- Generated with glade 3.22.1 Remmina Preferences Dialog - Copyright (C) Antenore Gatta & Giovanni Panozzo 2014-2018 @@ -22,7 +22,7 @@ Author: Antenore Gatta --> <interface> - <requires lib="gtk+" version="3.8"/> + <requires lib="gtk+" version="3.12"/> <!-- interface-license-type gplv2 --> <!-- interface-name Remmina Preferences Dialog --> <!-- interface-copyright Antenore Gatta & Giovanni Panozzo 2014-2018 --> @@ -548,12 +548,41 @@ Author: Antenore Gatta <property name="can_focus">False</property> <property name="halign">start</property> <property name="label" translatable="yes">Fullscreen toolbar visibility</property> + <property name="selectable">True</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> </packing> </child> + <child> + <object class="GtkLabel" id="label_icons_colour"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Icons colour</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">8</property> + </packing> + </child> + <child> + <object class="GtkColorButton" id="colorbutton_icons"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">Remimna Icons are black by default. +You can choose acolor that matches your theme colour.</property> + <property name="rgba">rgb(0,0,0)</property> + <property name="show_editor">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">8</property> + <property name="width">2</property> + </packing> + </child> </object> </child> </object> diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 5ecb762db..38a0f1c44 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -433,6 +433,12 @@ void remmina_pref_init(void) remmina_pref.fullscreen_toolbar_visibility = g_key_file_get_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", NULL); else remmina_pref.fullscreen_toolbar_visibility = FLOATING_TOOLBAR_VISIBILITY_PEEKING; + /* Icons colour */ + if (g_key_file_has_key(gkeyfile, "remmina_pref", "icons_colour", NULL)) + remmina_pref.icons_colour = g_key_file_get_string(gkeyfile, "remmina_pref", "icons_colour", + NULL); + else + remmina_pref.icons_colour = "#000000"; /* Show buttons icons */ if (g_key_file_has_key(gkeyfile, "remmina_pref", "show_buttons_icons", NULL)) { remmina_pref.show_buttons_icons = g_key_file_get_integer(gkeyfile, "remmina_pref", "show_buttons_icons", NULL); @@ -732,6 +738,7 @@ void remmina_pref_save(void) g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement); g_key_file_set_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", remmina_pref.prevent_snap_welcome_message); g_key_file_set_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", remmina_pref.fullscreen_on_auto); + g_key_file_set_string(gkeyfile, "remmina_pref", "icons_colour", remmina_pref.icons_colour ? remmina_pref.icons_colour : ""); g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab); g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar); g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index 75e3be464..f08dcd812 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -164,6 +164,9 @@ typedef struct _RemminaPref { /* UID */ gchar *uid; + /* Icons colour */ + gchar *icons_colour; + /* Color palette for VTE terminal */ gchar *background; gchar *cursor; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 2f6aa708d..e21531113 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -176,6 +176,8 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) remmina_pref.default_mode = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_view_mode); remmina_pref.tab_mode = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_tab_interface); remmina_pref.fullscreen_toolbar_visibility = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_fullscreen_toolbar_visibility); + gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_icons), &color); + remmina_pref.icons_colour = gdk_rgba_to_string(&color); remmina_pref.show_buttons_icons = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons); remmina_pref.show_menu_icons = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_show_menu_icons); remmina_pref.scale_quality = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_options_scale_quality); @@ -427,6 +429,9 @@ static void remmina_pref_dialog_init(void) } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_terminal_bold), remmina_pref.vte_allow_bold_text); + /* Icons color option */ + gdk_rgba_parse(&color, remmina_pref.icons_colour); + gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_icons), &color); /* Foreground color option */ gdk_rgba_parse(&color, remmina_pref.foreground); gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_foreground), &color); @@ -586,6 +591,8 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->button_keyboard_copy = GTK_BUTTON(GET_OBJECT("button_keyboard_copy")); remmina_pref_dialog->button_keyboard_paste = GTK_BUTTON(GET_OBJECT("button_keyboard_paste")); remmina_pref_dialog->button_keyboard_select_all = GTK_BUTTON(GET_OBJECT("button_keyboard_select_all")); + remmina_pref_dialog->label_icons_colour = GTK_LABEL(GET_OBJECT("label_icons_colour")); + remmina_pref_dialog->colorbutton_icons = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_icons")); remmina_pref_dialog->label_terminal_foreground = GTK_LABEL(GET_OBJECT("label_terminal_foreground")); remmina_pref_dialog->colorbutton_foreground = GTK_COLOR_BUTTON(GET_OBJECT("colorbutton_foreground")); remmina_pref_dialog->label_terminal_background = GTK_LABEL(GET_OBJECT("label_terminal_background")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index 911638719..3ba30e49b 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -97,6 +97,8 @@ typedef struct _RemminaPrefDialog { GtkFontButton *fontbutton_terminal_font; GtkCheckButton *checkbutton_terminal_bold; GtkCheckButton *checkbutton_terminal_system_colors; + GtkLabel *label_icons_colour; + GtkColorButton *colorbutton_icons; GtkLabel *label_terminal_foreground; GtkColorButton *colorbutton_foreground; GtkLabel *label_terminal_background; |