From 305343c889a9d88411315d27fce1baf83d7c02f5 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Feb 2023 18:08:34 +0600 Subject: [PATCH 01/36] bug fixes --- source/CMakeLists.txt | 8 +++++++- source/ubl-settings-manager.c | 4 ++-- ubl-settings-manager.glade | 17 +++++------------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 318ac88..56123a5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -13,7 +13,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissin set(SOURCE_FILES ubl-settings-manager.c - ubl-settings-manager.h) + ubl-settings-manager.h + ui/ubl-settings-manager.glade + css/ubl-settings-manager.css) set(LIBRARIES ${GTK_LIBRARIES} @@ -22,4 +24,8 @@ set(LIBRARIES add_executable(ubl-settings-manager ${SOURCE_FILES}) target_link_libraries(ubl-settings-manager ${LIBRARIES}) + +file(COPY ui DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY css DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + install(TARGETS ubl-settings-manager DESTINATION bin) \ No newline at end of file diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index dfe83a4..e0c53cd 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -1540,7 +1540,7 @@ int main(int argc, char *argv[]){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); + gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); theme="Gnome"; main_config.WindowTheme=1; widgets->next=yon_dictionary_create_empty(); @@ -1555,7 +1555,7 @@ int main(int argc, char *argv[]){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->icvpack); + gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 8566978..5deadd5 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -430,15 +430,7 @@ True False - - True - True - 6 - - - True - -1 - + @@ -527,6 +519,7 @@ 64 True False + ublinux-ubconfig False @@ -1376,7 +1369,7 @@ True False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ublinux-ubconfig 5 @@ -1576,7 +1569,7 @@ True False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ublinux-ubconfig 5 @@ -1752,7 +1745,7 @@ True False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ublinux-ubconfig 5 From 9108dc21fed5463246ce7c6ac0b70d8d12aab8a2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 28 Feb 2023 10:08:11 +0600 Subject: [PATCH 02/36] minor changes and fixes --- Makefile | 6 +- source/ubl-settings-manager.c | 93 +- source/ubl-settings-manager.h | 3 +- ubconfig-gui.svg | 4957 +++++++++++++++++++++++++++++++++ ubconfig-main.conf | 2 +- ubl-settings-manager.css | 13 +- ubl-settings-manager.desktop | 2 +- ubl-settings-manager.glade | 980 ++++--- 8 files changed, 5598 insertions(+), 458 deletions(-) create mode 100644 ubconfig-gui.svg diff --git a/Makefile b/Makefile index 4c1f9b8..d73c976 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ uninstall: @$(RM) "/usr/share/applications/${PKGNAME}.desktop" @$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.png" @$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.svg" + @$(RM) "/usr/share/icons/hicolor/scalable/apps/ubconfig-gui.svg" @$(RM) "/etc/ubconfig-main.conf" @$(RM) "~/ubconfig-main.conf" @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @@ -102,19 +103,18 @@ install: check uninstall done @install -dm755 /usr/share/icons/hicolor/scalable/apps @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.svg - @install -dm755 /usr/share/icons/hicolor/scalable/status + @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ubconfig-gui.svg @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade @install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css @install -Dm644 -t /etc/ ubconfig-main.conf chmod 766 /etc/ubconfig-main.conf - @install -Dm655 -t ~/.config/ ubconfig-main.conf @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.png @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications - @echo "Install: OK ${USER}" + @echo "Install: OK" clean: @echo "Clean ..." diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index e0c53cd..24aeb38 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -267,7 +267,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned)); main_config.iconSegmentSize=position; if (position <115) position=115; - double pos=((double)position-(1/(double)position*4)*500)/1.8; + double pos=((double)position-(11/(double)position*4)*500)/1.3; if (pos<110) pos=110; //printf("Paned moved to %f\n",pos); for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ @@ -293,7 +293,7 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ char *tmp=malloc(6); sprintf(tmp,"%dx%d\0",main_config.iconsize,main_config.iconsize); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),tmp); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale("/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg",main_config.iconsize,main_config.iconsize,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,main_config.iconsize,main_config.iconsize,1,NULL)); gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; @@ -301,22 +301,22 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets){ int val=(int)gtk_range_get_value(GTK_RANGE(self)); if ((int)val==1||(int)val==0){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale("/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg",24,24,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); main_config.iconsize=24; } if ((int)val==2){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale("/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg",32,32,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); main_config.iconsize=32; } if ((int)val==3){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale("/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg",48,48,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); main_config.iconsize=48; } if ((int)val==4){ - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale("/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg",64,64,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); main_config.iconsize=64; } @@ -613,6 +613,8 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ actionWidgets *widgets=(actionWidgets*)widgetsD->data; int x,y; + + printf("1\n"); gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); if (main_config.windowWidth<1240){ if (stld==0){ @@ -633,6 +635,8 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget gtk_widget_hide(widgets->window); } }else { + yon_segments_hide(widgets); + yon_segments_show(widgets); if (stld==1){ stld=0; cmld=0; @@ -693,15 +697,17 @@ apps *get_app_by_name(apps *applist,char *name, int size){ int reload_list(IVGraphicals *section){ gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); - gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); - gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); + //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); + //gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); } int load_apps(IVGraphicals *section, apps *applist, int size){ int catstofind=sizeof(section->categories)/sizeof(char*); int i=0; for (int i=0;icategories)==1){ + //printf("Проверка прошла.\n"); GError *err=NULL; char *path=malloc(strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); @@ -715,14 +721,15 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); - char *ChosenName; - ChosenName=applist[i].Name; - gtk_list_store_set(section->LV,&iter,0,pixbuf,1,ChosenName,-1); + GtkTreePath *pth = gtk_tree_model_get_path(GTK_TREE_MODEL(section->LV),&iter); + gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5,-1); } + //printf("Конец\n"); } + gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); - gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); - gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); + //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); + //gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); }; int load_apps_with_clear(IVGraphicals *section, apps *applist, int size){ @@ -1005,12 +1012,23 @@ void yon_set_default_sections(dictionary **section){ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVGraphicals *IVG=malloc(sizeof(IVGraphicals)); GtkWidget *box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - GtkWidget *iv=gtk_icon_view_new(); + GtkBuilder *builder=gtk_builder_new_from_file(GladePath); + GtkWidget *iv=GTK_WIDGET(gtk_builder_get_object(builder,"iconTemplate")); GtkWidget *label=gtk_label_new(_(name)); PangoAttrList *attrs=pango_attr_list_new(); + PangoFontDescription *descr=pango_font_description_new(); + pango_font_description_set_weight(descr,PANGO_WEIGHT_BOLD); + int stretch = main_config.labelDensity; + if (stretch>8) + stretch = 4; + pango_font_description_set_stretch(descr,main_config.labelDensity); pango_attr_list_insert(attrs,pango_attr_size_new(main_config.labelSize)); + pango_attr_list_insert(attrs, pango_attr_font_desc_new(descr)); gtk_label_set_attributes(GTK_LABEL(label),attrs); - gtk_widget_set_name(label,"iconlabel"); + gtk_widget_set_margin_end(label,6); + gtk_widget_set_margin_start(label,6); + gtk_widget_set_margin_bottom(label,2); + //gtk_widget_set_name(label,"SepIcon"); if (main_config.WindowTheme==1) { gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); gtk_widget_set_name(iv,"GnomeIcon"); @@ -1018,17 +1036,23 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } else { gtk_widget_set_name(iv,"Icon"); + gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); - gtk_widget_set_name(sep,"thinborder"); - GtkListStore *lv=gtk_list_store_new(2, GDK_TYPE_PIXBUF,G_TYPE_STRING); + //gtk_widget_set_name(sep,"SepIcon"); + GtkListStore *lv=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststoreTemplate")); gtk_widget_set_halign(box,0); gtk_widget_set_valign(box,1); - gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(iv),0); - gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); - gtk_icon_view_set_item_width(GTK_ICON_VIEW(iv),75); + gtk_widget_set_margin_end(sep,6); + gtk_widget_set_margin_start(sep,6); + + //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(iv),0); + //gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); + //gtk_icon_view_set_item_width(GTK_ICON_VIEW(iv),150); gtk_icon_view_set_model(GTK_ICON_VIEW(iv),GTK_TREE_MODEL(lv)); + gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),0); + gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(iv),10); gtk_label_set_xalign(GTK_LABEL(label),0); gtk_box_pack_start(GTK_BOX(box),label,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(box),sep,FALSE,FALSE,0); @@ -1106,8 +1130,10 @@ void yon_icv_resize_item(dictionary *icdict, GtkWidget *paned){ for (dictionary *dict=icdict->first;dict!=NULL;dict=dict->next){ IVGraphicals *icv=(IVGraphicals*)dict->data; int width=gtk_paned_get_position(GTK_PANED(paned)); - if (width < 115) width=115; - gtk_icon_view_set_item_width(GTK_ICON_VIEW(icv->IV),width); + int pos=(int)((double)width-(11/(double)width*4)*500)/1.3; + if (pos < 115) pos=115; + + gtk_icon_view_set_item_width(GTK_ICON_VIEW(icv->IV),pos); } } @@ -1331,6 +1357,7 @@ void yon_segment_show(actionWidgets *widgets, SectionSettingSegment *sgm){ } void yon_segments_show(actionWidgets *widgets){ + if(widgets->SettingsSections) for (dictionary *dict=widgets->SettingsSections->first;dict!=NULL;dict=dict->next){ SectionSettingSegment *sgm=(SectionSettingSegment*)dict->data; if (sgm!=NULL) @@ -1341,6 +1368,7 @@ void yon_segments_show(actionWidgets *widgets){ }; void yon_segments_hide(actionWidgets *widgets){ + if(widgets->SettingsSections) for (dictionary *dict=widgets->SettingsSections->first;dict!=NULL;dict=dict->next){ SectionSettingSegment *sgm=(SectionSettingSegment*)dict->data; if (sgm!=NULL){ @@ -1384,12 +1412,15 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->socketbuttonplace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"socketbuttonplace"))); curWidgets->Overlay=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Overlay"))); curWidgets->ThirdSocketPlace=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"ThirdSocketPlace"))); + curWidgets->MenuItemSettings=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemSettings"))); + curWidgets->MenuItemDocumentation=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemDocumentation"))); + curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemAboutSystem"))); curWidgets->SettingsSections=NULL; 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), "activate", G_CALLBACK(on_about_system),curWidgets); + g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "clicked", 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"); @@ -1414,9 +1445,6 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->settingsThemeChooser=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsThemeChooser")); curWidgets->SettingsWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SettingsWindow")); - curWidgets->MenuItemSettings=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemSettings")); - curWidgets->MenuItemDocumentation=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemDocumentation")); - curWidgets->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"MenuItemAboutSystem")); curWidgets->DialogOpenDocumentation=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"HelpSureWindow")); curWidgets->CancelHelpButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CancelHelpButton")); curWidgets->ReadHelpButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"ReadHelpButton")); @@ -1448,14 +1476,15 @@ 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); if (gnld==0){ gnld=1; - g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); + g_signal_connect(G_OBJECT(curWidgets->CancelHelpButton), "clicked", G_CALLBACK(on_CancelHelpButton_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->ReadHelpButton), "clicked", G_CALLBACK(on_ReadHelpButton_activated), curWidgets->builder); - g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets); + 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); @@ -1476,9 +1505,9 @@ 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_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->MenuItemSettings),_("Settings")); + gtk_button_set_label(GTK_BUTTON(curWidgets->MenuItemDocumentation),_("About...")); + gtk_button_set_label(GTK_BUTTON(curWidgets->MenuItemAboutSystem),_("About system")); gtk_button_set_label(GTK_BUTTON(curWidgets->CautionUnderstandButton),_("Understood")); gtk_button_set_label(GTK_BUTTON(curWidgets->settingsSectionsSettingsButton),_("Section management")); return widgets; diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 92f3100..84b32cb 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -3,11 +3,12 @@ #include + #define GladePath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager.glade" #define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css" #define GlobalConfigPath "/etc/ubconfig-main.conf" #define UserConfigPath "/.config/ubl-settings-manager/ubconfig-main.conf" -#define AppIconPath "/usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg" +#define AppIconPath "/usr/share/icons/hicolor/scalable/apps/ubconfig-gui.svg" #define AppBannerPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.png" #define DesktopPath "/usr/share/applications/" #define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/" diff --git a/ubconfig-gui.svg b/ubconfig-gui.svg new file mode 100644 index 0000000..f636c26 --- /dev/null +++ b/ubconfig-gui.svg @@ -0,0 +1,4957 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ubconfig-main.conf b/ubconfig-main.conf index 4d5b3a4..34e755e 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -4,7 +4,7 @@ WindowPosY=0 WindowWidth=800 WindowHeight=600 WindowTheme=0 -IconSize=2 +IconSize=3 IconSegmentSize=250 LabelSize=12 LabelDensity=0 diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 437117d..2d44bf7 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -6,9 +6,17 @@ background-color: #404040; #GnomeIcon{ border-style:solid; border-bottom-width: 1px; - border-image: linear-gradient(90deg, #aaaaaa 0%, #dcddde 100%); + border-image: linear-gradient(90deg, #aaaaaa 0%, rgba(170,170,170,0) 80%); border-image-slice: 1; } + +#SepIcon{ + border-style:solid; + border-bottom-width: 2px; + border-image: linear-gradient(90deg, #aaaaaa 0%, rgba(170,170,170,0) 100%); + border-image-slice: 1; +} + #iconlabel { font-size:14px; font-weight: bold; @@ -19,3 +27,6 @@ background-color: #404040; border-width:1px; border-radius:5px; } +.noborder { + border: none; +} diff --git a/ubl-settings-manager.desktop b/ubl-settings-manager.desktop index 0e55e44..e2e7a3f 100644 --- a/ubl-settings-manager.desktop +++ b/ubl-settings-manager.desktop @@ -8,7 +8,7 @@ Comment=ubl-settings-manager Comment[ru]=Приложение для управления настройками UBLinux Type=Application Exec=ubl-settings-manager -Icon=ublinux-ubconfig +Icon=ubconfig-gui Terminal=false X-XfcePluggable=false Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 5deadd5..5e8a228 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -82,41 +82,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True True + immediate in 150 True @@ -126,6 +95,8 @@ False + 5 + 5 True False 3 @@ -305,6 +276,22 @@ + + + True + False + UBLinux Settings + + + True + False + 32 + gtk-dialog-question + 5 + + + + True @@ -321,8 +308,13 @@ vertical + 5 + 5 True True + immediate + never + always in @@ -331,6 +323,8 @@ natural + 5 + 5 True False vertical @@ -382,55 +376,28 @@ False emblem-danger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + True False + menu - + + True + False + + + + True False - - - - - - True - False - + + True + False + True + @@ -519,7 +486,7 @@ 64 True False - ublinux-ubconfig + ubconfig-gui False @@ -711,7 +678,7 @@ - + True False UBLinux Settings @@ -736,7 +703,7 @@ True False - ../../../../usr/share/icons/hicolor/32x32/apps/ublinux-ubconfig.svg + ubconfig-gui 6 @@ -1022,7 +989,7 @@ - + True False UBLinux Settings @@ -1043,39 +1010,134 @@ - + + + + + + + + + + + + + True - False + True + 6 + horizontal + liststoreTemplate + 3 - - True - False - Settings of UBL Settings Manager - Settings - True - + + + 2 + 3 + 0 + - - True - False - Documentation - True - + + + 2 + 3 + 1 + + + + True + False + + + + + + + + + False - + True False - About system... - True + 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 + + + + + + + + + + - + False 800 600 + ubconfig-gui True @@ -1089,10 +1151,9 @@ True False - True vertical - + True False center @@ -1119,163 +1180,85 @@ - + True - True - 52 - True - True + False + vertical - + + Icon True False + 2 + 2 + 2 + 2 + 2 + 2 - + True True - 6 + in + + + True + False + natural + + + + + + - -1 + True + True + 0 + - False - True + True + True + 0 - + 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 - + + - True - True + False + True + 1 True True - end 1 + True @@ -1289,28 +1272,16 @@ True False - True True False True - + True False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - + UBLinux Settings Manager True @@ -1319,9 +1290,14 @@ - + True - False + True + False + True + menu1 + none + settingsPopover @@ -1332,67 +1308,29 @@ 1 - - - True - False - - - True - True - False - True - menu1 - none - False - - - - - - False - True - 0 - - - - - False - True - end - 2 - - True False - ublinux-ubconfig + 32 + ubconfig-gui 5 - - - True - False - vertical - - - - - - 1 - - + - + False 800 600 + ubconfig-gui True @@ -1408,7 +1346,7 @@ False vertical - + True False center @@ -1435,73 +1373,39 @@ - + True False - vertical - - Icon + True - False - 2 - 2 - 2 - 2 - 2 - 2 + True + 6 + horizontal + 50 - - True - True - in - - - True - False - natural - - - - - - - - - True - True - 0 - + + + 2 + 3 + 1 + 0 + - - - - True - True - 0 - - - - - True - False - vertical - + + + 2 + 3 + 1 + + + + - - False - True - 1 + -1 @@ -1511,9 +1415,6 @@ 1 - True @@ -1527,16 +1428,28 @@ True False + True True False True - + True False - UBLinux Settings Manager + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + True @@ -1545,17 +1458,17 @@ - + True - True - False - True - menu1 - none - False + False + center + center + False @@ -1563,27 +1476,154 @@ 1 + + + True + False + vertical + + + True + True + False + True + none + settingsPopover + + + + + + False + True + 0 + + + + + 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 - False - ublinux-ubconfig - 5 + True + True + Documentation + + False + True + 4 + + + + + True + True + True + About system + + + False + True + 5 + + - - + False 800 600 + ubconfig-gui True @@ -1597,9 +1637,10 @@ True False + True vertical - + True False center @@ -1626,23 +1667,163 @@ - + True - False + True + 52 + True + True - + True - True - 6 + False + + + True + True + 6 + + + -1 + + - -1 + False + True + + + + + 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 + + + + + True + True True True + end 1 @@ -1670,7 +1851,7 @@ True False - + True False UBLinux Settings Manager @@ -1689,17 +1870,12 @@ - + True False - center - center - False @@ -1711,16 +1887,14 @@ True False - vertical - + True True False True - menu1 none - False + settingsPopover1 @@ -1745,57 +1919,25 @@ True False - ublinux-ubconfig + 32 + ubconfig-gui 5 - - Back to settings - True - False - True - False - False - False - 10 - 10 - image1 - - - - - 1 - - - - + True False - center - center vertical - - 2 + 1 - - - - - - From 0f282f191c8a55fded628c1822aa249a89c6860a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 1 Mar 2023 16:22:45 +0600 Subject: [PATCH 03/36] Fixed Gnome theme crash, css edits --- source/CMakeLists.txt | 8 +- source/ubl-settings-manager.c | 177 ++++++++++++++------ source/ubl-settings-manager.h | 15 +- ubconfig-main.conf | 6 +- ubl-settings-manager.glade | 303 ++++++++++++++-------------------- 5 files changed, 269 insertions(+), 240 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 56123a5..09788d7 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -9,13 +9,11 @@ link_directories(${GTK_LIBRARY_DIRS}) add_definitions(${GTK_CFLAGS_OTHER}) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -std=c++2a") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always -lm") set(SOURCE_FILES ubl-settings-manager.c - ubl-settings-manager.h - ui/ubl-settings-manager.glade - css/ubl-settings-manager.css) + ubl-settings-manager.h) set(LIBRARIES ${GTK_LIBRARIES} @@ -24,8 +22,6 @@ set(LIBRARIES add_executable(ubl-settings-manager ${SOURCE_FILES}) target_link_libraries(ubl-settings-manager ${LIBRARIES}) - file(COPY ui DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY css DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - install(TARGETS ubl-settings-manager DESTINATION bin) \ No newline at end of file diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 24aeb38..0217b62 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -50,6 +50,10 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_hide(builder->appSettings); if (builder->ButtonBackToMain!=NULL) gtk_widget_set_sensitive(builder->ButtonBackToMain,1); gtk_widget_show(GTK_WIDGET(self)); + gtk_widget_show(builder->socketbuttonplace); + gtk_widget_show(builder->ThirdSocketPlace); + gtk_widget_show(builder->socketbutton); + gtk_widget_show(builder->ThirdSocket); } void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ @@ -205,11 +209,16 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); } GKeyFile *gfile=g_key_file_new(); - int sz; - if (main_config.iconsize==64) sz=4; - if (main_config.iconsize==48) sz=3; - if (main_config.iconsize==32) sz=2; - if (main_config.iconsize==24) sz=1; + + int sz=1,szm=1; + if (main_config.Gnomeiconsize==64) sz=4; + if (main_config.Gnomeiconsize==48) sz=3; + if (main_config.Gnomeiconsize==32) sz=2; + if (main_config.Gnomeiconsize==24) sz=1; + if (main_config.Mainiconsize==64) szm=4; + if (main_config.Mainiconsize==48) szm=3; + if (main_config.Mainiconsize==32) szm=2; + if (main_config.Mainiconsize==24) szm=1; char *fromint=malloc(5); memset(fromint,0,5); GError *err=NULL; @@ -245,19 +254,27 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ sprintf(fromint,"%d",main_config.WindowTheme); g_key_file_set_string(gfile,"window","WindowTheme",fromint); sprintf(fromint,"%d",sz); - g_key_file_set_string(gfile,"window","IconSize",fromint); + g_key_file_set_string(gfile,"window","GnomeIconSize",fromint); + sprintf(fromint,"%d",szm); + g_key_file_set_string(gfile,"window","MainIconSize",fromint); sprintf(fromint,"%d",main_config.iconSegmentSize); g_key_file_set_string(gfile,"window","IconSegmentSize",fromint); - sprintf(fromint,"%d",(int)((float)main_config.labelSize/1000)); - g_key_file_set_string(gfile,"window","LabelSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.GnomelabelSize/1000)); + g_key_file_set_string(gfile,"window","GnomeLabelSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.MainlabelSize/1000)); + g_key_file_set_string(gfile,"window","MainLabelSize",fromint); sprintf(fromint,"%d",(int)((float)main_config.labelDensity/1000)); g_key_file_set_string(gfile,"window","LabelDensity",fromint); g_key_file_set_string(gfile,"window","User",login); + for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; g_key_file_set_string(gfile,"sections",IV->sectionName,IV->categories); - load_apps_with_clear(IV,widgets->applist,widgets->appssize); + if (main_config.changed==1){ + load_apps_with_clear(IV,widgets->applist,widgets->appssize); + } } + main_config.changed=0; g_key_file_save_to_file(gfile,pth,NULL); gtk_widget_hide(widgets->SettingsWindow); //gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); @@ -285,15 +302,15 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ gtk_widget_show_all(widgets->SettingsWindow); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->settingsThemeChooser),main_config.WindowTheme); int sz=1; - if (main_config.iconsize==64) sz=4; - if (main_config.iconsize==48) sz=3; - if (main_config.iconsize==32) sz=2; - if (main_config.iconsize==24) sz=1; + if (*main_config.currentThemeIconSize==64) sz=4; + if (*main_config.currentThemeIconSize==48) sz=3; + if (*main_config.currentThemeIconSize==32) sz=2; + if (*main_config.currentThemeIconSize==24) sz=1; gtk_range_set_value(GTK_RANGE(widgets->settingsSizeSlider),sz); char *tmp=malloc(6); - sprintf(tmp,"%dx%d\0",main_config.iconsize,main_config.iconsize); + sprintf(tmp,"%dx%d\0",*main_config.currentThemeIconSize,*main_config.currentThemeIconSize); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),tmp); - gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,main_config.iconsize,main_config.iconsize,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,1,NULL)); gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; @@ -303,22 +320,30 @@ int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets){ if ((int)val==1||(int)val==0){ gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); - main_config.iconsize=24; + if (*main_config.currentThemeIconSize!=24) + main_config.changed=1; + *main_config.currentThemeIconSize=24; } if ((int)val==2){ gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); - main_config.iconsize=32; + if (*main_config.currentThemeIconSize!=32) + main_config.changed=1; + *main_config.currentThemeIconSize=32; } if ((int)val==3){ gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); - main_config.iconsize=48; + if (*main_config.currentThemeIconSize!=48) + main_config.changed=1; + *main_config.currentThemeIconSize=48; } if ((int)val==4){ gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); - main_config.iconsize=64; + if (*main_config.currentThemeIconSize!=64) + main_config.changed=1; + *main_config.currentThemeIconSize=64; } }; @@ -614,7 +639,7 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget actionWidgets *widgets=(actionWidgets*)widgetsD->data; int x,y; - printf("1\n"); + // printf("1\n"); gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); if (main_config.windowWidth<1240){ if (stld==0){ @@ -625,7 +650,7 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget gtk_window_get_position(GTK_WINDOW(window),&main_config.windowPosX,&main_config.windowPosY); gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); - main_config.iconsize=24; + *main_config.currentThemeIconSize=24; for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; @@ -703,11 +728,10 @@ int reload_list(IVGraphicals *section){ int load_apps(IVGraphicals *section, apps *applist, int size){ int catstofind=sizeof(section->categories)/sizeof(char*); - int i=0; + int i=0,sz=0; + dictionary *times=yon_dictionary_create_empty(); for (int i=0;icategories)==1){ - //printf("Проверка прошла.\n"); GError *err=NULL; char *path=malloc(strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); @@ -715,18 +739,20 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ path=yon_char_get_augumented(path,applist[i].Icon); path=yon_char_get_augumented(path,PictureFormatMain); GdkPixbuf *pixbuf; - pixbuf=gdk_pixbuf_new_from_file_at_size(path,main_config.iconsize,main_config.iconsize,NULL); + pixbuf=gdk_pixbuf_new_from_file_at_size(path,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); if (!pixbuf) { - pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,main_config.iconsize,main_config.iconsize,NULL); + pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); GtkTreePath *pth = gtk_tree_model_get_path(GTK_TREE_MODEL(section->LV),&iter); gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5,-1); + yon_time_reg_for_average(times,sz++,clock()); } //printf("Конец\n"); + } - + printf("среднее время на каждую проверку: %f\n",yon_time_average(times)/1000); gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); //gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); @@ -922,14 +948,27 @@ int setup_config(){ main_config.windowWidth=g_key_file_get_integer(configfile,"window","WindowWidth",NULL); main_config.windowHeight=g_key_file_get_integer(configfile,"window","WindowHeight",NULL); main_config.WindowTheme=g_key_file_get_integer(configfile,"window","WindowTheme",NULL); - main_config.iconsize=g_key_file_get_integer(configfile,"window","IconSize",NULL); + main_config.Mainiconsize=g_key_file_get_integer(configfile,"window","MainIconSize",NULL); + main_config.Gnomeiconsize=g_key_file_get_integer(configfile,"window","GnomeIconSize",NULL); main_config.iconSegmentSize=g_key_file_get_integer(configfile,"window","IconSegmentSize",NULL); - main_config.labelSize=g_key_file_get_integer(configfile,"window","LabelSize",NULL); + main_config.MainlabelSize=g_key_file_get_integer(configfile,"window","MainLabelSize",NULL); + main_config.GnomelabelSize=g_key_file_get_integer(configfile,"window","GnomeLabelSize",NULL); main_config.labelDensity=g_key_file_get_integer(configfile,"window","LabelDensity",NULL); main_config.lastUser=g_key_file_get_string(configfile,"window","User",NULL); - if (main_config.labelSize==0) main_config.labelSize=12; + if (main_config.MainlabelSize==0) main_config.MainlabelSize=12; if (main_config.labelDensity==0) main_config.labelDensity=0; - main_config.labelSize=main_config.labelSize*1000; + main_config.MainlabelSize=main_config.MainlabelSize*1000; + if (main_config.GnomelabelSize==0) main_config.GnomelabelSize=12; + main_config.GnomelabelSize=main_config.GnomelabelSize*1000; + + if (main_config.WindowTheme==0){ + main_config.currentThemeLabelSize=&main_config.MainlabelSize; + main_config.currentThemeIconSize=&main_config.Mainiconsize; + } else if (main_config.WindowTheme==1){ + main_config.currentThemeLabelSize=&main_config.GnomelabelSize; + main_config.currentThemeIconSize=&main_config.Gnomeiconsize; + } + yon_icon_size_convert(0); gsize length=0; char **a=g_key_file_get_keys(configfile,"sections",&length,NULL); @@ -1022,9 +1061,9 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ if (stretch>8) stretch = 4; pango_font_description_set_stretch(descr,main_config.labelDensity); - pango_attr_list_insert(attrs,pango_attr_size_new(main_config.labelSize)); + pango_attr_list_insert(attrs,pango_attr_size_new(*main_config.currentThemeLabelSize)); pango_attr_list_insert(attrs, pango_attr_font_desc_new(descr)); - gtk_label_set_attributes(GTK_LABEL(label),attrs); + //gtk_label_set_attributes(GTK_LABEL(label),attrs); gtk_widget_set_margin_end(label,6); gtk_widget_set_margin_start(label,6); gtk_widget_set_margin_bottom(label,2); @@ -1051,8 +1090,8 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ //gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); //gtk_icon_view_set_item_width(GTK_ICON_VIEW(iv),150); gtk_icon_view_set_model(GTK_ICON_VIEW(iv),GTK_TREE_MODEL(lv)); - gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),0); - gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(iv),10); + //gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),0); + //gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(iv),10); gtk_label_set_xalign(GTK_LABEL(label),0); gtk_box_pack_start(GTK_BOX(box),label,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(box),sep,FALSE,FALSE,0); @@ -1230,15 +1269,15 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ void yon_icon_size_convert(int mode){ if (mode==0){ - if (main_config.iconsize==1) main_config.iconsize=24; - if (main_config.iconsize==2) main_config.iconsize=32; - if (main_config.iconsize==3) main_config.iconsize=48; - if (main_config.iconsize==4) main_config.iconsize=64; + if (*main_config.currentThemeIconSize==1) *main_config.currentThemeIconSize=24; + if (*main_config.currentThemeIconSize==2) *main_config.currentThemeIconSize=32; + if (*main_config.currentThemeIconSize==3) *main_config.currentThemeIconSize=48; + if (*main_config.currentThemeIconSize==4) *main_config.currentThemeIconSize=64; } else if (mode==1){ - if (main_config.iconsize==24) main_config.iconsize=1; - if (main_config.iconsize==32) main_config.iconsize=2; - if (main_config.iconsize==48) main_config.iconsize=3; - if (main_config.iconsize==64) main_config.iconsize=4; + if (*main_config.currentThemeIconSize==24) *main_config.currentThemeIconSize=1; + if (*main_config.currentThemeIconSize==32) *main_config.currentThemeIconSize=2; + if (*main_config.currentThemeIconSize==48) *main_config.currentThemeIconSize=3; + if (*main_config.currentThemeIconSize==64) *main_config.currentThemeIconSize=4; } } @@ -1345,6 +1384,19 @@ dictionary *yon_dictionary_create_empty(){ return dict; } +void yon_dictionary_switch_to_last(dictionary **dict){ + if ((*dict)->next!=NULL) + for ((*dict)=(*dict)->first;(*dict)->next!=NULL;(*dict)=(*dict)->next){} +} + +dictionary * yon_dictionary_create_conneced(dictionary *targetdict){ + yon_dictionary_switch_to_last(&targetdict); + targetdict->next=yon_dictionary_create_empty(); + targetdict->next->prev=targetdict; + targetdict->next->first=targetdict->first; + return targetdict->next; +} + void yon_segment_show(actionWidgets *widgets, SectionSettingSegment *sgm){ gtk_box_pack_start(GTK_BOX(widgets->SectionSettingsPack),sgm->MainFrame,FALSE,FALSE,5); g_signal_connect(G_OBJECT(sgm->ButtonEdit),"clicked",G_CALLBACK(on_sections_edit), widgets); @@ -1384,6 +1436,24 @@ void yon_dictionary_make_first(dictionary *dict){ } } +float yon_time_average(dictionary *times){ + int sum=0; + int size=0; + for (dictionary *i=times->first;i!=NULL;i=i->next){ + sum+=(time_t)i->data; + size++; + } + return (float)sum/size; +} + +void yon_time_reg_for_average(dictionary *listofregs, int size, time_t tm){ + yon_dictionary_switch_to_last(&listofregs); + time_t prev=(time_t)listofregs->data; + listofregs=yon_dictionary_create_conneced(listofregs); + listofregs->data=(void*)(tm-prev); + +} + void yon_small_window_theme_change(actionWidgets *widgets){ } @@ -1419,7 +1489,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")); + // 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); if (curWidgets->ButtonBackToMain!=NULL) gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings")); @@ -1539,8 +1609,9 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } + printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); + //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); yon_icv_resize_item(widg->ICSys,widg->GnomePaned); theme="Main"; main_config.WindowTheme=0; @@ -1555,12 +1626,14 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } + printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); + //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); main_config.WindowTheme=1; } - else {theme="Main"; + else { + theme="Main"; yon_theme_new(&widgets->first, builder,theme,applist,*size); widg->applist=applist; widg->appssize=*size; @@ -1568,8 +1641,9 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } + printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); + //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); theme="Gnome"; main_config.WindowTheme=1; widgets->next=yon_dictionary_create_empty(); @@ -1583,8 +1657,9 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } + printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); + //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } @@ -1595,7 +1670,7 @@ int main(int argc, char *argv[]){ gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widg->settingsThemeChooser),NULL,_("GNOME theme")); widg=(actionWidgets*)widgets->data; gtk_window_maximize(GTK_WINDOW(widg->window)); - gtk_widget_show_all(widg->window); + gtk_widget_show(widg->window); hide_if_unfound(widgets); if (main_config.WindowTheme==1) gtk_widget_hide(widg->MenuItemAboutSystem); @@ -1608,7 +1683,7 @@ int main(int argc, char *argv[]){ banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"GnomeInfoLogo")); gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(LogoPath,512,512,1,NULL)); banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"settingsIcon")); - gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(AppIconPath,main_config.iconsize,main_config.iconsize,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(AppIconPath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,1,NULL)); GtkCssProvider *css=gtk_css_provider_new(); gtk_css_provider_load_from_path(css,CssPath,NULL); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 84b32cb..d5e4ff3 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -2,6 +2,7 @@ #define UBL_SETTINGS_MANAGER #include +#include #define GladePath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager.glade" @@ -62,12 +63,17 @@ typedef struct { int windowPosY; int WindowTheme; char *curThemeName; - int iconsize; + int Mainiconsize; + int Gnomeiconsize; int iconSegmentSize; dictionary *sections; - int labelSize; + int MainlabelSize; + int GnomelabelSize; + int *currentThemeLabelSize; + int *currentThemeIconSize; int labelDensity; char *lastUser; + int changed; } config; typedef struct { @@ -207,4 +213,9 @@ void yon_icon_size_convert(int mode); void on_about_system(GtkWidget *button, actionWidgets *widgets); char *yon_char_new(char *chr); void launch(char *command); +float yon_time_average(dictionary *times); +void yon_time_reg_for_average(dictionary *listofregs, int size, time_t tm); +void yon_dictionary_switch_to_last(dictionary **dict); +dictionary *yon_dictionary_create_conneced(dictionary *targetdict); + #endif \ No newline at end of file diff --git a/ubconfig-main.conf b/ubconfig-main.conf index 34e755e..e8ceb76 100644 --- a/ubconfig-main.conf +++ b/ubconfig-main.conf @@ -4,9 +4,11 @@ WindowPosY=0 WindowWidth=800 WindowHeight=600 WindowTheme=0 -IconSize=3 +MainIconSize=3 +GnomeIconSize=3 IconSegmentSize=250 -LabelSize=12 +MainLabelSize=12 +GnomeLabelSize=12 LabelDensity=0 User= diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 5e8a228..2287410 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -83,32 +83,21 @@ + 5 + 5 True True immediate in 150 + False True True False - - 5 - 5 - True - False - 3 - 3 - 3 - 3 - 3 - vertical - - - - + @@ -155,7 +144,7 @@ start 10 5 - Would yo like to read documentation in the Web? + Would you like to read documentation in the Web? @@ -293,84 +282,6 @@ - - True - False - vertical - - - True - False - 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 False @@ -567,59 +478,6 @@ 1 - - - True - False - 5 - 5 - 0 - in - - - True - False - - - True - False - True - True - - - Sections management - True - False - True - True - 10 - 10 - 5 - - - True - True - 1 - - - - - - - - - True - False - Тонкая настройка - - - - - False - True - 2 - - True @@ -682,6 +540,15 @@ True False UBLinux Settings + + + True + False + 32 + ubconfig-gui + 5 + + @@ -993,6 +860,15 @@ True False UBLinux Settings + + + True + False + 32 + ubconfig-gui + 5 + + @@ -1028,7 +904,7 @@ 6 horizontal liststoreTemplate - 3 + 10 @@ -1045,6 +921,9 @@ 1 + True @@ -1373,41 +1252,88 @@ - + True False + vertical - + True - True - 6 - horizontal - 50 - - - - 2 - 3 - 1 - 0 - - + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical - - - 2 - 3 - 1 - + + 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 - + + - -1 + False + True + 1 + True @@ -1674,19 +1600,34 @@ True True - + True - False + True + in - + True - True - 6 + False + + + True + False + 3 + 3 + vertical + + + + + + - - -1 - + False @@ -1873,6 +1814,8 @@ True False + center + center @@ -1928,6 +1871,8 @@ True False + center + center vertical From f44a61d10196ee77ffe2d810b447e87d2d9a9866 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Mar 2023 16:22:11 +0600 Subject: [PATCH 04/36] 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 + From 33e6da28fa7c2b0aecd5875bfd39302fb7e6e9fa Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Mar 2023 16:23:58 +0600 Subject: [PATCH 05/36] Options menu redesigned --- source/ubl-settings-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 9367c6c..43be70f 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -287,7 +287,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi 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); From 084da259af23a6a60f6563de4cb19dee34e4252f Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Mar 2023 17:17:50 +0600 Subject: [PATCH 06/36] Options menu redesigned --- #ubl-settings-manager.glade# | 1974 +++++++++++++++++++++++++++++++++ source/ubl-settings-manager.c | 52 +- ubl-settings-manager.glade | 16 +- 3 files changed, 1984 insertions(+), 58 deletions(-) create mode 100644 #ubl-settings-manager.glade# diff --git a/#ubl-settings-manager.glade# b/#ubl-settings-manager.glade# new file mode 100644 index 0000000..e787860 --- /dev/null +++ b/#ubl-settings-manager.glade# @@ -0,0 +1,1974 @@ + + + + + + False + + + True + False + vertical + + + True + False + + + True + False + center + center + 30 + 30 + gtk-dialog-warning + 6 + + + False + True + 0 + + + + + True + False + center + center + 5 + 25 + You are not allowed to change theme on such low resolution! + True + 0.019999999552965164 + + + True + True + 1 + + + + + True + True + 0 + + + + + Understood + True + True + True + 5 + 5 + 5 + 5 + + + False + True + 2 + + + + + + + True + False + UBLinux Settings Manager + + + True + False + gtk-dialog-warning + 5 + + + + + + + True + False + False + 4 + + + True + False + Settings + True + + + + + + True + False + Documentation + True + + + + + + True + False + About system + True + + + + + + + False + 800 + 600 + ubconfig-gui + + + True + False + vertical + + + True + False + + + True + False + True + vertical + + + True + False + center + 3 + + + + False + True + 0 + + + + + + False + True + 0 + + + + + True + True + 52 + True + True + + + True + True + in + + + True + False + + + True + False + 3 + 3 + vertical + + + + + + + + + + + + False + True + + + + + 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 + + + + + True + True + + + + + True + True + end + 1 + + + + + True + True + 0 + + + + + + + True + False + True + + + True + False + True + + + True + False + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + center + center + + + + + + False + True + 1 + + + + + True + False + + + True + True + False + True + GnomeMenu + none + + + + + + + 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 + + + + + + True + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 30 + True + + + Cancel + True + True + True + + + + + True + True + 0 + + + + + Read Online + True + True + True + + + + + True + True + 1 + + + + + False + True + 1 + + + + + + + True + False + UBLinux Settings + + + True + False + 32 + gtk-dialog-question + 5 + + + + + + + True + False + False + False + 4 + + + True + False + Settings + True + + + + + + True + False + Documentation + True + + + + + + True + False + About system + True + + + + + + + True + False + menu + + + True + False + + + + + True + False + + + + + True + False + True + + + + + 1 + 5 + 2 + 1 + 1 + + + False + 440 + 250 + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 2 + 0.019999999552965164 + in + + + True + False + 12 + + + True + False + + + True + False + vertical + + + True + False + 5 + 32x32 + + + False + True + 0 + + + + + True + True + 10 + 10 + 10 + 10 + adjustment1 + 5 + 0 + 0 + False + + + True + True + 1 + + + + + True + True + 0 + + + + + 64 + 64 + True + False + ubconfig-gui + + + False + True + 1 + + + + + + + + + True + False + 5 + 5 + Icons size + + + + + True + True + 0 + + + + + True + False + 5 + 5 + 2 + 5 + 0.019999999552965164 + in + + + True + False + + + True + False + vertical + + + combo + True + False + center + 10 + 10 + 5 + True + 0 + + + True + True + 0 + + + + + + + + + True + False + 5 + 5 + Choose theme + + + + + True + True + 1 + + + + + True + False + + + True + False + 5 + 5 + 3 + 30 + True + + + Close + 200 + True + True + True + 2 + + + False + True + 0 + + + + + Save and apply + 200 + True + True + True + 2 + + + False + True + 1 + + + + + True + True + 0 + + + + + False + True + 4 + + + + + + + True + False + UBLinux Settings + + + True + False + 32 + ubconfig-gui + 5 + + + + + + + 1 + 1 + 10 + + + True + False + gtk-go-back + + + False + 800 + 600 + ubconfig-gui + + + 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 + + + + + + + True + False + True + + + True + False + True + + + True + False + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + center + center + + + + + + + False + True + 1 + + + + + True + False + vertical + + + True + True + False + True + MainMenu + none + False + + + + + + False + True + 0 + + + + + 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 + + + + + + + True + False + gtk-undelete + + + True + False + ubconfig-gui + 6 + + + True + False + + + True + False + 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 + + + True + False + vertical + + + True + True + 5 + 5 + 5 + 5 + in + + + True + False + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 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 + + + + + + + + + + + + False + True + 1 + + + + + + + + + True + True + 0 + + + + + True + False + + + Close + True + True + True + 5 + 5 + + + False + True + end + 0 + + + + + Save and apply + True + True + True + 17 + 5 + + + False + True + end + 1 + + + + + False + True + 1 + + + + + + + True + False + UBLinux Settings + + + True + False + 32 + ubconfig-gui + 5 + + + + + + + + + + + + + Стандартная тема + + + GNOME тема + + + + + + + + + + + + + + + + + True + True + 6 + horizontal + liststoreTemplate + 10 + + + + 2 + 3 + 0 + + + + + + 2 + 3 + 1 + + + + + + True + False + + + + + + + + + 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 + + + + + + + + + + + + + + + False + 800 + 600 + ubconfig-gui + + + True + False + vertical + + + True + False + + + True + False + vertical + + + True + False + center + 3 + + + + False + True + 0 + + + + + + False + True + 0 + + + + + True + False + vertical + + + Icon + True + False + 2 + 2 + 2 + 2 + 2 + 2 + + + True + True + in + + + True + False + natural + + + + + + + + + True + True + 0 + + + + + + True + True + 0 + + + + + True + False + vertical + + + + + + + False + True + 1 + + + + + True + True + 1 + + + + + + True + True + 0 + + + + + + + True + False + + + True + False + True + + + True + False + UBLinux Settings Manager + + + True + True + 0 + + + + + True + True + False + True + menu1 + none + settingsPopover + + + + + + False + True + 1 + + + + + + + True + False + 32 + ubconfig-gui + 5 + + + + + + + + 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 + + + + + + + diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 43be70f..f08f4ef 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -40,7 +40,6 @@ int cmld=0; void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_show(builder->socketbutton); gtk_widget_show(builder->ThirdSocket); - // printf("Plug has been added!\n"); gtk_widget_set_vexpand(builder->HideWhileLaunch,0); gtk_widget_hide(builder->HideWhileLaunch); gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); @@ -61,7 +60,6 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ gtk_widget_show(widgets->HideWhileLaunch); gtk_widget_set_vexpand(widgets->socketplace,0); gtk_widget_set_vexpand(widgets->HideWhileLaunch,1); - // printf("Plug has been removed!\n\n\n"); if(widgets->socketbutton) gtk_widget_destroy(widgets->socketbutton); if(widgets->ThirdSocket) @@ -71,19 +69,14 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ } void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ - // printf("\n\n\nActivated\n\n\n"); GtkTreeIter iter; char *name; gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); apps *tempapp=get_app_by_name(applist->applist,name,applist->appssize); - // printf("%s\n",tempapp->Name); if (!tempapp){}else{ char arg[100]; - // printf("%s\n",tempapp->Exec); - // printf("%d\n",tempapp->Type); - // printf("%d\n",tempapp->Pluggable); memset(arg,0,100); printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); @@ -277,17 +270,15 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ main_config.changed=0; g_key_file_save_to_file(gfile,pth,NULL); gtk_widget_hide(widgets->SettingsWindow); - //gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; -void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ /* TODO */ +void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *widgets){ 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;} double pos=((double)position-(11/(double)position*4)*500)/1.3; if (pos<110) pos=110; - // 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); @@ -497,7 +488,6 @@ void on_sections_move_down(GtkWidget *button, actionWidgets *widgets){ dct->prev->next=dct->next; dct->prev=dct->next; dct->next=NULL; - //dct->next->prev=dct; dct->prev->next=dct; } else if (dct->prev==NULL){ yon_dictionary_make_first(dct->next); @@ -556,13 +546,11 @@ void on_sections_add(GtkWidget *button, actionWidgets *widgets){ } void on_sections_new_clear(GtkWidget *button, actionWidgets *widgets){ - //printf("w54y3563sthts\n"); gtk_entry_set_text(GTK_ENTRY(widgets->SectionSettingAddNameEntry),""); gtk_entry_set_text(GTK_ENTRY(widgets->SectionSettingAddCategoriesEntry),""); } void on_sections_close(GtkWidget *button, actionWidgets *widgets){ - //printf("snnnnnnthtsgyuilgg\n"); gtk_widget_hide(widgets->SectionSettingsWindow); } @@ -640,7 +628,6 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget actionWidgets *widgets=(actionWidgets*)widgetsD->data; int x,y; - // printf("1\n"); gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); if (main_config.windowWidth<1240){ if (stld==0){ @@ -683,7 +670,6 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ void on_about_system(GtkWidget *button, actionWidgets *widgets){ char arg[100]; memset(arg,0,100); - // printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); launch_app_with_arguments("ubl-settings-info",arg); } @@ -696,7 +682,6 @@ void launch_app_with_arguments(char *name, char *args){ char *path=yon_char_get_augumented("/bin/",name); path=yon_char_get_augumented(path," "); path=yon_char_get_augumented(path,args); - // printf("%s\n",path); pthread_t thread_id; pthread_create(&thread_id, NULL, (void*)launch, path); }; @@ -723,8 +708,6 @@ apps *get_app_by_name(apps *applist,char *name, int size){ int reload_list(IVGraphicals *section){ gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); - //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); - //gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); } int load_apps(IVGraphicals *section, apps *applist, int size){ @@ -750,13 +733,10 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5,-1); yon_time_reg_for_average(times,sz++,clock()); } - //printf("Конец\n"); } printf("среднее время на каждую проверку: %f\n",yon_time_average(times)/1000); gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); - //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(section->IV),0); - //gtk_icon_view_set_text_column(GTK_ICON_VIEW(section->IV),1); }; int load_apps_with_clear(IVGraphicals *section, apps *applist, int size){ @@ -786,15 +766,6 @@ GtkWidget *create_socket(actionWidgets *builder){ g_signal_connect(G_OBJECT(socket),"plug-added",G_CALLBACK(on_plug_added),builder); g_signal_connect(G_OBJECT(socket),"plug-removed",G_CALLBACK(on_plug_removed),builder); g_signal_connect(G_OBJECT(socket),"destroy",G_CALLBACK(on_plug_removed),builder); - - // g_signal_connect(G_OBJECT(socketbutton),"plug-added",G_CALLBACK(on_plug_added),builder); - // g_signal_connect(G_OBJECT(socketbutton),"plug-removed",G_CALLBACK(on_plug_removed),builder); - // g_signal_connect(G_OBJECT(socketbutton),"destroy",G_CALLBACK(on_plug_removed),builder); - - // g_signal_connect(G_OBJECT(ThirdSocket),"plug-added",G_CALLBACK(on_plug_added),builder); - // g_signal_connect(G_OBJECT(ThirdSocket),"plug-removed",G_CALLBACK(on_plug_removed),builder); - // g_signal_connect(G_OBJECT(ThirdSocket),"destroy",G_CALLBACK(on_plug_removed),builder); - gtk_box_pack_start(GTK_BOX(builder->socketplace),socket,true,true,0); gtk_box_pack_start(GTK_BOX(builder->socketbuttonplace),socketbutton,1,1,0); builder->socketbutton=socketbutton; @@ -1064,11 +1035,10 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ pango_font_description_set_stretch(descr,main_config.labelDensity); pango_attr_list_insert(attrs,pango_attr_size_new(*main_config.currentThemeLabelSize)); pango_attr_list_insert(attrs, pango_attr_font_desc_new(descr)); - //gtk_label_set_attributes(GTK_LABEL(label),attrs); + gtk_label_set_attributes(GTK_LABEL(label),attrs); gtk_widget_set_margin_end(label,6); gtk_widget_set_margin_start(label,6); gtk_widget_set_margin_bottom(label,2); - //gtk_widget_set_name(label,"SepIcon"); if (main_config.WindowTheme==1) { gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); gtk_widget_set_name(iv,"GnomeIcon"); @@ -1080,19 +1050,12 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ } GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); - //gtk_widget_set_name(sep,"SepIcon"); GtkListStore *lv=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststoreTemplate")); gtk_widget_set_halign(box,0); gtk_widget_set_valign(box,1); gtk_widget_set_margin_end(sep,6); gtk_widget_set_margin_start(sep,6); - - //gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(iv),0); - //gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); - //gtk_icon_view_set_item_width(GTK_ICON_VIEW(iv),150); gtk_icon_view_set_model(GTK_ICON_VIEW(iv),GTK_TREE_MODEL(lv)); - //gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),0); - //gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(iv),10); gtk_label_set_xalign(GTK_LABEL(label),0); gtk_box_pack_start(GTK_BOX(box),label,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(box),sep,FALSE,FALSE,0); @@ -1116,7 +1079,6 @@ dictionary *yon_create_icon_section_list(dictionary *sections){ while (sections!=NULL){ IconSection *name=(IconSection*)sections->data; IVSections=yon_create_single_section_IV(name->section,name->categories); - // loadapps(IVSections,// applist,size //); if (!IVDict) { IVDict=yon_dictionary_create_empty(); IVDict->key=name->section; @@ -1490,7 +1452,6 @@ 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), "activate", G_CALLBACK(on_about_system),curWidgets); if (curWidgets->ButtonBackToMain!=NULL) gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to settings")); @@ -1524,7 +1485,6 @@ 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->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")); @@ -1559,7 +1519,6 @@ 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->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); @@ -1580,7 +1539,6 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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")); return widgets; } @@ -1591,7 +1549,6 @@ int main(int argc, char *argv[]){ return -1; } local=setlocale(LC_ALL, ""); - // printf("%s\n\n\n",bindtextdomain (LocaleName, LocalePath)); textdomain (LocaleName); actionWidgets *widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); @@ -1612,7 +1569,6 @@ int main(int argc, char *argv[]){ } printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); yon_icv_resize_item(widg->ICSys,widg->GnomePaned); theme="Main"; main_config.WindowTheme=0; @@ -1629,7 +1585,6 @@ int main(int argc, char *argv[]){ } printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); main_config.WindowTheme=1; } @@ -1644,7 +1599,6 @@ int main(int argc, char *argv[]){ } printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),widg->workingwindow); theme="Gnome"; main_config.WindowTheme=1; widgets->next=yon_dictionary_create_empty(); @@ -1660,12 +1614,10 @@ int main(int argc, char *argv[]){ } printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); - //gtk_overlay_add_overlay(GTK_OVERLAY(widg->Overlay),GTK_WIDGET(gtk_builder_get_object(builder,"GnomeScroll"))); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); } if (geteuid()==0){ - // 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")); diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 9102a00..d1d2f71 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -692,11 +692,6 @@ - - True - False - emblem-danger - True False @@ -745,7 +740,7 @@ 5 5 2 - 0 + 0.019999999552965164 in @@ -823,6 +818,8 @@ True False + 5 + 5 Icons size @@ -841,7 +838,7 @@ 5 2 5 - 0 + 0.019999999552965164 in @@ -878,6 +875,8 @@ True False + 5 + 5 Choose theme @@ -898,6 +897,7 @@ False 5 5 + 3 Close @@ -1367,7 +1367,7 @@ 5 5 5 - 0 + 0.019999999552965164 in From a8ffad077f224612b9215f172e6b573d761f0614 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 3 Mar 2023 11:37:26 +0600 Subject: [PATCH 07/36] Menus visual changes --- #ubl-settings-manager.glade# | 1974 ---------------------------------- ubl-settings-manager.css | 7 +- ubl-settings-manager.glade | 22 +- 3 files changed, 19 insertions(+), 1984 deletions(-) delete mode 100644 #ubl-settings-manager.glade# diff --git a/#ubl-settings-manager.glade# b/#ubl-settings-manager.glade# deleted file mode 100644 index e787860..0000000 --- a/#ubl-settings-manager.glade# +++ /dev/null @@ -1,1974 +0,0 @@ - - - - - - False - - - True - False - vertical - - - True - False - - - True - False - center - center - 30 - 30 - gtk-dialog-warning - 6 - - - False - True - 0 - - - - - True - False - center - center - 5 - 25 - You are not allowed to change theme on such low resolution! - True - 0.019999999552965164 - - - True - True - 1 - - - - - True - True - 0 - - - - - Understood - True - True - True - 5 - 5 - 5 - 5 - - - False - True - 2 - - - - - - - True - False - UBLinux Settings Manager - - - True - False - gtk-dialog-warning - 5 - - - - - - - True - False - False - 4 - - - True - False - Settings - True - - - - - - True - False - Documentation - True - - - - - - True - False - About system - True - - - - - - - False - 800 - 600 - ubconfig-gui - - - True - False - vertical - - - True - False - - - True - False - True - vertical - - - True - False - center - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - True - 52 - True - True - - - True - True - in - - - True - False - - - True - False - 3 - 3 - vertical - - - - - - - - - - - - False - True - - - - - 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 - - - - - True - True - - - - - True - True - end - 1 - - - - - True - True - 0 - - - - - - - True - False - True - - - True - False - True - - - True - False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - center - center - - - - - - False - True - 1 - - - - - True - False - - - True - True - False - True - GnomeMenu - none - - - - - - - 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 - - - - - - True - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 30 - True - - - Cancel - True - True - True - - - - - True - True - 0 - - - - - Read Online - True - True - True - - - - - True - True - 1 - - - - - False - True - 1 - - - - - - - True - False - UBLinux Settings - - - True - False - 32 - gtk-dialog-question - 5 - - - - - - - True - False - False - False - 4 - - - True - False - Settings - True - - - - - - True - False - Documentation - True - - - - - - True - False - About system - True - - - - - - - True - False - menu - - - True - False - - - - - True - False - - - - - True - False - True - - - - - 1 - 5 - 2 - 1 - 1 - - - False - 440 - 250 - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 2 - 0.019999999552965164 - in - - - True - False - 12 - - - True - False - - - True - False - vertical - - - True - False - 5 - 32x32 - - - False - True - 0 - - - - - True - True - 10 - 10 - 10 - 10 - adjustment1 - 5 - 0 - 0 - False - - - True - True - 1 - - - - - True - True - 0 - - - - - 64 - 64 - True - False - ubconfig-gui - - - False - True - 1 - - - - - - - - - True - False - 5 - 5 - Icons size - - - - - True - True - 0 - - - - - True - False - 5 - 5 - 2 - 5 - 0.019999999552965164 - in - - - True - False - - - True - False - vertical - - - combo - True - False - center - 10 - 10 - 5 - True - 0 - - - True - True - 0 - - - - - - - - - True - False - 5 - 5 - Choose theme - - - - - True - True - 1 - - - - - True - False - - - True - False - 5 - 5 - 3 - 30 - True - - - Close - 200 - True - True - True - 2 - - - False - True - 0 - - - - - Save and apply - 200 - True - True - True - 2 - - - False - True - 1 - - - - - True - True - 0 - - - - - False - True - 4 - - - - - - - True - False - UBLinux Settings - - - True - False - 32 - ubconfig-gui - 5 - - - - - - - 1 - 1 - 10 - - - True - False - gtk-go-back - - - False - 800 - 600 - ubconfig-gui - - - 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 - - - - - - - True - False - True - - - True - False - True - - - True - False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - center - center - - - - - - - False - True - 1 - - - - - True - False - vertical - - - True - True - False - True - MainMenu - none - False - - - - - - False - True - 0 - - - - - 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 - - - - - - - True - False - gtk-undelete - - - True - False - ubconfig-gui - 6 - - - True - False - - - True - False - 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 - - - True - False - vertical - - - True - True - 5 - 5 - 5 - 5 - in - - - True - False - - - True - False - vertical - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - vertical - - - - - - False - True - 0 - - - - - True - False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 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 - - - - - - - - - - - - False - True - 1 - - - - - - - - - True - True - 0 - - - - - True - False - - - Close - True - True - True - 5 - 5 - - - False - True - end - 0 - - - - - Save and apply - True - True - True - 17 - 5 - - - False - True - end - 1 - - - - - False - True - 1 - - - - - - - True - False - UBLinux Settings - - - True - False - 32 - ubconfig-gui - 5 - - - - - - - - - - - - - Стандартная тема - - - GNOME тема - - - - - - - - - - - - - - - - - True - True - 6 - horizontal - liststoreTemplate - 10 - - - - 2 - 3 - 0 - - - - - - 2 - 3 - 1 - - - - - - True - False - - - - - - - - - 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 - - - - - - - - - - - - - - - False - 800 - 600 - ubconfig-gui - - - True - False - vertical - - - True - False - - - True - False - vertical - - - True - False - center - 3 - - - - False - True - 0 - - - - - - False - True - 0 - - - - - True - False - vertical - - - Icon - True - False - 2 - 2 - 2 - 2 - 2 - 2 - - - True - True - in - - - True - False - natural - - - - - - - - - True - True - 0 - - - - - - True - True - 0 - - - - - True - False - vertical - - - - - - - False - True - 1 - - - - - True - True - 1 - - - - - - True - True - 0 - - - - - - - True - False - - - True - False - True - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - False - True - menu1 - none - settingsPopover - - - - - - False - True - 1 - - - - - - - True - False - 32 - ubconfig-gui - 5 - - - - - - - - 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 - - - - - - - diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 100a2e1..d1a2339 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -35,7 +35,6 @@ background-color: #404040; 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; @@ -53,7 +52,6 @@ background-color: #404040; 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; @@ -84,25 +82,22 @@ background-color: #404040; 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; + border:none; } .workingbg { background-color:@theme_base_color; diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index d1d2f71..548449c 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -2,6 +2,7 @@ + False @@ -17,6 +18,8 @@ True False + center + center 30 30 gtk-dialog-warning @@ -32,8 +35,10 @@ True False + center + center 5 - 5 + 25 You are not allowed to change theme on such low resolution! True 0.019999999552965164 @@ -57,6 +62,10 @@ True True True + 5 + 5 + 5 + 5 False @@ -121,7 +130,6 @@ @@ -588,6 +596,12 @@ True False + 5 + 5 + 5 + 5 + 30 + True Cancel @@ -688,7 +702,6 @@ @@ -898,6 +911,8 @@ 5 5 3 + 30 + True Close @@ -925,7 +940,6 @@ False True - end 1 From 50d4afaf1a30a3bfa60f6002f90b1aca03599953 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 11:08:02 +0600 Subject: [PATCH 08/36] Makefile fixes --- Makefile | 25 +- source/ubl-settings-manager.c | 21 +- source/ubl-settings-manager.h | 5 +- ubconfig-gui.svg | 4957 ------------------------------- ubl-settings-manager.css | 3 + ubl-settings-manager.desktop | 2 +- ubl-settings-manager.svg | 5152 +++++++++++++++++++++++++++++++-- ublinux-logo.svg | 241 ++ 8 files changed, 5216 insertions(+), 5190 deletions(-) delete mode 100644 ubconfig-gui.svg create mode 100644 ublinux-logo.svg diff --git a/Makefile b/Makefile index d73c976..ddf681c 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,15 @@ uninstall: @$(RM) "/usr/share/applications/${PKGNAME}.desktop" @$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.png" @$(RM) "/usr/share/icons/hicolor/scalable/apps/${PKGNAME}.svg" - @$(RM) "/usr/share/icons/hicolor/scalable/apps/ubconfig-gui.svg" + @$(RM) "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg" + @$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg" + @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade" + @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" + @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.png" + @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" + @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" + @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" @$(RM) "/etc/ubconfig-main.conf" - @$(RM) "~/ubconfig-main.conf" @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications @@ -101,16 +107,21 @@ install: check uninstall install -dm755 /usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps; \ rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data ${PKGNAME}.svg -o "/usr/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/${PKGNAME}.svg"; \ done - @install -dm755 /usr/share/icons/hicolor/scalable/apps @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.svg - @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ubconfig-gui.svg @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} - @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop + @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop; \ + if [ ! -d "/usr/share/${PKGNAME}/ui" ]; then \ + mkdir /usr/share/${PKGNAME}/ui; \ + fi; \ + if [ ! -d "/usr/share/${PKGNAME}/css" ]; then \ + mkdir /usr/share/${PKGNAME}/css; \ + fi @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.glade @install -Dm644 -t /usr/share/${PKGNAME}/css/ ${PKGNAME}.css - @install -Dm644 -t /etc/ ubconfig-main.conf + @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ublinux-logo.svg + @install -Dm644 -t /etc/ ubconfig-main.conf; \ chmod 766 /etc/ubconfig-main.conf - @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.png + @install -Dm644 -t /usr/share/${PKGNAME}/ui/ ${PKGNAME}.png @gtk-update-icon-cache -fiq /usr/share/icons/hicolor/ &>/dev/null @update-desktop-database --quiet 2>/dev/null @touch /usr/share/applications diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index f08f4ef..735c9a4 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -45,8 +45,10 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); gtk_widget_set_vexpand(GTK_WIDGET(self),1); gtk_widget_show(builder->socketplace); - if (main_config.WindowTheme==0) - gtk_widget_hide(builder->appSettings); + // if (main_config.WindowTheme==0) + + // else + // gtk_widget_show(builder->appSettings); if (builder->ButtonBackToMain!=NULL) gtk_widget_set_sensitive(builder->ButtonBackToMain,1); gtk_widget_show(GTK_WIDGET(self)); gtk_widget_show(builder->socketbuttonplace); @@ -56,6 +58,7 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ } void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ + gtk_widget_show(widgets->socketbuttonplace); gtk_widget_show(widgets->appSettings); gtk_widget_show(widgets->HideWhileLaunch); gtk_widget_set_vexpand(widgets->socketplace,0); @@ -71,6 +74,7 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ GtkTreeIter iter; char *name; + gtk_widget_hide(applist->appSettings); gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,1,&name,-1); @@ -84,6 +88,7 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl if (tempapp[0].Type==1){ if (tempapp->Pluggable==1) if (tempapp->DualPluggable==1){ + gtk_widget_hide(applist->appSettings); char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30); sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket))); launch_app_with_arguments(tempapp[0].Exec,dualarg); @@ -125,7 +130,7 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets } } else { - on_about_system(NULL,applist); + on_about_system(NULL,applist); launch_app(tempapp[0].Exec); gtk_widget_destroy(applist->socketbutton); } @@ -670,7 +675,13 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ void on_about_system(GtkWidget *button, actionWidgets *widgets){ char arg[100]; memset(arg,0,100); - sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); + gtk_widget_show(widgets->socketbuttonplace); + if (button){ + gtk_widget_hide(widgets->appSettings); + sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); + }else{ + sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket))); + } launch_app_with_arguments("ubl-settings-info",arg); } @@ -1634,7 +1645,7 @@ int main(int argc, char *argv[]){ banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"loaderBanner")); gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file(AppBannerPath,NULL)); banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"GnomeInfoLogo")); - gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(LogoPath,512,512,1,NULL)); + gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(ublinux_logo,512,512,1,NULL)); banner = GTK_WIDGET(gtk_builder_get_object(widg->builder,"settingsIcon")); gtk_image_set_from_pixbuf(GTK_IMAGE(banner),gdk_pixbuf_new_from_file_at_scale(AppIconPath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,1,NULL)); GtkCssProvider *css=gtk_css_provider_new(); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index b9ded15..bb1c409 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -9,11 +9,12 @@ #define CssPath "/usr/share/ubl-settings-manager/css/ubl-settings-manager.css" #define GlobalConfigPath "/etc/ubconfig-main.conf" #define UserConfigPath "/.config/ubl-settings-manager/ubconfig-main.conf" -#define AppIconPath "/usr/share/icons/hicolor/scalable/apps/ubconfig-gui.svg" -#define AppBannerPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.png" +#define AppIconPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg" +#define AppBannerPath "//usr/share/ubl-settings-manager/ui/ubl-settings-manager.png" #define DesktopPath "/usr/share/applications/" #define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/" #define ErrIconPicturePath "/usr/share/icons/Faenza/emblems/32/emblem-important.png" +#define ublinux_logo "/usr/share/ubl-settings-manager/ui/ublinux-logo.svg" #define PictureFormatMain ".svg" #define PictureFormatExtra ".png" #define LocalePath "/usr/share/locale" diff --git a/ubconfig-gui.svg b/ubconfig-gui.svg deleted file mode 100644 index f636c26..0000000 --- a/ubconfig-gui.svg +++ /dev/null @@ -1,4957 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index d1a2339..82d7eba 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -83,18 +83,21 @@ background-color: #404040; padding: 5px 10px 3px 5px; background:@theme_selected_bg_color; border-color:transparent; + border-radius: 2px; } .menuitemmiddle:hover* { margin:0 2px 0 2px; padding: 3px 10px 3px 5px; background:@theme_selected_bg_color; border-color:transparent; + border-radius: 2px; } .menuitembottom:hover* { margin:0 2px 2px 2px; padding: 3px 10px 5px 5px; background:@theme_selected_bg_color; border-color:transparent; + border-radius: 2px; } .menu { border:none; diff --git a/ubl-settings-manager.desktop b/ubl-settings-manager.desktop index e2e7a3f..6c60fcf 100644 --- a/ubl-settings-manager.desktop +++ b/ubl-settings-manager.desktop @@ -8,7 +8,7 @@ Comment=ubl-settings-manager Comment[ru]=Приложение для управления настройками UBLinux Type=Application Exec=ubl-settings-manager -Icon=ubconfig-gui +Icon=ubl-settings-manager Terminal=false X-XfcePluggable=false Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; diff --git a/ubl-settings-manager.svg b/ubl-settings-manager.svg index d44113c..f636c26 100644 --- a/ubl-settings-manager.svg +++ b/ubl-settings-manager.svg @@ -1,241 +1,4957 @@ + id="defs12"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + id="filter2594" + x="-0.076308397" + y="-0.23317344" + width="1.1526168" + height="1.4663469" + color-interpolation-filters="sRGB"> - - - - - + stdDeviation="0.43959997" + id="feGaussianBlur449" /> + + + + + + - - + stdDeviation="0.43959997" + id="feGaussianBlur2065" /> - - - diff --git a/ublinux-logo.svg b/ublinux-logo.svg new file mode 100644 index 0000000..d44113c --- /dev/null +++ b/ublinux-logo.svg @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a8fe46134f65e8c2c7576c18aad8b6c13d4996e7 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 11:25:14 +0600 Subject: [PATCH 09/36] Removed deprecated directories from building --- source/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 09788d7..6279e9e 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -22,6 +22,4 @@ set(LIBRARIES add_executable(ubl-settings-manager ${SOURCE_FILES}) target_link_libraries(ubl-settings-manager ${LIBRARIES}) -file(COPY ui DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -file(COPY css DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(TARGETS ubl-settings-manager DESTINATION bin) \ No newline at end of file From 8394e833cb6775f1b35ce4e5cb755fce01e85504 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 12:04:06 +0600 Subject: [PATCH 10/36] Makefile check for unexisted directories --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index ddf681c..7bced06 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ CMAKE_COMMAND = cmake CMAKE_SOURCE_DIR = ./source CMAKE_BUILD_DIR = ./compile PKGNAME = $(MAKEFILE_DIR) +version_application = #PKGNAME = check-hostalive default_target: all @@ -110,6 +111,9 @@ install: check uninstall @install -Dm644 -t /usr/share/icons/hicolor/scalable/apps/ ${PKGNAME}.svg @install -Dm755 -t /usr/bin/ ${CMAKE_BUILD_DIR}/${PKGNAME} @install -Dm644 -t /usr/share/applications/ ${PKGNAME}.desktop; \ + if [ ! -d "/usr/share/${PKGNAME}" ]; then \ + mkdir /usr/share/${PKGNAME}; \ + fi; \ if [ ! -d "/usr/share/${PKGNAME}/ui" ]; then \ mkdir /usr/share/${PKGNAME}/ui; \ fi; \ From f53d850ebe10f4187418b27101e40d4dc8e60177 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 14:47:38 +0600 Subject: [PATCH 11/36] Localisation updates --- ubl-settings-manager_ru.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ubl-settings-manager_ru.po b/ubl-settings-manager_ru.po index 19df6c7..6573cf3 100644 --- a/ubl-settings-manager_ru.po +++ b/ubl-settings-manager_ru.po @@ -18,8 +18,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ubl-settings-manager.c:1338 -msgid "Back to settings" -msgstr "Назад" +msgid "Back to all settings" +msgstr "Назад ко всем настройкам" #: ubl-settings-manager.c:1418 msgid "UBLinux Settings Manager" From e18ce0691fda68cd71ab52d0a463542075b6274a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 14:48:00 +0600 Subject: [PATCH 12/36] UI updates --- ubl-settings-manager.css | 58 ++++++++++++++++++-------------------- ubl-settings-manager.glade | 36 ++++++++++------------- 2 files changed, 42 insertions(+), 52 deletions(-) diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 82d7eba..902e51f 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -6,15 +6,12 @@ background-color: #404040; #GnomeIcon{ border-style:solid; border-bottom-width: 1px; - border-image: linear-gradient(90deg, #aaaaaa 0%, rgba(170,170,170,0) 80%); + border-image: linear-gradient(90deg, alpha(@theme_text_color,0.4) 55%, alpha(@theme_bg_color, 0) 100%); border-image-slice: 1; } #SepIcon{ - border-style:solid; - border-bottom-width: 2px; - border-image: linear-gradient(90deg, #aaaaaa 0%, rgba(170,170,170,0) 100%); - border-image-slice: 1; + background-color: alpha(@theme_text_color, 0.6); } #iconlabel { @@ -30,31 +27,26 @@ background-color: #404040; .noborder { border: none; } +.menu:hover { + border-color:alpha(@theme_text_color, 0.3); +} +.menu { + border-color:alpha(@theme_text_color, 0.3); +} +.menu:hover >* { + border-color:alpha(@theme_text_color, 0.3); +} .menuitembottom{ - margin-top:0px; - margin-bottom:0px; - border-color:alpha(@theme_text_color, 0.4); - border-style:solid; - border-left-width:1px; - border-bottom-width:1px; - border-right-width:1px; + margin-top:0px; + margin-bottom:3px; } .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; + margin-top:0px; + margin-bottom:0px; } .menuitemtop{ - margin-bottom:0px; - border-color:alpha(@theme_text_color, 0.4); - border-style:solid; - border-left-width:1px; - border-top-width:1px; - border-right-width:1px; + margin-bottom:0px; } .menuitemtop *{ margin:2px 2px 0 2px; @@ -70,41 +62,45 @@ background-color: #404040; } .menuitemtop:hover { background:@theme_bg_color; + border-color:transparent; } .menuitemmiddle:hover { background:@theme_bg_color; + border:none; } .menuitembottom:hover { background:@theme_bg_color; + border:none; } .menuitemtop:hover* { margin:2px 2px 0 2px; padding: 5px 10px 3px 5px; background:@theme_selected_bg_color; - border-color:transparent; border-radius: 2px; + border:none; } .menuitemmiddle:hover* { margin:0 2px 0 2px; padding: 3px 10px 3px 5px; background:@theme_selected_bg_color; - border-color:transparent; border-radius: 2px; } .menuitembottom:hover* { margin:0 2px 2px 2px; padding: 3px 10px 5px 5px; background:@theme_selected_bg_color; - border-color:transparent; border-radius: 2px; } -.menu { - border:none; -} -.workingbg { + +.workingbg, #workingbg { background-color:@theme_base_color; } .workingbg.view.cell:selected{ background-color:@theme_selected_bg_color; } +.bkim { +background: rgba(122,122,122,0.3); +} + + diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 548449c..574a58f 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -196,6 +196,7 @@ True False + immediate True @@ -206,16 +207,10 @@ - - False @@ -984,7 +979,7 @@ True False - gtk-go-back + go-first-symbolic False @@ -1010,6 +1005,7 @@ True False center + gtk-missing-image 3 1 @@ -1603,31 +1595,29 @@ + + True True - 6 + 0 horizontal liststoreTemplate - 10 + 135 + 0 + 0 + 0 + 4 2 3 0 - - - - 2 - 3 - 1 - - @@ -1636,6 +1626,10 @@ True False + + True + False + From d1b92706306267282e71e71e0ce0c70c2145ee8f Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 6 Mar 2023 14:48:40 +0600 Subject: [PATCH 13/36] Fixed bugs, better optimisation --- source/ubl-settings-manager.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 735c9a4..95945b7 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -645,10 +645,10 @@ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widget yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); *main_config.currentThemeIconSize=24; - for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ - IVGraphicals *IV=(IVGraphicals*)dict->data; - load_apps_with_clear(IV,widgets->applist,widgets->appssize); - } + // for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ + // IVGraphicals *IV=(IVGraphicals*)dict->data; + // load_apps_with_clear(IV,widgets->applist,widgets->appssize); + // } gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); gtk_widget_hide(widgets->window); } @@ -740,8 +740,14 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); + int sz= *main_config.currentThemeIconSize; + if (sz<50) sz=50; GtkTreePath *pth = gtk_tree_model_get_path(GTK_TREE_MODEL(section->LV),&iter); - gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5,-1); + gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5, 4, sz+8, -1); + int cols = gtk_icon_view_get_columns(GTK_ICON_VIEW(section->IV)); + gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), -1); + gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), cols); + yon_time_reg_for_average(times,sz++,clock()); } @@ -1031,6 +1037,10 @@ void yon_set_default_sections(dictionary **section){ *section=(*section)->first; } +void yon_check_for_space_near_eol(){ + +} + IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVGraphicals *IVG=malloc(sizeof(IVGraphicals)); GtkWidget *box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); @@ -1050,18 +1060,22 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_widget_set_margin_end(label,6); gtk_widget_set_margin_start(label,6); gtk_widget_set_margin_bottom(label,2); + gtk_widget_set_name(label,"workingbg"); + gtk_widget_set_name(box,"workingbg"); if (main_config.WindowTheme==1) { gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); gtk_widget_set_name(iv,"GnomeIcon"); gtk_icon_view_set_activate_on_single_click(GTK_ICON_VIEW(iv),1); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } else { - gtk_widget_set_name(iv,"Icon"); + gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),3); + gtk_widget_set_name(iv,"workingbg"); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } - + gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); GtkListStore *lv=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststoreTemplate")); + gtk_widget_set_name(sep,"SepIcon"); gtk_widget_set_halign(box,0); gtk_widget_set_valign(box,1); gtk_widget_set_margin_end(sep,6); @@ -1465,7 +1479,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->socket=GTK_WIDGET(create_socket(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_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to all settings")); gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager"); g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL); if (curWidgets->GnomePaned!=NULL){ @@ -1633,7 +1647,7 @@ int main(int argc, char *argv[]){ 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")); widg=(actionWidgets*)widgets->data; - gtk_window_maximize(GTK_WINDOW(widg->window)); + //gtk_window_maximize(GTK_WINDOW(widg->window)); gtk_widget_show(widg->window); hide_if_unfound(widgets); if (main_config.WindowTheme==1) From 362d53c90d0dbda4975103e59eebd6bee5ec3f94 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 9 Mar 2023 11:16:15 +0600 Subject: [PATCH 14/36] Version in makefile, design changes --- Makefile | 7 +- VERSION.md | 1 + source/ubl-settings-manager.c | 254 ++++++++++++++++------ source/ubl-settings-manager.h | 2 + ubl-settings-manager.css | 65 +++--- ubl-settings-manager.glade | 392 +++++++++++++++++++--------------- 6 files changed, 454 insertions(+), 267 deletions(-) create mode 100644 VERSION.md diff --git a/Makefile b/Makefile index 7bced06..993aa57 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,12 @@ all: init build init: @echo "Initialize ..."; \ - echo "-- Build path: ${CMAKE_BUILD_DIR}" + version="$$(cat VERSION.md)"; \ + version=$${version:8}; \ + search="s/string version_application.*$&"; \ + replace="string version_application = \"$${version}\";"; \ + sed -i -e "$$search/$$replace/gi" source/ubl-settings-datetime.h; \ + echo "-- Build path: ${CMAKE_BUILD_DIR}" depend: @echo "Check depends ..."; \ diff --git a/VERSION.md b/VERSION.md new file mode 100644 index 0000000..323861e --- /dev/null +++ b/VERSION.md @@ -0,0 +1 @@ +string version_application = "1.1"; diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 95945b7..0ff72da 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -49,7 +49,7 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ // else // gtk_widget_show(builder->appSettings); - if (builder->ButtonBackToMain!=NULL) gtk_widget_set_sensitive(builder->ButtonBackToMain,1); + if (builder->ButtonBackToMain!=NULL) gtk_widget_show(builder->ButtonBackToMain); gtk_widget_show(GTK_WIDGET(self)); gtk_widget_show(builder->socketbuttonplace); gtk_widget_show(builder->ThirdSocketPlace); @@ -119,7 +119,7 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets if (tempapp->Pluggable==1){ if (tempapp->DualPluggable==1){ - gtk_widget_hide(applist->appSettings); + //gtk_widget_hide(applist->appSettings); char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30); sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket))); launch_app_with_arguments(tempapp[0].Exec,dualarg); @@ -166,7 +166,7 @@ void on_backToSettingsButton_clicked(GtkWidget *button,actionWidgets *sctb){ gtk_widget_destroy(sctb->socket); sctb->socket=GTK_WIDGET(create_socket(sctb)); GtkWidget *backbutton=sctb->ButtonBackToMain; - gtk_widget_set_sensitive(backbutton,0); + gtk_widget_hide(backbutton); }; void on_CancelHelpButton_activated(GtkWidget *button,GtkBuilder *builder){ @@ -241,14 +241,16 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ fclose(fp); } g_key_file_load_from_file(gfile,pth,G_KEY_FILE_NONE,&err); - sprintf(fromint,"%d",main_config.windowPosX); - g_key_file_set_string(gfile,"window","WindowPosX",fromint); - sprintf(fromint,"%d",main_config.windowPosY); - g_key_file_set_string(gfile,"window","WindowPosY",fromint); - sprintf(fromint,"%d",main_config.windowWidth); - g_key_file_set_string(gfile,"window","WindowWidth",fromint); - sprintf(fromint,"%d",main_config.windowHeight); - g_key_file_set_string(gfile,"window","WindowHeight",fromint); + if (gtk_window_is_maximized(GTK_WINDOW(widgets->window))==0){ + sprintf(fromint,"%d",main_config.windowPosX); + g_key_file_set_string(gfile,"window","WindowPosX",fromint); + sprintf(fromint,"%d",main_config.windowPosY); + g_key_file_set_string(gfile,"window","WindowPosY",fromint); + sprintf(fromint,"%d",main_config.windowWidth); + g_key_file_set_string(gfile,"window","WindowWidth",fromint); + sprintf(fromint,"%d",main_config.windowHeight); + g_key_file_set_string(gfile,"window","WindowHeight",fromint); + } sprintf(fromint,"%d",main_config.WindowTheme); g_key_file_set_string(gfile,"window","WindowTheme",fromint); sprintf(fromint,"%d",sz); @@ -282,7 +284,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi if (position<250) {position=250; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),250);} main_config.iconSegmentSize=position; if (position <115) {position=115;} - double pos=((double)position-(11/(double)position*4)*500)/1.3; + double pos=((double)position); if (pos<110) pos=110; for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; @@ -632,35 +634,39 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ actionWidgets *widgets=(actionWidgets*)widgetsD->data; int x,y; - + if (gtk_window_is_maximized(GTK_WINDOW(widgets->window))==0) + main_config.fullscreen=0; + else + main_config.fullscreen=1; gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); - if (main_config.windowWidth<1240){ - if (stld==0){ - stld=1; - main_config.WindowTheme=0; - - gtk_window_set_resizable(GTK_WINDOW(window),0); - gtk_window_get_position(GTK_WINDOW(window),&main_config.windowPosX,&main_config.windowPosY); - gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); - yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); - *main_config.currentThemeIconSize=24; - - // for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ - // IVGraphicals *IV=(IVGraphicals*)dict->data; - // load_apps_with_clear(IV,widgets->applist,widgets->appssize); - // } - gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); - gtk_widget_hide(widgets->window); - } - }else { - yon_segments_hide(widgets); - yon_segments_show(widgets); - if (stld==1){ - stld=0; - cmld=0; + if (main_config.WindowTheme==1){ + if (main_config.windowWidth<1240){ + if (stld==0){ + stld=1; + main_config.WindowTheme=0; + + gtk_window_set_resizable(GTK_WINDOW(window),0); + gtk_window_get_position(GTK_WINDOW(window),&main_config.windowPosX,&main_config.windowPosY); + gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); + yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); + *main_config.currentThemeIconSize=24; + + // for (dictionary *dict=widgets->ICSys->first;dict!=NULL;dict=dict->next){ + // IVGraphicals *IV=(IVGraphicals*)dict->data; + // load_apps_with_clear(IV,widgets->applist,widgets->appssize); + // } + gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); + gtk_widget_hide(widgets->window); + } + }else { + yon_segments_hide(widgets); + yon_segments_show(widgets); + if (stld==1){ + stld=0; + cmld=0; + } } } - } void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ @@ -685,6 +691,35 @@ void on_about_system(GtkWidget *button, actionWidgets *widgets){ launch_app_with_arguments("ubl-settings-info",arg); } +void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ + int *icsize; + printf("changed\n"); + int curthm=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); + if (curthm==0) + *icsize=main_config.Mainiconsize; + else if (curthm==1) + *icsize=main_config.Gnomeiconsize; + if (*icsize<=24){ + gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); + gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),1.0); + } else if (*icsize<=32){ + gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); + gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),2.0); + } else if (*icsize<=48){ + gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); + gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),3.0); + } else{ + gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); + gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); + gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),4.0); + } +} + + + void launch(char *command){ system(command); } @@ -732,18 +767,32 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); memcpy(path,IconPicturesPath,strlen(IconPicturesPath)); path=yon_char_get_augumented(path,applist[i].Icon); - path=yon_char_get_augumented(path,PictureFormatMain); GdkPixbuf *pixbuf; - pixbuf=gdk_pixbuf_new_from_file_at_size(path,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatMain),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); if (!pixbuf) { - pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatExtra),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + if (!pixbuf){ + GtkWidget *imag=gtk_image_new_from_icon_name(applist[i].Icon,GTK_ICON_SIZE_DIALOG); + void *a=GTK_ICON_SIZE_DIALOG; + pixbuf=gtk_image_get_pixbuf(GTK_IMAGE(imag)); + printf("%s\n",applist[i].Icon); + if (!pixbuf) + pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + else { + gdk_pixbuf_scale(pixbuf,pixbuf,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,GDK_INTERP_NEAREST); + GValue a = G_VALUE_INIT; + g_value_init (&a, G_TYPE_STRING); + g_value_set_string (&a, applist[i].Icon); + g_object_set_property(G_OBJECT(section->iconRender),"icon-name", &a); + } + } }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); int sz= *main_config.currentThemeIconSize; if (sz<50) sz=50; GtkTreePath *pth = gtk_tree_model_get_path(GTK_TREE_MODEL(section->LV),&iter); - gtk_list_store_set(section->LV,&iter,0,pixbuf,1,applist[i].Name,2,0.0,3,0.5, 4, sz+8, -1); + gtk_list_store_set(section->LV,&iter,0, pixbuf, 1,applist[i].Name,2,0.0,3,0.5, 4, sz+8, 5, applist[i].Icon, -1); int cols = gtk_icon_view_get_columns(GTK_ICON_VIEW(section->IV)); gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), -1); gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), cols); @@ -976,6 +1025,70 @@ int setup_config(){ return 1; }; +void save_config(actionWidgets *widgets){ + GKeyFile *gfile=g_key_file_new(); + + int sz=1,szm=1; + if (main_config.Gnomeiconsize==64) sz=4; + if (main_config.Gnomeiconsize==48) sz=3; + if (main_config.Gnomeiconsize==32) sz=2; + if (main_config.Gnomeiconsize==24) sz=1; + if (main_config.Mainiconsize==64) szm=4; + if (main_config.Mainiconsize==48) szm=3; + if (main_config.Mainiconsize==32) szm=2; + if (main_config.Mainiconsize==24) szm=1; + char *fromint=malloc(5); + memset(fromint,0,5); + GError *err=NULL; + char *login=getlogin(); + if (geteuid()==0){ + login=main_config.lastUser; + } else { + main_config.lastUser=login; + } + char *pth=malloc(7+strlen(UserConfigPath)+strlen(getlogin())); + sprintf(pth,"%s%s%s","/home/",getlogin(),UserConfigPath); + g_key_file_load_from_file(gfile,pth,G_KEY_FILE_NONE,&err); + if (err){ + struct stat st = {0}; + char *ptdir=malloc(36+strlen(getlogin())); + sprintf(ptdir,"%s%s%s","/home/",getlogin(),"/.config/ubl-settings-manager"); + if (stat(ptdir, &st) == -1) { + mkdir(ptdir, 0777); + } + FILE *fp; + fp=fopen(pth,"w"); + fclose(fp); + } + g_key_file_load_from_file(gfile,pth,G_KEY_FILE_NONE,&err); + if (main_config.fullscreen==0){ + sprintf(fromint,"%d",main_config.windowPosX); + g_key_file_set_string(gfile,"window","WindowPosX",fromint); + sprintf(fromint,"%d",main_config.windowPosY); + g_key_file_set_string(gfile,"window","WindowPosY",fromint); + sprintf(fromint,"%d",main_config.windowWidth); + g_key_file_set_string(gfile,"window","WindowWidth",fromint); + sprintf(fromint,"%d",main_config.windowHeight); + g_key_file_set_string(gfile,"window","WindowHeight",fromint); + } + sprintf(fromint,"%d",main_config.WindowTheme); + g_key_file_set_string(gfile,"window","WindowTheme",fromint); + sprintf(fromint,"%d",sz); + g_key_file_set_string(gfile,"window","GnomeIconSize",fromint); + sprintf(fromint,"%d",szm); + g_key_file_set_string(gfile,"window","MainIconSize",fromint); + sprintf(fromint,"%d",main_config.iconSegmentSize); + g_key_file_set_string(gfile,"window","IconSegmentSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.GnomelabelSize/1000)); + g_key_file_set_string(gfile,"window","GnomeLabelSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.MainlabelSize/1000)); + g_key_file_set_string(gfile,"window","MainLabelSize",fromint); + sprintf(fromint,"%d",(int)((float)main_config.labelDensity/1000)); + g_key_file_set_string(gfile,"window","LabelDensity",fromint); + g_key_file_set_string(gfile,"window","User",login); + g_key_file_save_to_file(gfile,pth,NULL); +} + char *yon_cut(char *source, int size, int startpos){ char *cut=NULL; cut=malloc(size+1); @@ -1042,13 +1155,14 @@ void yon_check_for_space_near_eol(){ } IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ - IVGraphicals *IVG=malloc(sizeof(IVGraphicals)); - GtkWidget *box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - GtkBuilder *builder=gtk_builder_new_from_file(GladePath); - GtkWidget *iv=GTK_WIDGET(gtk_builder_get_object(builder,"iconTemplate")); - GtkWidget *label=gtk_label_new(_(name)); - PangoAttrList *attrs=pango_attr_list_new(); - PangoFontDescription *descr=pango_font_description_new(); + IVGraphicals *IVG = malloc(sizeof(IVGraphicals)); + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + GtkBuilder *builder = gtk_builder_new_from_file(GladePath); + GtkWidget *iv = GTK_WIDGET(gtk_builder_get_object(builder,"iconTemplate")); + GtkWidget *label = gtk_label_new(_(name)); + GtkCellRendererPixbuf *iconRender = GTK_CELL_RENDERER_PIXBUF(gtk_builder_get_object(builder, "iconPic")); + PangoAttrList *attrs = pango_attr_list_new(); + PangoFontDescription *descr = pango_font_description_new(); pango_font_description_set_weight(descr,PANGO_WEIGHT_BOLD); int stretch = main_config.labelDensity; if (stretch>8) @@ -1060,8 +1174,9 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_widget_set_margin_end(label,6); gtk_widget_set_margin_start(label,6); gtk_widget_set_margin_bottom(label,2); - gtk_widget_set_name(label,"workingbg"); - gtk_widget_set_name(box,"workingbg"); + // gtk_widget_set_name(label,"workingbg"); + // gtk_widget_set_name(box,"workingbg"); + gtk_icon_view_set_spacing(GTK_ICON_VIEW(iv),20); if (main_config.WindowTheme==1) { gtk_icon_view_set_columns(GTK_ICON_VIEW(iv),1); gtk_widget_set_name(iv,"GnomeIcon"); @@ -1069,7 +1184,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } else { gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),3); - gtk_widget_set_name(iv,"workingbg"); + //gtk_widget_set_name(iv,"workingbg"); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); @@ -1087,11 +1202,12 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_box_pack_start(GTK_BOX(box),iv,FALSE,FALSE,0); IVG->sectionName=name; IVG->categories=cats; - IVG->LV=lv; - IVG->Box=box; - IVG->IV=iv; - IVG->label=label; - IVG->sep=sep; + IVG->LV = lv; + IVG->Box = box; + IVG->IV = iv; + IVG->label = label; + IVG->sep = sep; + IVG->iconRender = iconRender; return IVG; } @@ -1157,7 +1273,7 @@ void yon_icv_resize_item(dictionary *icdict, GtkWidget *paned){ for (dictionary *dict=icdict->first;dict!=NULL;dict=dict->next){ IVGraphicals *icv=(IVGraphicals*)dict->data; int width=gtk_paned_get_position(GTK_PANED(paned)); - int pos=(int)((double)width-(11/(double)width*4)*500)/1.3; + int pos=(int)((double)width); if (pos < 115) pos=115; gtk_icon_view_set_item_width(GTK_ICON_VIEW(icv->IV),pos); @@ -1215,6 +1331,8 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); gtk_window_move(GTK_WINDOW(widgets->window),main_config.windowPosX,main_config.windowPosY); if (strcmp(dct->key,"Gnome")==0){ + main_config.currentThemeIconSize=&main_config.Gnomeiconsize; + main_config.currentThemeLabelSize=&main_config.GnomelabelSize; int x,y; GdkRectangle workarea; gdk_monitor_get_workarea(gdk_display_get_monitor(gdk_screen_get_display(gtk_window_get_screen(GTK_WINDOW(widgets->window))),0),&workarea); @@ -1246,6 +1364,8 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ } } else { + main_config.currentThemeIconSize=&main_config.Mainiconsize; + main_config.currentThemeLabelSize=&main_config.MainlabelSize; gtk_widget_show(widgets->window); main_config.WindowTheme=0; main_config.curThemeName="Main"; @@ -1445,6 +1565,11 @@ void yon_time_reg_for_average(dictionary *listofregs, int size, time_t tm){ void yon_small_window_theme_change(actionWidgets *widgets){ } +void yon_main_quit(actionWidgets *widgets){ + save_config(widgets); + gtk_main_quit(); +} + dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *theme_id, apps *applist, int appsize){ dictionary *widgets=*widgetss; @@ -1480,23 +1605,22 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them 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 all settings")); - gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager"); - g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(gtk_main_quit), NULL); + gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager")); if (curWidgets->GnomePaned!=NULL){ gtk_paned_set_position(GTK_PANED(curWidgets->GnomePaned),main_config.iconSegmentSize); g_signal_connect(G_OBJECT(curWidgets->GnomePaned), "notify::position", G_CALLBACK(on_paned_move), curWidgets); } + g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); if (strcmp(theme_id,"Gnome")==0){ on_about_system(NULL,curWidgets); - g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets); } if (curWidgets->ButtonBackToMain!=NULL) g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets); curWidgets->LabelTitle=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"LabelTitle")); - gtk_window_set_title(GTK_WINDOW(curWidgets->window),"UBLinux Settings Manager GNOME"); + gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager")); // Standard for all themes @@ -1537,10 +1661,9 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them if (gnld==0){ gnld=1; - + g_signal_connect(G_OBJECT(curWidgets->settingsThemeChooser), "changed", G_CALLBACK(on_theme_selection_changed), curWidgets); g_signal_connect(G_OBJECT(curWidgets->CancelHelpButton), "clicked", G_CALLBACK(on_CancelHelpButton_activated), curWidgets->builder); g_signal_connect(G_OBJECT(curWidgets->ReadHelpButton), "clicked", G_CALLBACK(on_ReadHelpButton_activated), curWidgets->builder); - 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); @@ -1550,6 +1673,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them g_signal_connect(G_OBJECT(curWidgets->SectionSettingsSaveButton), "clicked", G_CALLBACK(on_sections_save), curWidgets); g_signal_connect(G_OBJECT(curWidgets->CautionUnderstandButton), "clicked", G_CALLBACK(on_caution_understand), curWidgets); } + g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(yon_main_quit), curWidgets); gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelTheme),_("Window theme")); @@ -1647,7 +1771,7 @@ int main(int argc, char *argv[]){ 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")); widg=(actionWidgets*)widgets->data; - //gtk_window_maximize(GTK_WINDOW(widg->window)); + gtk_window_maximize(GTK_WINDOW(widg->window)); gtk_widget_show(widg->window); hide_if_unfound(widgets); if (main_config.WindowTheme==1) diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index bb1c409..5c8f997 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -50,6 +50,7 @@ typedef struct IVGrapgicals{ GtkWidget *IV; GtkWidget *label; GtkWidget *sep; + GtkCellRendererPixbuf *iconRender; } IVGraphicals; typedef struct IconSection{ @@ -75,6 +76,7 @@ typedef struct { int labelDensity; char *lastUser; int changed; + int fullscreen; } config; typedef struct { diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 902e51f..79a5aa8 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -28,13 +28,13 @@ background-color: #404040; border: none; } .menu:hover { - border-color:alpha(@theme_text_color, 0.3); + border-color:alpha(@theme_text_color, 0.01); } .menu { - border-color:alpha(@theme_text_color, 0.3); + border-color:alpha(@theme_text_color, 0.01); } .menu:hover >* { - border-color:alpha(@theme_text_color, 0.3); + border-color:alpha(@theme_text_color, 0.01); } .menuitembottom{ margin-top:0px; @@ -49,58 +49,61 @@ background-color: #404040; margin-bottom:0px; } .menuitemtop *{ - margin:2px 2px 0 2px; - padding: 5px 10px 3px 5px; + margin:2px 2px 0 2px; + padding: 5px 10px 3px 5px; } .menuitemmiddle *{ - margin:0 2px 0 2px; - padding: 3px 10px 3px 5px; + margin:0 2px 0 2px; + padding: 3px 10px 3px 5px; } .menuitembottom *{ - margin:0 2px 2px 2px; - padding: 3px 10px 5px 5px; + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; } .menuitemtop:hover { - background:@theme_bg_color; - border-color:transparent; + background:@theme_bg_color; } .menuitemmiddle:hover { - background:@theme_bg_color; - border:none; + background:@theme_bg_color; } .menuitembottom:hover { - background:@theme_bg_color; - border:none; - + 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:none; + 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; + 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; + margin:0 2px 2px 2px; + padding: 3px 10px 5px 5px; + background:@theme_selected_bg_color; + border-radius:2px; } .workingbg, #workingbg { background-color:@theme_base_color; } -.workingbg.view.cell:selected{ +.workingbg.view.cell:selected { background-color:@theme_selected_bg_color; } +.workingbg.view.cell:hover { + background-color:darker(@theme_selected_bg_color); + color:@theme_selected_text_color; + border-radius:3px; +} .bkim { -background: rgba(122,122,122,0.3); + transition: 200ms ease-out; + background-image: none; } + diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 574a58f..2db0b73 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -19,10 +19,12 @@ True False center - center - 30 - 30 - gtk-dialog-warning + start + 20 + 20 + 20 + 20 + dialog-question-symbolic 6 @@ -36,9 +38,11 @@ True False center - center + start 5 25 + 20 + 20 You are not allowed to change theme on such low resolution! True 0.019999999552965164 @@ -84,7 +88,8 @@ True False - gtk-dialog-warning + 32 + dialog-question-symbolic 5 @@ -191,6 +196,7 @@ True True + external in @@ -201,12 +207,14 @@ True False - 3 - 3 vertical + @@ -365,109 +373,81 @@ True False True - - + + True False - True + 32 + ubconfig-gui + 5 + + + + + True + False + center + center + vertical - - True - False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - 0 - + + + + 1 + + + + + True + False - + True - False + True + False + True center center + GnomeMenu + none + False True - 1 - - - - - True - False - - - True - True - False - True - GnomeMenu - none - - - - - - - False - True - 0 - - - - - False - True - end - 2 + 0 + + end + 2 + - - True - False - 32 - ubconfig-gui - 5 - - - - + True False center center - vertical - 1 + end + 3 + @@ -492,7 +472,7 @@ start 20 20 - gtk-dialog-question + dialog-question-symbolic 6 @@ -650,8 +630,7 @@ True False 32 - gtk-dialog-question - 5 + dialog-question-symbolic @@ -976,6 +955,7 @@ 1 10 + True False @@ -1061,8 +1041,6 @@ natural - 5 - 5 True False vertical @@ -1132,87 +1110,6 @@ True False True - - - True - False - True - - - True - False - - - True - False - UBLinux Settings Manager - - - True - True - 0 - - - - - True - True - 0 - - - - - True - False - center - center - - - - - - - False - True - 1 - - - - - True - False - vertical - - - True - True - False - True - MainMenu - none - False - - - - - - False - True - 0 - - - - - False - True - end - 2 - - - - True @@ -1225,12 +1122,12 @@ Back to settings - True - False True False False False + center + center 10 10 image1 @@ -1252,12 +1149,67 @@ 2 + + + True + False + vertical + + + True + True + False + True + center + center + MainMenu + none + False + + + + + + False + True + 0 + + + + + end + 3 + + + + + True + False + center + center + + + + + + + end + 4 + + + @@ -1315,7 +1267,7 @@ True False - gtk-ok + object-select-symbolic False @@ -1597,24 +1549,29 @@ + + True True - 0 + 4 horizontal liststoreTemplate 135 + 10 0 0 0 + True 4 2 3 + 5 0 @@ -1964,4 +1921,99 @@ + + False + + + True + False + vertical + + + True + False + + + True + False + start + 20 + 20 + 20 + 20 + True + dialog-question-symbolic + 6 + + + True + True + 0 + + + + + True + False + start + 10 + 10 + 20 + 20 + Looks like you don't have ubl-settings-info installed on your PC + True + 0 + + + False + True + 1 + + + + + False + True + 0 + + + + + Ok + True + True + True + end + end + 5 + 5 + 5 + 5 + + + False + True + end + 1 + + + + + + + True + False + Warning + False + + + True + False + 32 + dialog-question-symbolic + + + + + From 260ce91e032634c78c8afdcfe5a6a5cceff3c451 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 9 Mar 2023 12:57:18 +0600 Subject: [PATCH 15/36] divided config parameters for each theme, unfound icons fix --- source/ubl-settings-manager.c | 123 +++++++++++++++++++++------------- source/ubl-settings-manager.h | 1 + ubl-settings-manager.glade | 18 ++--- 3 files changed, 85 insertions(+), 57 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 0ff72da..95b04e6 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -82,7 +82,7 @@ void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *appl if (!tempapp){}else{ char arg[100]; memset(arg,0,100); - printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); + // printf("%d\n%d\n\n\n\n",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton))); if (tempapp[0].Type==1){ @@ -210,13 +210,13 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ int sz=1,szm=1; if (main_config.Gnomeiconsize==64) sz=4; - if (main_config.Gnomeiconsize==48) sz=3; - if (main_config.Gnomeiconsize==32) sz=2; - if (main_config.Gnomeiconsize==24) sz=1; + else if (main_config.Gnomeiconsize==48) sz=3; + else if (main_config.Gnomeiconsize==32) sz=2; + else if (main_config.Gnomeiconsize==24) sz=1; if (main_config.Mainiconsize==64) szm=4; - if (main_config.Mainiconsize==48) szm=3; - if (main_config.Mainiconsize==32) szm=2; - if (main_config.Mainiconsize==24) szm=1; + else if (main_config.Mainiconsize==48) szm=3; + else if (main_config.Mainiconsize==32) szm=2; + else if (main_config.Mainiconsize==24) szm=1; char *fromint=malloc(5); memset(fromint,0,5); GError *err=NULL; @@ -693,28 +693,39 @@ void on_about_system(GtkWidget *button, actionWidgets *widgets){ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ int *icsize; - printf("changed\n"); + // printf("changed\n"); int curthm=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); - if (curthm==0) - *icsize=main_config.Mainiconsize; - else if (curthm==1) - *icsize=main_config.Gnomeiconsize; - if (*icsize<=24){ + // main_config.changed=1; + if (curthm==0){ + main_config.currentThemeIconSize=&main_config.Mainiconsize; + main_config.currentThemeLabelSize=&main_config.MainlabelSize; + icsize=main_config.currentThemeIconSize; + } + else if (curthm==1){ + main_config.currentThemeIconSize=&main_config.Gnomeiconsize; + main_config.currentThemeLabelSize=&main_config.GnomelabelSize; + icsize=main_config.currentThemeIconSize; + } + if (*icsize==24 || *icsize==1){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"24x24"); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,24,24,1,NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),1.0); - } else if (*icsize<=32){ + *icsize=24; + } else if (*icsize==32 || *icsize==2){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"32x32"); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,32,32,1,NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),2.0); - } else if (*icsize<=48){ + *icsize=32; + } else if (*icsize==48 || *icsize==3){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"48x48"); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,48,48,1,NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),3.0); + *icsize=48; } else{ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),"64x64"); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gdk_pixbuf_new_from_file_at_scale(AppIconPath,64,64,1,NULL)); gtk_scale_set_value_pos(GTK_SCALE(widgets->settingsSizeSlider),4.0); + *icsize=64; } } @@ -763,36 +774,38 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ for (int i=0;icategories)==1){ GError *err=NULL; - char *path=malloc(strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); - memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); - memcpy(path,IconPicturesPath,strlen(IconPicturesPath)); - path=yon_char_get_augumented(path,applist[i].Icon); - GdkPixbuf *pixbuf; - pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatMain),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - if (!pixbuf) { - pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatExtra),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - if (!pixbuf){ - GtkWidget *imag=gtk_image_new_from_icon_name(applist[i].Icon,GTK_ICON_SIZE_DIALOG); - void *a=GTK_ICON_SIZE_DIALOG; - pixbuf=gtk_image_get_pixbuf(GTK_IMAGE(imag)); - printf("%s\n",applist[i].Icon); - if (!pixbuf) - pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); - else { - gdk_pixbuf_scale(pixbuf,pixbuf,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,GDK_INTERP_NEAREST); - GValue a = G_VALUE_INIT; - g_value_init (&a, G_TYPE_STRING); - g_value_set_string (&a, applist[i].Icon); - g_object_set_property(G_OBJECT(section->iconRender),"icon-name", &a); - } - } - }; + // char *path=malloc(strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); + // memset(path,0,strlen(IconPicturesPath)+strlen(applist[i].Icon)+7); + // memcpy(path,IconPicturesPath,strlen(IconPicturesPath)); + // path=yon_char_get_augumented(path,applist[i].Icon); + // GdkPixbuf *pixbuf; + // pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatMain),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + // if (!pixbuf) { + // pixbuf=gdk_pixbuf_new_from_file_at_size(yon_char_get_augumented(path,PictureFormatExtra),*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + // if (!pixbuf){ + // GtkWidget *imag=gtk_image_new_from_icon_name(applist[i].Icon,yon_get_icon_size(*main_config.currentThemeIconSize)); + // void *a=GTK_ICON_SIZE_DIALOG; + // pixbuf=gtk_image_get_pixbuf(GTK_IMAGE(imag)); + // // printf("%s\n",applist[i].Icon); + // if (!pixbuf) + // pixbuf=gdk_pixbuf_new_from_file_at_size(ErrIconPicturePath,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,NULL); + // else { + // gdk_pixbuf_scale(pixbuf,pixbuf,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,0,0,*main_config.currentThemeIconSize,*main_config.currentThemeIconSize,GDK_INTERP_NEAREST); + // GValue a = G_VALUE_INIT; + // g_value_init (&a, G_TYPE_STRING); + // g_value_set_string (&a, applist[i].Icon); + // g_object_set_property(G_OBJECT(section->iconRender),"icon-name", &a); + // } + // } + // }; GtkTreeIter iter; gtk_list_store_append(section->LV,&iter); - int sz= *main_config.currentThemeIconSize; + int sz= *main_config.currentThemeIconSize+10; if (sz<50) sz=50; + GtkIconTheme *icthm=gtk_icon_theme_get_default(); + GdkPixbuf *pixbuf=gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, applist[i].Icon,yon_get_icon_size(*main_config.currentThemeIconSize),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL); GtkTreePath *pth = gtk_tree_model_get_path(GTK_TREE_MODEL(section->LV),&iter); - gtk_list_store_set(section->LV,&iter,0, pixbuf, 1,applist[i].Name,2,0.0,3,0.5, 4, sz+8, 5, applist[i].Icon, -1); + gtk_list_store_set(section->LV,&iter,0,applist[i].Name,1,0.0,2,0.5, 3, sz+8, 4, pixbuf, 5,yon_get_icon_size(*main_config.currentThemeIconSize), -1); int cols = gtk_icon_view_get_columns(GTK_ICON_VIEW(section->IV)); gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), -1); gtk_icon_view_set_columns(GTK_ICON_VIEW(section->IV), cols); @@ -801,7 +814,7 @@ int load_apps(IVGraphicals *section, apps *applist, int size){ } } - printf("среднее время на каждую проверку: %f\n",yon_time_average(times)/1000); + // printf("среднее время на каждую проверку: %f\n",yon_time_average(times)/1000); gtk_icon_view_set_model(GTK_ICON_VIEW(section->IV),GTK_TREE_MODEL(section->LV)); }; @@ -1187,7 +1200,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ //gtk_widget_set_name(iv,"workingbg"); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); } - gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),1); + gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),0); GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); GtkListStore *lv=GTK_LIST_STORE(gtk_builder_get_object(builder,"liststoreTemplate")); gtk_widget_set_name(sep,"SepIcon"); @@ -1375,6 +1388,13 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ } +int yon_get_icon_size(int size){ + if (size==1||size==24) return 24; + if (size==2||size==32) return 32; + if (size==3||size==48) return 51; + if (size==4||size==64) return 64; +} + void yon_icon_size_convert(int mode){ if (mode==0){ if (*main_config.currentThemeIconSize==1) *main_config.currentThemeIconSize=24; @@ -1716,7 +1736,7 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - printf("\n\n"); + // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); yon_icv_resize_item(widg->ICSys,widg->GnomePaned); theme="Main"; @@ -1729,13 +1749,16 @@ int main(int argc, char *argv[]){ widg->applist=applist; widg->appssize=*size; widg->ICSys=yon_create_icon_section_list(main_config.sections); + main_config.currentThemeIconSize=&main_config.Mainiconsize; + main_config.currentThemeLabelSize=&main_config.MainlabelSize; for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - printf("\n\n"); + // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); main_config.WindowTheme=1; - + main_config.currentThemeIconSize=&main_config.Gnomeiconsize; + main_config.currentThemeLabelSize=&main_config.GnomelabelSize; } else { theme="Main"; @@ -1746,7 +1769,7 @@ int main(int argc, char *argv[]){ for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - printf("\n\n"); + // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); theme="Gnome"; main_config.WindowTheme=1; @@ -1757,14 +1780,18 @@ int main(int argc, char *argv[]){ widg=(actionWidgets*)widgets->next->data; widg->applist=applist; widg->appssize=*size; + main_config.currentThemeIconSize=&main_config.Gnomeiconsize; + main_config.currentThemeLabelSize=&main_config.GnomelabelSize; widg->ICSys=yon_create_icon_section_list(main_config.sections); for (dictionary *cur=widg->ICSys->first; cur!=NULL;cur=cur->next){ load_apps((IVGraphicals*)cur->data,widg->applist,widg->appssize); } - printf("\n\n"); + // printf("\n\n"); yon_show_icon_views(widg->ICSys,widg); main_config.WindowTheme=0; yon_icv_resize_item(widg->ICSys,widg->GnomePaned); + main_config.currentThemeIconSize=&main_config.Mainiconsize; + main_config.currentThemeLabelSize=&main_config.MainlabelSize; } if (geteuid()==0){ } diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 5c8f997..fa2a799 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -220,5 +220,6 @@ float yon_time_average(dictionary *times); void yon_time_reg_for_average(dictionary *listofregs, int size, time_t tm); void yon_dictionary_switch_to_last(dictionary **dict); dictionary *yon_dictionary_create_conneced(dictionary *targetdict); +int yon_get_icon_size(int size); #endif \ No newline at end of file diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 2db0b73..86dc2b0 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -1539,8 +1539,6 @@ - - @@ -1549,8 +1547,10 @@ - - + + + + @@ -1568,11 +1568,11 @@ - 4 - 2 - 3 - 5 - 0 + 3 + 1 + 2 + 4 + 5 @@ -985,7 +1002,7 @@ True False center - gtk-missing-image + ubl-settings-manager-banner 3 - + False - 800 - 600 - ubconfig-gui + 450 + 250 + dialog-question True @@ -152,21 +152,40 @@ True False + + + True + False + start + 20 + 20 + dialog-question-symbolic + 6 + + + False + True + 0 + + True False - True vertical - + True False - center - 3 + start + 10 + 5 + Would you like to read documentation in the Web? + + + @@ -175,190 +194,59 @@ 0 - - - - False - True - 0 - - - - - True - True - 52 - True - True - + True - True - external - in - - - True - False - immediate - - - True - False - vertical - - - - - - - - + False + start + start + 15 + 10 + You will be redirected to documentation website where documentation is translated and supported by community. + True + - False - True + True + True + 1 - + + Always redirect to online documentation 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 - - + True + False + end + 5 + 10 + True + - True - True + False + True + 2 + True True - end 1 + True @@ -366,226 +254,8 @@ 0 - - - - - True - False - True - - True - False - 32 - ubconfig-gui - 5 - - - - - Back to settings - True - False - False - False - center - center - 10 - 10 - image5 - - - 1 - - - - - True - False - - - True - True - False - True - center - center - GnomeMenu - none - - - - - - - False - True - 0 - - - - - end - 2 - - - - - True - False - center - center - - - - - - end - 3 - - - - - True - False - center - center - vertical - - - - - - 4 - - - - - - - - False - 450 - 250 - dialog-question - - - True - False - vertical - - - True - False - - - True - False - start - 20 - 20 - dialog-question-symbolic - 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 - - - - - - True - True - 0 - - - - + True False 5 @@ -960,7 +630,7 @@ True False 32 - ubconfig-gui + ubl-settings-manager 5 @@ -1132,7 +802,7 @@ True False 32 - ubconfig-gui + ubl-settings-manager 5 @@ -1164,301 +834,588 @@ - + + + + 2 + + + + + True + False + vertical + + + True + True + False + True + center + center + MainMenu + none + False + + + + + + False + True + 0 + + + + + end + 3 + + + + + True + False + center + center + + + + + + + end + 4 + + + + + + + + True + False + gtk-undelete + + + True + False + ubconfig-gui + 6 + + + True + False + + + True + False + Element 1 + + + + + True + False + Element 2 + + + True + False + + + True + False + Element 3 + + + + + + + + + Element 4 + True + False + image3 + False + + + + + True + False + object-select-symbolic + + + False + 800 + 600 + + + True + False + vertical + + + True + True + 5 + 5 + 5 + 5 + in + + + True + False + + + True + False + vertical + + + True + False + 5 + 5 + 5 + 5 + 5 + 5 + vertical + + + + + + False + True + 0 + + + + + True + False + 5 + 5 + 5 + 5 + 0.019999999552965164 + in + + + True + False + 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 + + + + + + + + + + + + False + True + 1 + + + + + + - 2 + True + True + 0 True False - vertical - + + Close True True - False True - center - center - MainMenu - none - False - - - + 5 + 5 False True + end 0 - - - end - 3 - - - - - True - False - center - center - + + Save and apply + True + True + True + 17 + 5 + + + False + True + end + 1 + - - end - 4 + False + True + 1 - - - - - - True - False - gtk-undelete - - - True - False - ubconfig-gui - 6 - - - True - False - - - True - False - Element 1 - - + + True False - Element 2 - - + UBLinux Settings + + True False - - - True - False - Element 3 - - + 32 + ubl-settings-manager + 5 - - - Element 4 - True - False - image3 - False - - - + True False - object-select-symbolic + go-first-symbolic - + False 800 600 + ubconfig-gui True False vertical - + True - True - 5 - 5 - 5 - 5 - in + False - + True False + True + vertical - + True False - vertical + center + 3 + + + + False + True + 0 + + + + + + False + True + 0 + + + + + True + True + 52 + True + True + + + True + True + external + in - + True False - 5 - 5 - 5 5 - 5 - 5 - vertical + immediate + natural - + + True + False + vertical + + + + + - - False - True - 0 - + + + False + True + + + + + True + False + vertical - + True False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in + vertical - + True False - 3 - 3 - 5 - 5 + 3 + 3 + 3 + 3 + 3 + 0 + in - + True False - - - True - True - True - center - 3 - image2 - - - False - True - 0 - - - - - True - True - True - False - Section name - name - - - True - True - 1 - - + 12 True False + center + center - + + + False + True + 0 + + + + True False - center - - - True - True - True - 5 - image4 - - - False - True - end - 2 - - - + + desklabel True False - 2 - - - True - True - 5 - 5 - 5 - 10 - False - Identifier - - - True - True - 0 - - + center + right + 1 - True + False True - 2 + 0 - True + False True 1 - - True - True - 2 - + + + + + + True + True + 0 + - - + + + True + True + 0 + + + + + True + False + vertical + + + False + vertical + + + + + + False + True + 0 + @@ -1468,8 +1425,18 @@ + + True + True + + + True + True + end + 1 + @@ -1478,73 +1445,108 @@ 0 + + + + + True + False + True + + + True + False + 32 + ubl-settings-manager + 5 + + + + + Back to settings + True + False + False + False + center + center + 10 + 10 + image5 + + + 1 + + True False - - Close + True True + False True - 5 - 5 + center + center + GnomeMenu + none + + + + False True - end 0 + + + end + 2 + + + + + True + False + center + center - - Save and apply - True - True - True - 17 - 5 - - - False - True - end - 1 - + - False - True - 1 + end + 3 - - - - - True - False - UBLinux Settings - + True False - 32 - ubconfig-gui - 5 + center + center + vertical + + + + + 4 + + - - True - False - go-first-symbolic - @@ -1579,10 +1581,10 @@ True True 4 + natural horizontal liststoreTemplate 135 - 10 0 0 0 @@ -1874,7 +1876,7 @@ True False 32 - ubconfig-gui + ubl-settings-manager 5 From c5f5d813a2e13ac940b048850c15a0dae211ad3e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 10 Mar 2023 11:53:13 +0600 Subject: [PATCH 19/36] fixed compilation error --- source/ubl-settings-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 7fb72cc..9fa132c 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -45,8 +45,8 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); gtk_widget_set_vexpand(GTK_WIDGET(self),1); gtk_widget_show(builder->socketplace); - if main_c - gtk_widget_hide(applist->appSettings); + if (main_config.WindowTheme==0) + gtk_widget_hide(builder->appSettings); // if (main_config.WindowTheme==0) // else From f7527b94362da88ee0d79187fcc71840bf94626d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 10 Mar 2023 15:06:58 +0600 Subject: [PATCH 20/36] hiding options in Gnome theme returned --- source/ubl-settings-manager.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 9fa132c..37d7c97 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -45,12 +45,7 @@ void on_plug_added(GtkSocket* self, actionWidgets *builder){ gtk_widget_set_vexpand(GTK_WIDGET(builder->socketplace),1); gtk_widget_set_vexpand(GTK_WIDGET(self),1); gtk_widget_show(builder->socketplace); - if (main_config.WindowTheme==0) gtk_widget_hide(builder->appSettings); - // if (main_config.WindowTheme==0) - - // else - // gtk_widget_show(builder->appSettings); if (builder->ButtonBackToMain!=NULL) gtk_widget_show(builder->ButtonBackToMain); gtk_widget_show(GTK_WIDGET(self)); gtk_widget_show(builder->socketbuttonplace); @@ -69,14 +64,11 @@ void on_plug_removed(GtkSocket* self, actionWidgets *widgets){ gtk_widget_destroy(widgets->socketbutton); if(widgets->ThirdSocket) gtk_widget_destroy(widgets->ThirdSocket); - - gtk_widget_show(widgets->appSettings); } void on_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets *applist){ GtkTreeIter iter; char *name; - gtk_widget_hide(applist->appSettings); gtk_tree_model_get_iter(gtk_icon_view_get_model(self),&iter,path); gtk_tree_model_get(gtk_icon_view_get_model(self),&iter,0,&name,-1); @@ -119,7 +111,6 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets if (tempapp->Pluggable==1){ if (tempapp->DualPluggable==1){ - //gtk_widget_hide(applist->appSettings); char *dualarg=malloc(strlen("--socket-id= --socket-ext-id= --socket-trd-id=")+30); sprintf(dualarg,"--socket-id=%d --socket-ext-id=%d --socket-trd-id=%d",gtk_socket_get_id(GTK_SOCKET(applist->socket)),gtk_socket_get_id(GTK_SOCKET(applist->socketbutton)),gtk_socket_get_id(GTK_SOCKET(applist->ThirdSocket))); if (launch_app_with_arguments(tempapp[0].Exec,dualarg)==32512) From eaafd607cd093755b9e5e0e87c62a527129acc40 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 10 Mar 2023 15:59:59 +0600 Subject: [PATCH 21/36] increased padding between icon elements --- ubl-settings-manager.glade | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 9724b45..43378f6 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -181,6 +181,7 @@ 10 5 Would you like to read documentation in the Web? + 0 @@ -204,6 +205,7 @@ 10 You will be redirected to documentation website where documentation is translated and supported by community. True + 0 @@ -1279,7 +1281,6 @@ True False - 5 immediate natural @@ -1585,12 +1586,14 @@ horizontal liststoreTemplate 135 - 0 - 0 - 0 + 2 + 2 + 5 True - + + 2 + 3 1 From 2605be7163633b9defb2f9dc52c73fbdb9969762 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 10 Mar 2023 16:58:38 +0600 Subject: [PATCH 22/36] deprecated variables removal --- source/ubl-settings-manager.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index b6bb96f..d10ecef 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -13,11 +13,9 @@ #define AppBannerPath "/usr/share/ubl-settings-manager/ui/ubl-settings-manager-banner.png" #define DesktopPath "/usr/share/applications/" #define IconPicturesPath "/usr/share/icons/hicolor/scalable/apps/" -#define ErrIconPicturePath "/usr/share/icons/Faenza/emblems/32/emblem-important.png" #define ublinux_logo "/usr/share/ubl-settings-manager/ui/ublinux-logo.svg" #define LocalePath "/usr/share/locale" #define LocaleName "ubl-settings-manager" -#define LogoPath "/usr/share/icons/hicolor/scalable/apps/ubl-settings-manager.svg" #define ubl_settings_infoPath "ubl-settings-info" #define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id=" char *version_application = "1.3"; From 78e522b47b7ccac1bb7238c633c1dfbcd46d0d9a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Mar 2023 11:07:07 +0600 Subject: [PATCH 23/36] version_application implementation, localisation for about window --- .gitignore | 3 +- Makefile | 10 +++--- source/ubl-settings-manager.c | 19 +++++++---- source/ubl-settings-manager.h | 3 +- ubl-settings-manager.glade | 42 +++++++++++++++++++++++++ ubl-settings-manager_ru.po | 59 +++++++++++++++++++---------------- 6 files changed, 95 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 42fe714..7eb13de 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ css/ .config/ images/ locale/ -ui/ \ No newline at end of file +ui/ +ubl-settings-manager_ru.pos \ No newline at end of file diff --git a/Makefile b/Makefile index 32ef201..cc5f38d 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ CMAKE_BUILD_DIR = ./compile DEPENDS = cmake PKGNAME = $(MAKEFILE_DIR) #PKGNAME = ubl-settings-manager -pkgdir = default_target: all @@ -23,8 +22,9 @@ init: @echo "Initialize ..."; \ version="$$(cat VERSION.md)"; \ version=$${version:8}; \ - search="s/char *version_application.*$&"; \ - replace="char *version_application = \"$${version}\";"; \ + search="s/string version_application.*$&"; \ + echo $$search; \ + replace="string version_application = \"$${version}\";"; \ sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \ echo "-- Build path: ${CMAKE_BUILD_DIR}" @@ -91,9 +91,7 @@ uninstall: @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}.glade" @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" @$(RM) "/usr/share/${PKGNAME}/ui/${PKGNAME}-banner.png" - @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" - @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" - @$(RM) "/usr/share/${PKGNAME}/css/${PKGNAME}.css" + @$(RM) "/usr/share/${PKGNAME}/ui/ublinux-logo.svg" @$(RM) -d "/usr/share/${PKGNAME}/css" @$(RM) -d "/usr/share/${PKGNAME}/ui" @$(RM) -d "/usr/share/${PKGNAME}" diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 37d7c97..4060fbd 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -723,7 +723,18 @@ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ } } - +void on_about(GtkWidget *button){ + GtkBuilder *builder = gtk_builder_new_from_file(GladePath); + GtkWidget *AboutButtons = GTK_WIDGET(gtk_builder_get_object(builder,"AboutButtons")); + GtkWidget *About = GTK_WIDGET(gtk_builder_get_object(builder, "ublAbloutWindow")); + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(About),_("Settings manager for UBLinux")); + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(About),_("UBLinux Settings Manager")); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(About),version_application); + gtk_widget_show(About); + gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(About),_("Project Home Page")); + // gtk_label_set_text(GTK_LABEL(HeaderAboutTopic),_("About UBLinux Settings Manager")); + gtk_widget_set_visible(AboutButtons,0); +} int launch(thread_output *thread){ int a=0; @@ -1144,10 +1155,6 @@ void yon_set_default_sections(dictionary **section){ *section=(*section)->first; } -void yon_check_for_space_near_eol(){ - -} - IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ IVGraphicals *IVG = malloc(sizeof(IVGraphicals)); GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); @@ -1658,7 +1665,7 @@ 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(GTK_WINDOW(curWidgets->window),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); gtk_window_set_icon(GTK_WINDOW(curWidgets->SectionSettingsWindow),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(32),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); - g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_ButtonOpenHelp_activated), curWidgets->builder); + g_signal_connect(G_OBJECT(curWidgets->MenuItemDocumentation), "activate", G_CALLBACK(on_about), curWidgets->builder); //on_ButtonOpenHelp_activated g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets); if (gnld==0){ diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index d10ecef..65ee9a7 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -18,7 +18,8 @@ #define LocaleName "ubl-settings-manager" #define ubl_settings_infoPath "ubl-settings-info" #define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id=" -char *version_application = "1.3"; +typedef char* string; +string version_application = "1.1"; typedef struct apps{ char *Name; diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index 43378f6..df36fbb 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -1281,6 +1281,7 @@ True False + 10 immediate natural @@ -1948,6 +1949,47 @@ + + False + About + False + True + center + ubl-settings-manager + dialog + True + UBLinux Settings Manager + 1.6 + Copyright © 2022 - 2023 - UBSoft Software LLC + Settings manager for UBLinux + https://ublinux.ru/ + Project Home Page + UBGroup + UBGroup + ubl-settings-manager + gpl-2-0 + + + False + vertical + 2 + + + False + end + + + False + False + 0 + + + + + + + + False diff --git a/ubl-settings-manager_ru.po b/ubl-settings-manager_ru.po index 6573cf3..f3c3921 100644 --- a/ubl-settings-manager_ru.po +++ b/ubl-settings-manager_ru.po @@ -6,88 +6,93 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: 1.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-09 16:45+0600\n" +"POT-Creation-Date: 2023-03-13 10:24+0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ubl-settings-manager.c:1338 -msgid "Back to all settings" -msgstr "Назад ко всем настройкам" +#: source/ubl-settings-manager.c:730 +msgid "Settings manager for UBLinux" +msgstr "Менеджер настроек для UBLinux" -#: ubl-settings-manager.c:1418 +#: source/ubl-settings-manager.c:731 source/ubl-settings-manager.c:1615 +#: source/ubl-settings-manager.c:1630 source/ubl-settings-manager.c:1685 msgid "UBLinux Settings Manager" msgstr "Настройки UBLinux" -#: ubl-settings-manager.c:1419 +#: source/ubl-settings-manager.c:733 +msgid "Project Home Page" +msgstr "Домашняя станица проекта" + +#: source/ubl-settings-manager.c:1614 +msgid "Back to all settings" +msgstr "Назад ко всем настройкам" + +#: source/ubl-settings-manager.c:1686 msgid "Icon size" msgstr "Размер иконок" -#: ubl-settings-manager.c:1420 +#: source/ubl-settings-manager.c:1687 msgid "Window theme" msgstr "Выбор темы" -#: ubl-settings-manager.c:1421 +#: source/ubl-settings-manager.c:1688 msgid "Would you like to read documentation in the Web?" msgstr "Вы хотите прочитать руководство в сети?" -#: ubl-settings-manager.c:1422 +#: source/ubl-settings-manager.c:1689 msgid "" "You will be redirected to documentation site, where user help pages are " "translated and supported by community." msgstr "Вы будете перенаправлены на сайт с документацией, где страницы помощи переводятся и поддерживаются сообществом." -#: ubl-settings-manager.c:1423 +#: source/ubl-settings-manager.c:1690 msgid "Read online" msgstr "Прочитать онлайн" -#: ubl-settings-manager.c:1424 +#: source/ubl-settings-manager.c:1691 msgid "Cancel" msgstr "Отменить" -#: ubl-settings-manager.c:1425 +#: source/ubl-settings-manager.c:1692 msgid "Close" msgstr "Закрыть" -#: ubl-settings-manager.c:1426 +#: source/ubl-settings-manager.c:1693 msgid "Save and apply" msgstr "Сохранить и применить" -#: ubl-settings-manager.c:1427 +#: source/ubl-settings-manager.c:1694 msgid "Always redirect" msgstr "Всегда перенаправлять" -#: ubl-settings-manager.c:1428 +#: source/ubl-settings-manager.c:1695 msgid "Settings" msgstr "Настройки" -#: ubl-settings-manager.c:1429 +#: source/ubl-settings-manager.c:1696 msgid "About..." msgstr "О программе" -#: ubl-settings-manager.c:1430 +#: source/ubl-settings-manager.c:1697 msgid "About system" msgstr "О системе" -#: ubl-settings-manager.c:1431 +#: source/ubl-settings-manager.c:1698 msgid "Understood" msgstr "Понятно" -#: ubl-settings-manager.c:1432 -msgid "Section management" -msgstr "Точная настройка" - -#: ubl-settings-manager.c:1508 +#: source/ubl-settings-manager.c:1782 msgid "Standard theme" -msgstr "Основная тема" +msgstr "Стандартная тема" -#: ubl-settings-manager.c:1509 +#: source/ubl-settings-manager.c:1783 msgid "GNOME theme" msgstr "GNOME тема" From 5d5da291fc6b29f4c5483f459c3b83f07aa794ab Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Mar 2023 11:35:31 +0600 Subject: [PATCH 24/36] .h fix --- source/ubl-settings-manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 65ee9a7..7c471db 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -19,7 +19,7 @@ #define ubl_settings_infoPath "ubl-settings-info" #define ubl_settings_infoPathLaunch "ubl-settings-info --socket-id=" typedef char* string; -string version_application = "1.1"; +string version_application = ; typedef struct apps{ char *Name; From b9a073e4d7ed183ca2c9568e08d86e6fc7bf5b35 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Mar 2023 11:58:35 +0600 Subject: [PATCH 25/36] Removal of version variable value after building --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cc5f38d..e77531a 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,13 @@ clean: echo "Clean: error, compile directory exist ${CMAKE_BUILD_DIR}"; \ else \ echo "Clean: OK"; \ - fi + fi; \ + version="$$(cat VERSION.md)"; \ + version=$${version:8}; \ + search="s/string version_application.*"; \ + echo $$search; \ + replace="string version_application = ;"; \ + sed -i -e "$$search/$$replace/gi" source/ubl-settings-manager.h; \ help: @echo "The following are some of the valid targets for this Makefile:" From 6f4598984b137084f5720584f35ba49f5e2bbb97 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 13 Mar 2023 16:41:42 +0600 Subject: [PATCH 26/36] Fixed fullscreen being activated when app wasn't closed at fullscreen; fixed crash while trying to load Manager with 3 or more categories --- source/ubl-settings-manager.c | 11 ++++++++--- ubl-settings-manager.css | 1 + ubl-settings-manager.glade | 10 +++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 4060fbd..70eb714 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -948,7 +948,8 @@ int check_categories(apps app, char *catstocheck){ if (!found) return 0; n_found++; while (cat){ - char *fcat=strstr(app.Categories,";"); + left_cats=cat+1; + char *fcat=app.Categories;//strstr(app.Categories,";"); cat=strstr(cat+1,";"); if (!cat) break; find_it=yon_cut(left_cats,(strlen(left_cats)-strlen(cat)),0); @@ -957,7 +958,7 @@ int check_categories(apps app, char *catstocheck){ if (!found) break; n_found++; left_cats=cat+1; - if (strlen(left_cats)==0 ||strcmp(left_cats,'\0')==0) break; + if (strlen(left_cats)==0 ||strcmp(left_cats,"")==0) break; } if (to_find==n_found) return 1; else return 0; } @@ -998,6 +999,7 @@ int setup_config(){ main_config.GnomelabelSize=g_key_file_get_integer(configfile,"window","GnomeLabelSize",NULL); main_config.labelDensity=g_key_file_get_integer(configfile,"window","LabelDensity",NULL); main_config.lastUser=g_key_file_get_string(configfile,"window","User",NULL); + main_config.fullscreen=g_key_file_get_boolean(configfile,"window","fullscreen",NULL); if (main_config.MainlabelSize==0) main_config.MainlabelSize=12; if (main_config.labelDensity==0) main_config.labelDensity=0; main_config.MainlabelSize=main_config.MainlabelSize*1000; @@ -1076,6 +1078,7 @@ void save_config(actionWidgets *widgets){ sprintf(fromint,"%d",main_config.windowHeight); g_key_file_set_string(gfile,"window","WindowHeight",fromint); } + g_key_file_set_boolean(gfile,"window","fullscreen",main_config.fullscreen); sprintf(fromint,"%d",main_config.WindowTheme); g_key_file_set_string(gfile,"window","WindowTheme",fromint); sprintf(fromint,"%d",sz); @@ -1187,6 +1190,7 @@ IVGraphicals *yon_create_single_section_IV(char *name,char *cats){ gtk_icon_view_set_item_padding(GTK_ICON_VIEW(iv),3); //gtk_widget_set_name(iv,"workingbg"); gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(iv),GTK_ORIENTATION_HORIZONTAL); + gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(iv),2); } gtk_icon_view_set_text_column(GTK_ICON_VIEW(iv),0); GtkWidget *sep=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); @@ -1783,7 +1787,8 @@ int main(int argc, char *argv[]){ 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")); widg=(actionWidgets*)widgets->data; - gtk_window_maximize(GTK_WINDOW(widg->window)); + if (main_config.fullscreen==1) + gtk_window_maximize(GTK_WINDOW(widg->window)); gtk_widget_show(widg->window); hide_if_unfound(widgets); if (main_config.WindowTheme==1) diff --git a/ubl-settings-manager.css b/ubl-settings-manager.css index 79a5aa8..640ab40 100644 --- a/ubl-settings-manager.css +++ b/ubl-settings-manager.css @@ -4,6 +4,7 @@ background-color: #404040; #GnomeIcon{ + border-radius: 0px; border-style:solid; border-bottom-width: 1px; border-image: linear-gradient(90deg, alpha(@theme_text_color,0.4) 55%, alpha(@theme_bg_color, 0) 100%); diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index df36fbb..a657914 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -905,7 +905,8 @@ True False - gtk-undelete + 16 + software-remove-symbolic True @@ -956,6 +957,7 @@ True False + 16 object-select-symbolic @@ -1469,10 +1471,8 @@ True False False - False center center - 10 10 image5 @@ -1587,7 +1587,7 @@ horizontal liststoreTemplate 135 - 2 + 0 2 5 True @@ -2026,7 +2026,7 @@ False start 10 - 10 + 15 20 20 Looks like you don't have ubl-settings-info installed on your PC From 2459a1f5f3bd6aacaec7dca83391f46ab5e050f4 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 14 Mar 2023 11:49:11 +0600 Subject: [PATCH 27/36] Returnal of sections management button, removal of 'About System' menu button --- source/ubl-settings-manager.c | 38 +++++++++++++---------------- source/ubl-settings-manager.h | 5 ++-- ubl-settings-manager.glade | 45 +++++++++++++++-------------------- ubl-settings-manager_ru.po | 8 +++++++ 4 files changed, 47 insertions(+), 49 deletions(-) diff --git a/source/ubl-settings-manager.c b/source/ubl-settings-manager.c index 70eb714..221c220 100644 --- a/source/ubl-settings-manager.c +++ b/source/ubl-settings-manager.c @@ -122,7 +122,6 @@ void on_gnome_Item_activated(GtkIconView* self, GtkTreePath* path, actionWidgets } } else { - on_about_system(NULL,applist); launch_app(tempapp[0].Exec); gtk_widget_destroy(applist->socketbutton); } @@ -275,8 +274,8 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi int position=gtk_paned_get_position(GTK_PANED(widgets->GnomePaned)); if (position<200) {position=200; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),200);} main_config.iconSegmentSize=position; - if (position <70) {position=70;} - double pos=((double)position); + // if (position <70) {position=70;} + double pos=((double)position-35); if (pos<70) pos=70; for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ IVGraphicals *IV=(IVGraphicals*)dict->data; @@ -304,7 +303,7 @@ int on_settingsOpen(GtkWidget *button, actionWidgets *widgets){ gtk_label_set_text(GTK_LABEL(widgets->settingsSizeInfoLabel),tmp); gtk_image_set_from_pixbuf(GTK_IMAGE(widgets->settingsIcon),gtk_icon_info_load_icon(gtk_icon_theme_lookup_icon_for_scale(icthm, AppIconPath,yon_get_icon_size(*main_config.currentThemeIconSize),1,GTK_ICON_LOOKUP_FORCE_SVG),NULL)); - gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); + gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); }; int on_settings_icon_size_changed(GtkWidget* self, actionWidgets *widgets){ @@ -368,7 +367,7 @@ void on_section_settings_open(GtkButton* self,dictionary *cWidgets){ dict=dict->prev; dict->next=NULL; } - gtk_widget_show(widgets->SectionSettingsWindow); + gtk_window_present(GTK_WINDOW(widgets->SectionSettingsWindow)); } void on_sections_edit(GtkWidget *button, actionWidgets *widgets){ @@ -672,18 +671,7 @@ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ } } -void on_about_system(GtkWidget *button, actionWidgets *widgets){ - char arg[100]; - memset(arg,0,100); - gtk_widget_show(widgets->socketbuttonplace); - if (button){ - gtk_widget_hide(widgets->appSettings); - sprintf(arg,"--socket-id=%d --socket-ext-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket)),gtk_socket_get_id(GTK_SOCKET(widgets->socketbutton))); - }else{ - sprintf(arg,"--socket-id=%d",gtk_socket_get_id(GTK_SOCKET(widgets->socket))); - } - launch_app_with_arguments("ubl-settings-info",arg); -} + void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){ int *icsize; @@ -1614,7 +1602,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)); - g_signal_connect(G_OBJECT(curWidgets->MenuItemAboutSystem), "activate", 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 all settings")); gtk_window_set_title(GTK_WINDOW(curWidgets->window),_("UBLinux Settings Manager")); @@ -1625,7 +1613,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them } g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); if (strcmp(theme_id,"Gnome")==0){ - on_about_system(NULL,curWidgets); + // on_about_system(NULL,curWidgets); g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets); } @@ -1653,6 +1641,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->settingsCancel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsCancel")); curWidgets->settingsSubmenuLabelSize=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSubmenuLabelSize")); curWidgets->settingsSubmenuLabelTheme=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSubmenuLabelTheme")); + curWidgets->settingsSectionsSettingsButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsSectionsSettingsButton")); curWidgets->SectionSettingAddButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddButton")); curWidgets->SectionSettingAddNameEntry=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddNameEntry")); curWidgets->SectionSettingAddCategoriesEntry=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"SectionSettingsAddCategoriesEntry")); @@ -1662,6 +1651,8 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them curWidgets->CautionWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionWindow")); curWidgets->CautionUnderstandButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"CautionUnderstandButton")); curWidgets->infoWarningWindow=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"windowSettings-infoWarning")); + curWidgets->infoWarningButton=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"buttonSettings-infoWarning")); + curWidgets->infoWarningLabel=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"labelSettings-infoWarning")); curWidgets->applist=applist; curWidgets->appssize=appsize; GtkIconTheme *icthm=gtk_icon_theme_get_default(); @@ -1685,9 +1676,12 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them g_signal_connect(G_OBJECT(curWidgets->SectionSettingsCloseButton), "clicked", G_CALLBACK(on_sections_close), curWidgets); g_signal_connect(G_OBJECT(curWidgets->SectionSettingsSaveButton), "clicked", G_CALLBACK(on_sections_save), curWidgets); g_signal_connect(G_OBJECT(curWidgets->CautionUnderstandButton), "clicked", G_CALLBACK(on_caution_understand), curWidgets); + // g_signal_connect(G_OBJECT(curWidgets->infoWarningButton), "clicked", G_CALLBACK(on_info_warning_closed), curWidgets); + g_signal_connect(G_OBJECT(curWidgets->settingsSectionsSettingsButton), "clicked", G_CALLBACK(on_section_settings_open), widgets); } g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(yon_main_quit), curWidgets); gtk_label_set_text(GTK_LABEL(curWidgets->LabelTitle),_("UBLinux Settings Manager")); + // gtk_label_set_text(GTK_LABEL(curWidgets->infoWarningLabel),_("Looks like you don't have ubl-settings-info installed on your PC.")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelTheme),_("Window theme")); gtk_label_set_text(GTK_LABEL(curWidgets->helpHeader),_("Would you like to read documentation in the Web?")); @@ -1699,8 +1693,9 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_button_set_label(GTK_BUTTON(curWidgets->AlwaysOpenDocumentation),_("Always redirect")); 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_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),_("Sections management")); return widgets; } @@ -1712,7 +1707,8 @@ int main(int argc, char *argv[]){ } local=setlocale(LC_ALL, ""); textdomain (LocaleName); - actionWidgets *widget=malloc(sizeof(actionWidgets)); + actionWidgets *widget=NULL; + widget=malloc(sizeof(actionWidgets)); dictionary *widgets=yon_dictionary_create_empty(); widgets->data=widget; int *size=malloc(sizeof(int)); diff --git a/source/ubl-settings-manager.h b/source/ubl-settings-manager.h index 7c471db..df806b5 100644 --- a/source/ubl-settings-manager.h +++ b/source/ubl-settings-manager.h @@ -136,7 +136,7 @@ typedef struct { GtkWidget *GnomePaned; GtkWidget *GnomeInfoLabel; GtkWidget *workingwindow; - // GtkWidget *settingsSectionsSettingsButton; + GtkWidget *settingsSectionsSettingsButton; GtkWidget *SectionSettingsWindow; GtkWidget *SectionSettingsPack; dictionary *SettingsSections; @@ -158,6 +158,8 @@ typedef struct { apps *applist; GtkWidget *icvpack; GtkWidget *infoWarningWindow; + GtkWidget *infoWarningButton; + GtkWidget *infoWarningLabel; } actionWidgets; @@ -215,7 +217,6 @@ void yon_dictionary_make_first(dictionary *dict); dictionary *yon_create_icon_section_list(dictionary *sections); int yon_show_icon_views(dictionary *IVS,actionWidgets *widgets); void yon_icon_size_convert(int mode); -void on_about_system(GtkWidget *button, actionWidgets *widgets); char *yon_char_new(char *chr); int launch(thread_output *thread); float yon_time_average(dictionary *times); diff --git a/ubl-settings-manager.glade b/ubl-settings-manager.glade index a657914..16761af 100644 --- a/ubl-settings-manager.glade +++ b/ubl-settings-manager.glade @@ -123,17 +123,6 @@ - - - True - False - About system - True - - - @@ -353,17 +342,6 @@ - - - True - False - About system - True - - - @@ -563,6 +541,23 @@ 1 + + + button + True + True + True + 5 + 5 + 5 + 5 + + + False + True + 2 + + True @@ -674,7 +669,6 @@ True False center - ubl-settings-manager-banner 3