From 7b1a0075a6e09d70abce4a1e361aa22752a827aa Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Fri, 30 Jun 2023 17:51:17 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D1=83=20=E2=84=9611?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-resourcequota.c | 7 +- source/ubl-utils.c | 28 +++++- source/ubl-utils.h | 4 + ubl-settings-resourcequota.css | 147 ++++++++++++++++------------ ubl-settings-resourcequota.glade | 19 ---- 5 files changed, 122 insertions(+), 83 deletions(-) diff --git a/source/ubl-settings-resourcequota.c b/source/ubl-settings-resourcequota.c index 6b87c9e..bc87ac7 100644 --- a/source/ubl-settings-resourcequota.c +++ b/source/ubl-settings-resourcequota.c @@ -180,8 +180,11 @@ main_window *setup_window(){ widgets->LoadLocalMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem"); widgets->LeftBox = yon_gtk_builder_get_widget(builder,"HeaderLeftBox"); - widgets->DocumentationMenuItem = yon_gtk_builder_get_widget(builder,"DocumentationMenuItem"); - widgets->AboutMenuItem = yon_gtk_builder_get_widget(builder,"AboutMenuItem"); + widgets->DocumentationMenuItem = yon_ubl_menu_item_documentation_new(DOCUMENTATION_LABEL); // yon_gtk_builder_get_widget(builder,"DocumentationMenuItem"); + widgets->AboutMenuItem = yon_ubl_menu_item_about_new(ABOUT_LABEL); + GtkWidget *menu = yon_gtk_builder_get_widget(builder,"menuAbout"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->DocumentationMenuItem); + gtk_menu_shell_append(GTK_MENU_SHELL(menu),widgets->AboutMenuItem); widgets->btnShowFilters = yon_gtk_builder_get_widget(builder,"btnShowFilters"); if (main_config.lock_load_global == 1){ diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 46ff5ad..4def2f6 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -1413,7 +1413,33 @@ void yon_terminal_integrated_start(GtkWidget *terminal, char* command, void *end gtk_window_move(__yon_window_config_target_window,__yon_main_window_config.x,__yon_main_window_config.y); gtk_window_resize(__yon_window_config_target_window,__yon_main_window_config.width,__yon_main_window_config.height); } - +GtkWidget *yon_ubl_menu_item_about_new(char *buttonname){ + GtkWidget *menu_item = gtk_menu_item_new(); + gtk_style_context_add_class(gtk_widget_get_style_context(menu_item),"menuitembottom"); + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + GtkWidget *label = gtk_label_new(buttonname); + GtkWidget *image = gtk_image_new_from_icon_name("dialog-information-symbolic",GTK_ICON_SIZE_BUTTON); + gtk_label_set_xalign(GTK_LABEL(label),0.0); + gtk_box_pack_start(GTK_BOX(box),image,0,0,5); + gtk_box_pack_start(GTK_BOX(box),label,0,0,5); + gtk_container_add(GTK_CONTAINER(menu_item),box); + gtk_widget_show_all(menu_item); + return menu_item; +} + +GtkWidget *yon_ubl_menu_item_documentation_new(char *buttonname){ + GtkWidget *menu_item = gtk_menu_item_new(); + gtk_style_context_add_class(gtk_widget_get_style_context(menu_item),"menuitemtop"); + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + GtkWidget *label = gtk_label_new(buttonname); + GtkWidget *image = gtk_image_new_from_icon_name("dialog-question-symbolic",GTK_ICON_SIZE_BUTTON); + gtk_label_set_xalign(GTK_LABEL(label),0.0); + gtk_box_pack_start(GTK_BOX(box),image,0,0,5); + gtk_box_pack_start(GTK_BOX(box),label,0,0,5); + gtk_container_add(GTK_CONTAINER(menu_item),box); + gtk_widget_show_all(menu_item); + return menu_item; +} int yon_gtk_combo_box_text_fill(GtkWidget *combo, config_str parameters,int size){ if (combo&¶meters){ for (int i=0;i* { border-color:alpha(@theme_text_color, 0.01); -} -.menuitembottom{ - margin-top:0px; - margin-bottom:3px; -} -.menuitemmiddle{ - margin-top:0px; - margin-bottom:0px; -} - -.menuitemtop{ - margin-bottom:0px; -} -.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; - border-color:inherit; - border-left-width:inherit; - border-right-width:inherit; -} -.menuitemmiddle:hover { - background:@theme_bg_color; - border-color:inherit; - border-left-width:inherit; - border-right-width:inherit; -} -.menuitembottom:hover { - background:@theme_bg_color; - border-color:inherit; - border-left-width:inherit; - border-right-width:inherit; +}.menuitembottom{ + margin-top:0px; + margin-bottom:3px; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; + } + .menuitemmiddle{ + margin-top:0px; + margin-bottom:0px; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; + } -} -.menuitemtop:hover* { - margin:2px 2px 0 2px; - padding: 5px 10px 3px 5px; - background:@theme_selected_bg_color; - border-radius:2px; -} -.menuitemmiddle:hover* { - margin:0 2px 0 2px; - padding: 3px 10px 3px 5px; - background:@theme_selected_bg_color; - border-radius:2px; -} -.menuitembottom:hover* { - margin:0 2px 2px 2px; - padding: 3px 10px 5px 5px; - background:@theme_selected_bg_color; - border-radius:2px; -} + .menuitemtop{ + margin-bottom:0px; + border-color:inherit; + border-top-width:inherit; + border-left-width:inherit; + border-right-width:inherit; + } + .menuitemtop *{ + margin:2px 2px 0 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 5px 0px 3px 5px; */ + border:transparent; + } + .menuitemmiddle *{ + margin:0 2px 0 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 3px 0px 3px 5px; */ + border:transparent; + } + .menuitembottom *{ + margin:0 2px 2px 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 3px 0px 5px 5px; */ + } + .menuitemtop:hover { + background:@theme_bg_color; + border-color:inherit; + border-top-width:inherit; + border-left-width:inherit; + border-right-width:inherit; + } + .menuitemmiddle:hover { + background:@theme_bg_color; + border-color:inherit; + border-left-width:inherit; + border-right-width:inherit; + } + .menuitembottom:hover { + background:@theme_bg_color; + border-color:inherit; + border-bottom-width:0px; + border-left-width:inherit; + border-right-width:inherit; + + } + .menuitemtop:hover* { + margin:2px 2px 0 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 5px 0 3px 5px; */ + background:@theme_selected_bg_color; + border-radius:2px; + } + .menuitemmiddle:hover* { + margin:0 2px 0px 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 3px 0px 3px 5px; */ + background:@theme_selected_bg_color; + border-radius:2px; + } + .menuitembottom:hover* { + margin:0 2px 2px 2px; + padding-top:2px; + padding-bottom:2px; + /* padding: 3px 0px 5px 5px; */ + background:@theme_selected_bg_color; + border-radius:2px; + } .workingbg, #workingbg { background-color:@theme_base_color; diff --git a/ubl-settings-resourcequota.glade b/ubl-settings-resourcequota.glade index 9d8ac3a..56092ce 100644 --- a/ubl-settings-resourcequota.glade +++ b/ubl-settings-resourcequota.glade @@ -2605,25 +2605,6 @@ translated and supported by community. False False False - - - True - False - - - - - - True - False - - - True