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.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 9102a00..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,15 +702,9 @@ - - True - False - emblem-danger - True False @@ -745,7 +753,7 @@ 5 5 2 - 0 + 0.019999999552965164 in @@ -823,6 +831,8 @@ True False + 5 + 5 Icons size @@ -841,7 +851,7 @@ 5 2 5 - 0 + 0.019999999552965164 in @@ -878,6 +888,8 @@ True False + 5 + 5 Choose theme @@ -898,6 +910,9 @@ False 5 5 + 3 + 30 + True Close @@ -925,7 +940,6 @@ False True - end 1 @@ -1367,7 +1381,7 @@ 5 5 5 - 0 + 0.019999999552965164 in