From e4de62727299d87a96122ed7750b256b5a46c8ba Mon Sep 17 00:00:00 2001 From: Ivan Yartsev Date: Wed, 1 Feb 2023 09:14:41 +0600 Subject: [PATCH 1/5] revert 8bfdf69a9f202be710f8f58b36219f54c50b29fa revert Implemented system info resizing on small resolutions --- ubl-settings-manager.c | 83 +++++-------------------- ubl-settings-manager.h | 1 - ui/ubl-settings-manager.glade | 114 ++-------------------------------- 3 files changed, 20 insertions(+), 178 deletions(-) diff --git a/ubl-settings-manager.c b/ubl-settings-manager.c index 162aa6e..6112760 100644 --- a/ubl-settings-manager.c +++ b/ubl-settings-manager.c @@ -151,18 +151,13 @@ void on_ReadHelpButton_activated(GtkWidget *button, GtkBuilder *builder){ }; int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ - if (main_config.WindowTheme==0) - main_config.curThemeName="Main"; - else if (main_config.WindowTheme==1) - main_config.curThemeName="Gnome"; - dictionary *widgetsD=yon_dictionary_find(widgetsDs,main_config.curThemeName); + dictionary *widgetsD=*widgetsDs; printf("Saving config...\n"); actionWidgets *widgets=(actionWidgets*)widgetsD->data; int theme=gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->settingsThemeChooser)); - gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY); - gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight); + if (theme==0) main_config.curThemeName="Main"; else if (theme==1) @@ -175,13 +170,13 @@ int on_settings_accept(GtkWidget *button, dictionary **widgetsDs){ gtk_window_move(GTK_WINDOW(loaderWindow),main_config.windowPosX,main_config.windowPosY); gtk_widget_show(loaderWindow); + gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); // gtk_widget_hide(widgets->window); yon_switch_theme(widgetsDs,yon_dictionary_find(&widgetsD,main_config.curThemeName)); if (widgets!=(actionWidgets*)widgetsD->data) widgets=(actionWidgets*)widgetsD->data; // gtk_widget_show(widgets->window); gtk_widget_hide(loaderWindow); // main_config.WindowTheme=theme; - gtk_window_present(GTK_WINDOW(widgets->SettingsWindow)); } GKeyFile *gfile=g_key_file_new(); int sz; @@ -217,7 +212,6 @@ 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)); - main_config.iconSegmentSize=position; if (position <115) position=115; double pos=((double)position-(1/(double)position*4)*500)/1.8; if (pos<110) pos=110; @@ -553,51 +547,10 @@ 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; - gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); - if (main_config.windowWidth<1024){ - if (stld==0){ - stld=1; - char *details=gtk_label_get_label(GTK_LABEL(widgets->GnomeInfoDetailsLabel)); - //gtk_window_set_resizable(GTK_WINDOW(window),0); - // yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); - details[12]='0'; - details[13]='9'; - printf("SSSSS\n"); - gtk_label_set_markup(GTK_LABEL(widgets->GnomeInfoDetailsLabel),details); - GtkWidget *logo = gtk_builder_get_object(widgets->builder,"GnomeInfoLogo"); - gtk_image_set_from_pixbuf(GTK_IMAGE(logo),gdk_pixbuf_new_from_file_at_scale(LogoPath,256,256,1,NULL)); - // gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); - // gtk_widget_hide(widgets->window); - } - }else { - if (stld==1){ - stld=0; - char *details=gtk_label_get_label(GTK_LABEL(widgets->GnomeInfoDetailsLabel)); - details[12]='1'; - details[13]='2'; - printf("SSSSS\n"); - gtk_label_set_markup(GTK_LABEL(widgets->GnomeInfoDetailsLabel),details); - GtkWidget *logo = gtk_builder_get_object(widgets->builder,"GnomeInfoLogo"); - gtk_image_set_from_pixbuf(GTK_IMAGE(logo),gdk_pixbuf_new_from_file_at_scale(LogoPath,512,512,1,NULL)); - } - } - -} -void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ - actionWidgets *widgets=(actionWidgets*)widgetsD->data; - if (event->type==GDK_CONFIGURE){ - int x,y; - gtk_window_get_size(GTK_WINDOW(window),&x,&y); - if (x<1024&&y<720){ - gtk_window_set_resizable(GTK_WINDOW(window),1); - printf("AAAAA\n"); - // gtk_widget_hide(widgets->window); - } - } + gtk_window_get_size() + gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight); } - void launch_app_with_arguments(char *name, char *args){ char *path=malloc(strlen(name)+strlen(args)+4); memset(path,0,strlen(name)+strlen(args)+4); @@ -1171,13 +1124,16 @@ dictionary *yon_dictionary_find(dictionary **dict, char *key){ void yon_switch_theme(dictionary **dict, dictionary *newone){ dictionary *dct=*dict; actionWidgets *widgets=(actionWidgets*)dct->data; - gtk_widget_hide(widgets->window); + gtk_window_get_position(GTK_WINDOW(widgets->window),&main_config.windowPosX,&main_config.windowPosY); + gtk_window_get_size(GTK_WINDOW(widgets->window),&main_config.windowWidth,&main_config.windowHeight); *dict=newone; dct=*dict; widgets=(actionWidgets*)dct->data; 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); + gtk_window_maximize(GTK_WINDOW(widgets->window)); + gtk_widget_show(widgets->window); if (strcmp(dct->key,"Gnome")==0){ int x,y; GdkRectangle workarea; @@ -1187,18 +1143,14 @@ void yon_switch_theme(dictionary **dict, dictionary *newone){ dictionary *founddict=yon_dictionary_find(dict,"Main"); dct=yon_dictionary_find(dict,"Gnome"); yon_switch_theme(&dct,founddict); - 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); main_config.WindowTheme=0; main_config.curThemeName="Main"; gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->settingsThemeChooser),0); } else{ main_config.WindowTheme=1; main_config.curThemeName="Gnome"; - gtk_widget_show(widgets->window); } } else { - gtk_widget_show(widgets->window); main_config.WindowTheme=0; main_config.curThemeName="Main"; } @@ -1376,6 +1328,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_style_context_add_class(gtk_widget_get_style_context(curWidgets->icvpack),"iconview"); + gtk_window_maximize(GTK_WINDOW(curWidgets->window)); if (curWidgets->GnomeInfoLabel!=NULL&&curWidgets->GnomeInfoDetailsLabel!=NULL){ FILE *fp; char path[1035]; @@ -1407,7 +1360,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them line=yon_char_get_augumented(pth,line); } else { line=path; - pth="\n"; + pth="\n"; line=yon_char_get_augumented(pth,line); } prevline=yon_char_get_augumented(prevline,line); @@ -1424,20 +1377,15 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them gtk_button_set_label(GTK_BUTTON(curWidgets->ButtonBackToMain),_("Back to 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){ - g_signal_connect(G_OBJECT(curWidgets->GnomePaned), "notify::position", G_CALLBACK(on_paned_move), curWidgets); - - } - if (strcmp(theme_id,"Gnome")==0){ 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"); - + if (curWidgets->GnomePaned!=NULL){ + g_signal_connect(G_OBJECT(curWidgets->GnomePaned), "notify::position", G_CALLBACK(on_paned_move), curWidgets); + + } // Standard for all themes curWidgets->settingsThemeChooser=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"settingsThemeChooser")); @@ -1576,7 +1524,6 @@ 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_widget_show_all(widg->window); GtkCssProvider *css=gtk_css_provider_new(); diff --git a/ubl-settings-manager.h b/ubl-settings-manager.h index db726a0..ce98718 100644 --- a/ubl-settings-manager.h +++ b/ubl-settings-manager.h @@ -14,7 +14,6 @@ #define PictureFormatExtra ".svg" #define LocalePath "locale/" #define LocaleName "base" -#define LogoPath "images/ublinux-dark-glow-sc.svg" typedef struct apps{ diff --git a/ui/ubl-settings-manager.glade b/ui/ubl-settings-manager.glade index 0f0e842..8ca4371 100644 --- a/ui/ubl-settings-manager.glade +++ b/ui/ubl-settings-manager.glade @@ -249,110 +249,6 @@ - - False - - - True - False - vertical - - - True - False - - - True - False - 30 - 30 - gtk-dialog-warning - 6 - - - False - True - 0 - - - - - True - False - 5 - 5 - You are not allowed to change theme on such low resolution! - True - 0.019999999552965164 - - - True - True - 1 - - - - - True - True - 0 - - - - - Understood - True - True - True - - - False - True - 2 - - - - - - - True - False - UBLinux Settings Manager - - - True - False - gtk-dialog-warning - 5 - - - - - - - False - - - True - False - - - - - - True - False - label - - - False - True - 1 - - - - - 1 5 @@ -1034,7 +930,7 @@ True True - 52 + 152 True True @@ -1067,7 +963,7 @@ - False + True True @@ -1085,6 +981,7 @@ True False + 3 3 3 3 @@ -1104,7 +1001,7 @@ center center - False @@ -627,7 +627,7 @@ True False 32 - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager 5 @@ -800,7 +800,7 @@ True False 32 - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager 5 @@ -1202,7 +1202,7 @@ True False 32 - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager 5 @@ -1455,7 +1455,7 @@ True False 32 - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager 5 @@ -1885,7 +1885,7 @@ True False 32 - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager 5 @@ -1971,7 +1971,7 @@ Project Home Page UBGroup UBGroup - ru.ublinux.ubl-settings-manager + com.ublinux.ubl-settings-manager gpl-2-0 diff --git a/ubl-settings-manager.pot b/ubl-settings-manager.pot index 8681e7d..0f94860 100644 --- a/ubl-settings-manager.pot +++ b/ubl-settings-manager.pot @@ -1,20 +1,20 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Language translations for ubl-settings-manager package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-manager package. +# UBLinux Team , 2022 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-17 18:00+0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Project-Id-Version: ubl-settings-manager 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-01-01 00:00+0600\n" +"PO-Revision-Date: 2023-01-01 00:00+0600\n" +"Last-Translator: UBLinux Team \n" +"Language-Team: UBLinux Team \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: source/ubl-settings-manager.c:632 diff --git a/ubl-settings-manager_ru.po b/ubl-settings-manager_ru.po index 15e3a47..24c6e99 100644 --- a/ubl-settings-manager_ru.po +++ b/ubl-settings-manager_ru.po @@ -1,18 +1,18 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Russian translations for ubl-settings-manager package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubl-settings-manager package. +# UBLinux Team , 2022 # #, fuzzy -msgid "translateinfo\n" +msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-16 12:28+0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Project-Id-Version: ubl-settings-manager 1.0\n" +"Report-Msgid-Bugs-To: info@ublinux.com\n" +"POT-Creation-Date: 2023-01-01 00:00+0600\n" +"PO-Revision-Date: 2023-01-01 00:00+0600\n" +"Last-Translator: UBLinux Team \n" +"Language-Team: Russian - UBLinux Team \n" +"Language: Russian\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n"