diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2018-12-14 02:29:24 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2018-12-14 02:29:24 +0300 |
commit | aa2e0ceca979e3db96534efb31f6491f21da517c (patch) | |
tree | cb5cce9d8f1dfb8c4a867dfe80889847681b9548 /src | |
parent | de878da5b389f8faf9ae7eb0da70fd26b532b74e (diff) |
Gtk deprecation and CSS restzling
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina_connection_window.c | 25 | ||||
-rw-r--r-- | src/remmina_message_panel.c | 34 | ||||
-rw-r--r-- | src/remmina_pref.c | 18 | ||||
-rw-r--r-- | src/remmina_pref.h | 2 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 6 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 2 |
6 files changed, 26 insertions, 61 deletions
diff --git a/src/remmina_connection_window.c b/src/remmina_connection_window.c index 4f032bb5a..107095417 100644 --- a/src/remmina_connection_window.c +++ b/src/remmina_connection_window.c @@ -243,16 +243,13 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k "#remmina-cw-viewport, #remmina-cw-aspectframe {\n" " padding:0;\n" " border:0;\n" - " background-color: black;\n" "}\n" "GtkDrawingArea {\n" - " background-color: black;\n" "}\n" "GtkToolbar {\n" " -GtkWidget-window-dragging: 0;\n" "}\n" "#remmina-connection-window-fullscreen {\n" - " background-color: black;\n" "}\n" "#remmina-small-button {\n" " outline-offset: 0;\n" @@ -267,10 +264,8 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k " border: 0;\n" "}\n" "#remmina-page {\n" - " background-color: black;\n" "}\n" "#remmina-scrolled-container {\n" - " background-color: black;\n" "}\n" "#remmina-scrolled-container.undershoot {\n" " background: none\n" @@ -279,36 +274,26 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k " border-style: none solid solid solid;\n" " border-width: 1px;\n" " border-radius: 4px;\n" - " border-color: #808080;\n" " padding: 0px;\n" - " background-color: #f0f0f0;\n" "}\n" "#ftbbox-lower {\n" " border-style: solid solid none solid;\n" " border-width: 1px;\n" " border-radius: 4px;\n" - " border-color: #808080;\n" " padding: 0px;\n" - " background-color: #f0f0f0;\n" "}\n" "#ftb-handle {\n" - " background-color: #f0f0f0;\n" "}\n" ".message_panel {\n" " border: 0px solid darkblue;\n" - " background-color: #404040;\n" " padding: 20px 20px 20px 20px;\n" - " color: #f04040;\n" "}\n" ".message_panel entry {\n" - " background-color: #404040;\n" " background-image: none;\n" " border-width: 4px;\n" " border-radius: 8px;\n" - " color: #f8f8f8;\n" "}\n" ".message_panel label {\n" - " color: #f04040;\n" "}\n" ".message_panel .title_label {\n" " font-size: 2em; \n" @@ -320,19 +305,15 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k "#remmina-cw-viewport, #remmina-cw-aspectframe {\n" " padding:0;\n" " border:0;\n" - " background-color: black;\n" "}\n" "#remmina-cw-message-panel {\n" - " background-color: green;\n" "}\n" "GtkDrawingArea {\n" - " background-color: black;\n" "}\n" "GtkToolbar {\n" " -GtkWidget-window-dragging: 0;\n" "}\n" "#remmina-connection-window-fullscreen {\n" - " background-color: black;\n" "}\n" "#remmina-small-button {\n" " -GtkWidget-focus-padding: 0;\n" @@ -347,7 +328,6 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k " border: 0;\n" "}\n" "#remmina-scrolled-container {\n" - " background-color: black;\n" "}\n" "#remmina-scrolled-container.undershoot {\n" " background: none\n" @@ -356,20 +336,15 @@ static void remmina_connection_window_class_init(RemminaConnectionWindowClass* k " border-style: none solid solid solid;\n" " border-width: 1px;\n" " border-radius: 4px;\n" - " border-color: #808080;\n" " padding: 0px;\n" - " background-color: #f0f0f0;\n" "}\n" "#ftbbox-lower {\n" " border-style: solid solid none solid;\n" " border-width: 1px;\n" " border-radius: 4px;\n" - " border-color: #808080;\n" " padding: 0px;\n" - " background-color: #f0f0f0;\n" "}\n" "#ftb-handle {\n" - " background-color: #f0f0f0;\n" "}\n" , -1, NULL); diff --git a/src/remmina_message_panel.c b/src/remmina_message_panel.c index 99e9750ed..e65279792 100644 --- a/src/remmina_message_panel.c +++ b/src/remmina_message_panel.c @@ -202,7 +202,7 @@ void remmina_message_panel_setup_question(RemminaMessagePanel *mp, const gchar * */ TRACE_CALL(__func__); - GtkBox *hbox; + GtkWidget *grid; GtkWidget *w; RemminaMessagePanelPrivate *priv = remmina_message_panel_get_instance_private(mp); @@ -211,22 +211,40 @@ void remmina_message_panel_setup_question(RemminaMessagePanel *mp, const gchar * raise(SIGINT); } - hbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); + /* Create grid */ + grid = gtk_grid_new(); + gtk_widget_set_halign(GTK_WIDGET(grid), GTK_ALIGN_CENTER); + gtk_widget_set_valign(GTK_WIDGET(grid), GTK_ALIGN_CENTER); + gtk_widget_show(grid); + gtk_grid_set_row_spacing(GTK_GRID(grid), 6); + gtk_grid_set_column_spacing(GTK_GRID(grid), 6); /* A message, in HTML format */ w = gtk_label_new(NULL); gtk_label_set_markup(GTK_LABEL(w), message); - gtk_box_pack_start(hbox, w, TRUE, TRUE, 0); + + gtk_widget_set_halign(GTK_WIDGET(w), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(w), GTK_ALIGN_FILL); + gtk_widget_set_margin_top (GTK_WIDGET(w), 18); + gtk_widget_set_margin_bottom (GTK_WIDGET(w), 9); + gtk_widget_set_margin_start (GTK_WIDGET(w), 18); + gtk_widget_set_margin_end (GTK_WIDGET(w), 18); + gtk_widget_show(w); + gtk_grid_attach(GTK_GRID(grid), w, 0, 0, 2, 1); /* A button for yes and one for no */ w = gtk_button_new_with_label(_("Yes")); - gtk_box_pack_end(hbox, w, FALSE, FALSE, 0); + gtk_widget_set_halign(GTK_WIDGET(w), GTK_ALIGN_START); + gtk_widget_set_valign(GTK_WIDGET(w), GTK_ALIGN_CENTER); + gtk_grid_attach(GTK_GRID(grid), w, 0, 1, 1, 1); g_object_set_data(G_OBJECT(w), btn_response_key, (void *)GTK_RESPONSE_YES); g_signal_connect(G_OBJECT(w), "clicked", G_CALLBACK(remmina_message_panel_button_clicked_callback), mp); w = gtk_button_new_with_label(_("No")); - gtk_box_pack_end(hbox, w, FALSE, FALSE, 0); + gtk_widget_set_halign(GTK_WIDGET(w), GTK_ALIGN_END); + gtk_widget_set_valign(GTK_WIDGET(w), GTK_ALIGN_CENTER); + gtk_grid_attach(GTK_GRID(grid), w, 1, 1, 1, 1); g_object_set_data(G_OBJECT(w), btn_response_key, (void *)GTK_RESPONSE_NO); priv->response_callback = response_callback; @@ -234,7 +252,7 @@ void remmina_message_panel_setup_question(RemminaMessagePanel *mp, const gchar * g_signal_connect(G_OBJECT(w), "clicked", G_CALLBACK(remmina_message_panel_button_clicked_callback), mp); - gtk_box_pack_start(GTK_BOX(mp), GTK_WIDGET(hbox), TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(mp), GTK_WIDGET(grid), TRUE, TRUE, 0); gtk_widget_show_all(GTK_WIDGET(mp)); @@ -330,7 +348,7 @@ void remmina_message_panel_setup_auth(RemminaMessagePanel *mp, RemminaMessagePan gtk_grid_attach(GTK_GRID(grid), widget, 0, grid_row, 1, 1); password_entry = gtk_entry_new(); - gtk_widget_set_halign(GTK_WIDGET(password_entry), GTK_ALIGN_START); + gtk_widget_set_halign(GTK_WIDGET(password_entry), GTK_ALIGN_FILL); gtk_widget_set_valign(GTK_WIDGET(password_entry), GTK_ALIGN_FILL); gtk_widget_set_margin_top (GTK_WIDGET(password_entry), 3); gtk_widget_set_margin_bottom (GTK_WIDGET(password_entry), 3); @@ -355,7 +373,7 @@ void remmina_message_panel_setup_auth(RemminaMessagePanel *mp, RemminaMessagePan gtk_grid_attach(GTK_GRID(grid), widget, 0, grid_row, 1, 1); domain_entry = gtk_entry_new(); - gtk_widget_set_halign(GTK_WIDGET(domain_entry), GTK_ALIGN_START); + gtk_widget_set_halign(GTK_WIDGET(domain_entry), GTK_ALIGN_FILL); gtk_widget_set_valign(GTK_WIDGET(domain_entry), GTK_ALIGN_FILL); gtk_widget_set_margin_top (GTK_WIDGET(domain_entry), 3); gtk_widget_set_margin_bottom (GTK_WIDGET(domain_entry), 3); diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 205b273cf..45c7c4553 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -493,22 +493,6 @@ 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; - /* 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); - if (remmina_pref.show_buttons_icons) { - g_object_set(gtk_settings_get_default(), "gtk-button-images", remmina_pref.show_buttons_icons == 1, NULL); - } - }else - remmina_pref.show_buttons_icons = 0; - /* Show menu icons */ - if (g_key_file_has_key(gkeyfile, "remmina_pref", "show_menu_icons", NULL)) { - remmina_pref.show_menu_icons = g_key_file_get_integer(gkeyfile, "remmina_pref", "show_menu_icons", NULL); - if (remmina_pref.show_menu_icons) { - g_object_set(gtk_settings_get_default(), "gtk-menu-images", remmina_pref.show_menu_icons == 1, NULL); - } - }else - remmina_pref.show_menu_icons = 0; if (g_key_file_has_key(gkeyfile, "remmina_pref", "auto_scroll_step", NULL)) remmina_pref.auto_scroll_step = g_key_file_get_integer(gkeyfile, "remmina_pref", "auto_scroll_step", NULL); @@ -718,8 +702,6 @@ gboolean remmina_pref_save(void) g_key_file_set_integer(gkeyfile, "remmina_pref", "default_mode", remmina_pref.default_mode); g_key_file_set_integer(gkeyfile, "remmina_pref", "tab_mode", remmina_pref.tab_mode); g_key_file_set_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", remmina_pref.fullscreen_toolbar_visibility); - g_key_file_set_integer(gkeyfile, "remmina_pref", "show_buttons_icons", remmina_pref.show_buttons_icons); - g_key_file_set_integer(gkeyfile, "remmina_pref", "show_menu_icons", remmina_pref.show_menu_icons); g_key_file_set_integer(gkeyfile, "remmina_pref", "auto_scroll_step", remmina_pref.auto_scroll_step); g_key_file_set_integer(gkeyfile, "remmina_pref", "hostkey", remmina_pref.hostkey); g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", remmina_pref.shortcutkey_fullscreen); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index 66098c6fa..f0e52a7c4 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -128,8 +128,6 @@ typedef struct _RemminaPref { gint default_mode; gint tab_mode; gint fullscreen_toolbar_visibility; - gint show_buttons_icons; - gint show_menu_icons; /* In RemminaPrefDialog applet tab */ gboolean applet_new_ontop; gboolean applet_hide_count; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 68089fa0e..f984f7274 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -180,8 +180,6 @@ 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); - 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); remmina_pref.screenshot_path = gtk_file_chooser_get_filename(remmina_pref_dialog->filechooserbutton_options_screenshots_path); remmina_pref.screenshot_name = gtk_entry_get_text(remmina_pref_dialog->entry_options_screenshot_name); @@ -506,8 +504,6 @@ static void remmina_pref_dialog_init(void) gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_view_mode, remmina_pref.default_mode); gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_tab_interface, remmina_pref.tab_mode); gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_fullscreen_toolbar_visibility, remmina_pref.fullscreen_toolbar_visibility); - gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons, remmina_pref.show_buttons_icons); - gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_show_menu_icons, remmina_pref.show_menu_icons); gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_options_scale_quality, remmina_pref.scale_quality); gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_options_ssh_loglevel, remmina_pref.ssh_loglevel); if (remmina_pref.screenshot_path != NULL) { @@ -559,8 +555,6 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->comboboxtext_appearance_view_mode = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_view_mode")); remmina_pref_dialog->comboboxtext_appearance_tab_interface = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_tab_interface")); remmina_pref_dialog->comboboxtext_appearance_fullscreen_toolbar_visibility = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_fullscreen_toolbar_visibility")); - remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_show_buttons_icons")); - remmina_pref_dialog->comboboxtext_appearance_show_menu_icons = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_show_menu_icons")); remmina_pref_dialog->comboboxtext_options_scale_quality = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_scale_quality")); remmina_pref_dialog->checkbutton_options_ssh_parseconfig = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_ssh_parseconfig")); remmina_pref_dialog->comboboxtext_options_ssh_loglevel = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_ssh_loglevel")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index 102508c78..1b4703d84 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -59,8 +59,6 @@ typedef struct _RemminaPrefDialog { GtkComboBox *comboboxtext_options_double_click; GtkComboBox *comboboxtext_appearance_view_mode; GtkComboBox *comboboxtext_appearance_tab_interface; - GtkComboBox *comboboxtext_appearance_show_buttons_icons; - GtkComboBox *comboboxtext_appearance_show_menu_icons; GtkComboBox *comboboxtext_options_scale_quality; GtkComboBox *comboboxtext_options_ssh_loglevel; GtkComboBox *comboboxtext_appearance_fullscreen_toolbar_visibility; |