From f44a61d10196ee77ffe2d810b447e87d2d9a9866 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Mar 2023 16:22:11 +0600 Subject: [PATCH] Options menu redesigned --- source/ubl-settings-manager.c | 27 +- source/ubl-settings-manager.h | 2 +- ubl-settings-manager.css | 82 +- ubl-settings-manager.glade | 2177 +++++++++++++++++---------------- 4 files changed, 1220 insertions(+), 1068 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 0217b62..9367c6c 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -282,11 +282,12 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ /* TODO */ int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned)); + if (position<250) {position=250; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),250);} main_config.iconSegmentSize=position; - if (position <115) position=115; + if (position <115) {position=115;} double pos=((double)position-(11/(double)position*4)*500)/1.3; if (pos<110) pos=110; - //printf("Paned moved to %f\n",pos); + printf("Paned moved to %f\n",pos); for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),pos); @@ -1490,7 +1491,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); curWidgets->socket=GTK_WIDGET(create_socket(curWidgets)); // curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemAboutSystem")); - g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "clicked", G_CALLBACK(on_about_system),curWidgets); + g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "activate", G_CALLBACK(on_about_system),curWidgets); if (curWidgets->ButtonBackToMain!=NULL) gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings")); gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager"); @@ -1523,7 +1524,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->helpText=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"helpText")); curWidgets->settingsSizeInfoLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSizeInfoLabel")); curWidgets->settingsIcon=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsIcon")); - curWidgets->settingsSectionsSettingsButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSectionsSettingsButton")); + // curWidgets->settingsSectionsSettingsButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSectionsSettingsButton")); curWidgets->SectionSettingsWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsWindow")); curWidgets->SectionSettingsPack=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsPack")); curWidgets->settingsSizeSlider=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSizeSlider")); @@ -1546,8 +1547,8 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_window_resize(GTK_WINDOW(curWidgets->window),main_config.windowWidth,main_config.windowHeight); gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->window),AppIconPath,NULL); gtk_window_set_icon_from_file(GTK_WINDOW(curWidgets->SectionSettingsWindow),AppIconPath,NULL); - g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "clicked", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); - g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "clicked", G_CALLBACK(on_settingsOpen), curWidgets); + g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); + g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets); if (gnld==0){ gnld=1; @@ -1558,7 +1559,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them g_signal_connect(G_OBJECT(curWidgets->settingsSizeSlider), "value-changed", G_CALLBACK(on_settings_icon_size_changed), curWidgets); g_signal_connect(G_OBJECT(curWidgets->settingsCancel), "clicked", G_CALLBACK(on_settings_cancel), curWidgets); g_signal_connect(G_OBJECT(curWidgets->settingsAccept), "clicked", G_CALLBACK(on_settings_accept), widgetss); - g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets); + // g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingAddButton), "clicked", G_CALLBACK(on_sections_add), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsClearEntryButton), "clicked", G_CALLBACK(on_sections_new_clear), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsCloseButton), "clicked", G_CALLBACK(on_sections_close), curWidgets); @@ -1575,11 +1576,11 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_button_set_label(GTK_BUTTON(curWidgets->settingsCancel),_("Close")); gtk_button_set_label(GTK_BUTTON(curWidgets->settingsAccept),_("Save and apply")); gtk_button_set_label(GTK_BUTTON(curWidgets->AlwaysOpenDocumentation),_("Always redirect")); - gtk_button_set_label(GTK_BUTTON(curWidgets->MenuItemSettings),_("Settings")); - gtk_button_set_label(GTK_BUTTON(curWidgets->MenuItemDocumentation),_("About...")); - gtk_button_set_label(GTK_BUTTON(curWidgets->MenuItemAboutSystem),_("About system")); + gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemSettings),_("Settings")); + gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemDocumentation),_("About...")); + gtk_menu_item_set_label(GTK_MENU_ITEM(curWidgets->MenuItemAboutSystem),_("About system")); gtk_button_set_label(GTK_BUTTON(curWidgets->CautionUnderstandButton),_("Understood")); - gtk_button_set_label(GTK_BUTTON(curWidgets->settingsSectionsSettingsButton),_("Section management")); + // gtk_button_set_label(GTK_BUTTON(curWidgets->settingsSectionsSettingsButton),_("Section management")); return widgets; } @@ -1664,7 +1665,7 @@ int main(int argc, char *argv[]){ yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } if (geteuid()==0){ - gtk_widget_set_sensitive(widg->settingsSectionsSettingsButton,1); + // gtk_widget_set_sensitive(widg->settingsSectionsSettingsButton,1); } gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("Standard theme")); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("GNOME theme")); @@ -1688,7 +1689,7 @@ int main(int argc, char *argv[]){ gtk_css_provider_load_from_path(css,CssPath,NULL); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(css), - 0); + -1); gtk_main(); } diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index d5e4ff3..b9ded15 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -131,7 +131,7 @@ typedef struct { GtkWidget *GnomePaned; GtkWidget *GnomeInfoLabel; GtkWidget *workingwindow; - GtkWidget *settingsSectionsSettingsButton; + // GtkWidget *settingsSectionsSettingsButton; GtkWidget *SectionSettingsWindow; GtkWidget *SectionSettingsPack; dictionary *SettingsSections; diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 2d44bf7..100a2e1 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -29,4 +29,84 @@ background-color: #404040; } .noborder { border: none; -} +} +.menuitembottom{ + margin-top:0px; + margin-bottom:0px; + border-color:alpha(@theme_text_color, 0.4); + border-style:solid; + border-radius:0 0 5px 5px; + border-left-width:1px; + border-bottom-width:1px; + border-right-width:1px; +} +.menuitemmiddle{ + margin-top:0px; + margin-bottom:0px; + border-color:alpha(@theme_text_color, 0.4); + border-style:solid; + border-left-width:1px; + border-right-width:1px; +} + +.menuitemtop{ + margin-bottom:0px; + border-color:alpha(@theme_text_color, 0.4); + border-style:solid; + border-radius:5px 5px 0 0; + border-left-width:1px; + border-top-width:1px; + border-right-width:1px; +} +.menuitemtop *{ + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; +} +.menuitemmiddle *{ + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; +} +.menuitembottom *{ + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; +} +.menuitemtop:hover { + background:@theme_bg_color; +} +.menuitemmiddle:hover { + background:@theme_bg_color; +} +.menuitembottom:hover { + background:@theme_bg_color; + +} +.menuitemtop:hover* { + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; + background:@theme_selected_bg_color; + border-radius:2px; + border-color:transparent; +} +.menuitemmiddle:hover* { + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; + background:@theme_selected_bg_color; + border-radius:2px; + border-color:transparent; +} +.menuitembottom:hover* { + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; + background:@theme_selected_bg_color; + border-radius:2px; + border-color:transparent; +} +.menu { + background:transparent; +} +.workingbg { + background-color:@theme_base_color; +} +.workingbg.view.cell:selected{ + background-color:@theme_selected_bg_color; +} diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 2287410..9102a00 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -82,31 +82,54 @@ - - 5 - 5 + True - True - immediate - in - 150 - False - True + False + False + 4 - + True False - - - + Settings + True + + + + + + True + False + Documentation + True + + + + + + True + False + About system + True + + - + False - 450 - 250 - dialog-question + 800 + 600 + ubconfig-gui True @@ -116,40 +139,21 @@ True False - - - True - False - start - 20 - 20 - gtk-dialog-question - 6 - - - False - True - 0 - - True False + True vertical - + True False - start - 10 - 5 - Would you like to read documentation in the Web? - - - + center + 3 @@ -158,57 +162,419 @@ 0 + + + + False + True + 0 + + + + + True + True + 52 + True + True - + True - False - start - start - 15 - 10 - You will be redirected to documentation website where documentation is translated and supported by community. - True + True + in + + + True + False + + + True + False + 3 + 3 + vertical + + + + + + + + - True - True - 1 + False + True - - Always redirect to online documentation + True - True - False - end - 5 - 10 - True - + False + vertical + + + True + False + vertical + + + True + False + 3 + 3 + 3 + 3 + 3 + 0 + in + + + True + False + 12 + + + True + False + center + center + + + + False + True + 0 + + + + + True + False + + + desklabel + True + False + center + right + 1 + + + False + True + 0 + + + + + False + True + 1 + + + + + + + + + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + vertical + + + False + vertical + + + + + + False + True + 0 + + + + + False + True + 1 + + - False - True - 2 + True + True - True True + end 1 - + + + False + True + 0 + + + + + False + True + end + 2 + + + + + + + True + False + 32 + ubconfig-gui + 5 + + + + + True + False + center + center + vertical + + + + + + 1 + + + + + + + False + 450 + 250 + dialog-question + + + True + False + vertical + + + True + False + + + True + False + start + 20 + 20 + gtk-dialog-question + 6 + + + False + True + 0 + + + + + True + False + vertical + + + True + False + start + 10 + 5 + Would you like to read documentation in the Web? + + + + + + + False + True + 0 + + + + + True + False + start + start + 15 + 10 + You will be redirected to documentation website where documentation is translated and supported by community. + True + + + + True + True + 1 + + + + + Always redirect to online documentation + True + True + False + end + 5 + 10 + True + + + + False + True + 2 + + + + + + True + True + 1 + + + @@ -282,6 +648,50 @@ + + True + False + False + False + 4 + + + True + False + Settings + True + + + + + + True + False + Documentation + True + + + + + + True + False + About system + True + + + + + True False @@ -562,304 +972,237 @@ False gtk-go-back - - True - False - gtk-undelete - - - True + False + 800 + 600 ubconfig-gui - 6 - - - True - False - - - True - False - Element 1 - - - + True False - Element 2 - - + vertical + + True False - + True False - Element 3 + vertical + + + True + False + center + 3 + + + + False + True + 0 + + + + + False + True + 0 + - - - - - - - Element 4 - True - False - image3 - False - - - - - True - False - gtk-ok - - - False - 800 - 600 - - - True - False - vertical - - - True - True - 5 - 5 - 5 - 5 - in - + True False + vertical - + True False + 5 + 5 + 5 + 5 + 5 + 5 vertical - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - - - - - - False - True - 0 - - - - + + 5 + 5 True - False - 5 - 5 - 5 - 5 - 0 + True + immediate + never + always in - + True False - 3 - 3 - 5 - 5 + natural - + + 5 + 5 True False + vertical + 2 - - True - True - True - center - 3 - image2 - - - False - True - 0 - - - - - True - True - True - False - Section name - name - - - True - True - 1 - - - - - True - False - - - True - False - center - - - True - True - True - 5 - image4 - - - False - True - end - 2 - - - - - True - False - 2 - - - True - True - 5 - 5 - 5 - 10 - False - Identifier - - - True - True - 0 - - - - - True - True - 2 - - - - - True - True - 1 - - - - - True - True - 2 - + + - - - - False + True True - 1 + 0 + + True + True + 0 + + + + + False + vertical + + + + + + + False + True + 1 + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + True + False + True + + + True + False + True + + + True + False + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + + True + True + 0 + - - - True - True - 0 - - - - - True - False - - Close + True - True - True - 5 - 5 + False + center + center + + + + False True - end - 0 + 1 - - Save and apply + True - True - True - 17 - 5 + False + vertical + + + True + True + False + True + MainMenu + none + False + + + + + + False + True + 0 + + False True end - 1 + 2 - - False - True - 1 - - - - - - True - False - UBLinux Settings True @@ -869,275 +1212,290 @@ 5 + + + Back to settings + True + False + True + False + False + False + 10 + 10 + image1 + + + + + 1 + + + + + True + False + center + center + vertical + + + + + + + 2 + + - - - - - - - - Стандартная тема - - - GNOME тема - - - - - - - - - - - - - - - - + True - True - 6 - horizontal - liststoreTemplate - 10 - - - - 2 - 3 - 0 - - - - - - 2 - 3 - 1 - - - + False + gtk-undelete - + True False + ubconfig-gui + 6 - - - - - - - + + True False - + True False - 0 - none - - - True - False - 5 - 5 - 5 - 5 - - - True - False - 4 - 4 - 4 - 4 - vertical - - - True - True - True - Settings - - - False - True - 3 - - - - - True - True - True - Documentation - - - False - True - 4 - - - - - True - True - True - About system - - - False - True - 5 - - - + Element 1 + + + + + True + False + Element 2 + + + True + False + + + True + False + Element 3 - - - + + + + + Element 4 + True + False + image3 + False - + + True + False + gtk-ok + + False 800 600 - ubconfig-gui True False vertical - + True - False - - - True - False - vertical - - - True - False - center - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - + True + 5 + 5 + 5 + 5 + in - + True False - vertical - - Icon + True False - 2 - 2 - 2 - 2 - 2 - 2 + vertical - + True - True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 0 in - + True False - natural + 3 + 3 + 5 + 5 - + + True + False + + + True + True + True + center + 3 + image2 + + + False + True + 0 + + + + + True + True + True + False + Section name + name + + + True + True + 1 + + + + + True + False + + + True + False + center + + + True + True + True + 5 + image4 + + + False + True + end + 2 + + + + + True + False + 2 + + + True + True + 5 + 5 + 5 + 10 + False + Identifier + + + True + True + 0 + + + + + True + True + 2 + + + + + True + True + 1 + + + + + True + True + 2 + + + - + + + - True + False True - 0 - - - - - - True - True - 0 - - - - - True - False - vertical - - - - + 1 + + - - False - True - 1 - - - True - True - 1 - - True @@ -1145,50 +1503,56 @@ 0 - - - - - True - False - + True False - True - + + Close True - False - UBLinux Settings Manager + True + True + 5 + 5 - True + False True + end 0 - + + Save and apply True True - False True - menu1 - none - settingsPopover - - - + 17 + 5 False True + end 1 + + False + True + 1 + + + + + + True + False + UBLinux Settings True @@ -1200,352 +1564,148 @@ - - - False - 800 - 600 - ubconfig-gui + + + + + + + + Стандартная тема + + + GNOME тема + + + + + + + + + + + + + + + + + True + True + 6 + horizontal + liststoreTemplate + 10 - - True - False - vertical - - - True - False - - - True - False - vertical - - - True - False - center - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - - - 5 - 5 - True - True - immediate - never - always - in - - - True - False - natural - - - 5 - 5 - True - False - vertical - 2 - - - - - - - - - - - True - True - 0 - - - - - True - True - 0 - - - - - False - vertical - - - - - - - False - True - 1 - - - - - - True - True - 1 - - - - - True - True - 0 - - - + + + 2 + 3 + 0 + - - + + + + 2 + 3 + 1 + + + + + + True + False + + + + + + + + + False + + True False - True - - + 0 + none + + True False - True + 5 + 5 + 5 + 5 True False + 4 + 4 + 4 + 4 + vertical - + True - False - UBLinux Settings Manager + True + True + Settings - True + False True - 0 + 3 - - - True - True - 0 - - - - - True - False - center - center - + + True + True + True + Documentation + + + False + True + 4 + - - - - False - True - 1 - - - - - True - False - vertical - + True True - False True - none - settingsPopover - - - + About system False True - 0 + 5 + - - False - True - end - 2 - - - - - - - True - False - 32 - ubconfig-gui - 5 - - - - - Back to settings - True - False - True - False - False - False - 10 - 10 - image1 - - - - - 1 - - - - - True - False - center - center - vertical - - - - - - 2 - - - - - - - False - - - True - False - 4 - 4 - 4 - 4 - 4 - 4 - vertical - - - True - True - True - Settings - - - False - True - 3 - - - - - True - True - True - Documentation - - False - True - 4 - - - - True - True - True - About system - - - False - True - 5 - + + - - + False 800 600 @@ -1563,10 +1723,9 @@ True False - True vertical - + True False center @@ -1593,134 +1752,39 @@ - + True - True - 52 - True - True - - - True - True - in - - - True - False - - - True - False - 3 - 3 - vertical - - - - - - - - - - - - False - True - - + False + vertical - + + Icon True False - vertical + 2 + 2 + 2 + 2 + 2 + 2 - + True - False - vertical + True + in - + True False - 3 - 3 - 3 - 3 - 3 - 0 - in + natural - - True - False - 12 - - - True - False - center - center - - - - False - True - 0 - - - - - True - False - - - desklabel - True - False - center - right - 1 - - - False - True - 0 - - - - - False - True - 1 - - - - - - - - - - True - True - 0 - + True @@ -1728,46 +1792,45 @@ 0 + + + + True + True + 0 + + + + + True + False + vertical - - True - False - vertical - - - False - vertical - - - - - - False - True - 0 - - - - - False - True - 1 - + + - True - True + False + True + 1 True True - end 1 + True @@ -1781,28 +1844,16 @@ True False - True True False True - + True False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - + UBLinux Settings Manager True @@ -1811,11 +1862,14 @@ - + True - False - center - center + True + False + True + menu1 + none + settingsPopover @@ -1826,36 +1880,6 @@ 1 - - - True - False - - - True - True - False - True - none - settingsPopover1 - - - - - - False - True - 0 - - - - - False - True - end - 2 - - @@ -1867,21 +1891,68 @@ 5 + + + + + + False + + + True + False + 4 + 4 + 4 + 4 + 4 + 4 + vertical - + True - False - center - center - vertical - - - + True + True + Settings - 1 + False + True + 3 + + + + + True + True + True + Documentation + + + False + True + 4 + + + + + True + True + True + About system + + + False + True + 5 +