Auto changing theme removed, added button to hide banner

pull/36/head^2
parent 5630a07e73
commit 44d524b55a

@ -276,7 +276,7 @@ void on_paned_move(GtkPaned* self, GtkScrollType* scroll_type, actionWidgets *wi
if (position<200) {position=200; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),200);} if (position<200) {position=200; gtk_paned_set_position(GTK_PANED(widgets->GnomePaned),200);}
main_config.iconSegmentSize=position; main_config.iconSegmentSize=position;
double pos=((double)position-20); double pos=((double)position-20);
if (pos<70) pos=70; if (pos<50) pos=50;
for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){ for (dictionary *dict=widgets->ICSys;dict!=NULL;dict=dict->next){
IVGraphicals *IV=(IVGraphicals*)dict->data; IVGraphicals *IV=(IVGraphicals*)dict->data;
gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),pos); gtk_icon_view_set_item_width(GTK_ICON_VIEW(IV->IV),pos);
@ -546,35 +546,34 @@ void on_section_delete(GtkWidget *button, actionWidgets *widgets){
void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){ void on_resized (GtkWidget *window, GdkEventConfigure *event, dictionary *widgetsD){
actionWidgets *widgets=(actionWidgets*)widgetsD->data; actionWidgets *widgets=(actionWidgets*)widgetsD->data;
int x,y;
if (gtk_window_is_maximized(GTK_WINDOW(widgets->window))==0) if (gtk_window_is_maximized(GTK_WINDOW(widgets->window))==0)
main_config.fullscreen=0; main_config.fullscreen=0;
else else
main_config.fullscreen=1; main_config.fullscreen=1;
gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight);
if (main_config.WindowTheme==1){ // if (main_config.WindowTheme==1){
if (main_config.windowWidth<1240){ // if (main_config.windowWidth<1240){
if (stld==0){ // if (stld==0){
stld=1; // stld=1;
main_config.WindowTheme=0; // main_config.WindowTheme=0;
gtk_window_set_resizable(GTK_WINDOW(window),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_position(GTK_WINDOW(window),&main_config.windowPosX,&main_config.windowPosY);
gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight); // gtk_window_get_size(GTK_WINDOW(window),&main_config.windowWidth,&main_config.windowHeight);
yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main")); // yon_switch_theme(&widgetsD,yon_dictionary_find(&widgetsD,"Main"));
*main_config.currentThemeIconSize=24; // *main_config.currentThemeIconSize=24;
gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight); // gtk_window_resize(GTK_WINDOW(widgets->window),main_config.windowWidth,main_config.windowHeight);
gtk_widget_hide(widgets->window); // gtk_widget_hide(widgets->window);
} // }
}else { // }else {
yon_segments_hide(widgets); // yon_segments_hide(widgets);
yon_segments_show(widgets); // yon_segments_show(widgets);
if (stld==1){ // if (stld==1){
stld=0; // stld=0;
cmld=0; // cmld=0;
} // }
} // }
} // }
} }
void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){ void on_resized_done (GtkWidget *window, GdkEvent *event, dictionary *widgetsD){
@ -625,6 +624,20 @@ void on_theme_selection_changed(GtkWidget *self, actionWidgets *widgets){
} }
} }
void on_reveal_banner(GtkWidget *button, actionWidgets *widgets){
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->BannerRevealer))==1){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->BannerRevealer),0);
if (gtk_revealer_get_reveal_child(GTK_REVEALER(widgets->Revealer))==1){
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->Revealer),0);
gtk_menu_button_set_direction(GTK_MENU_BUTTON(widgets->BannerRevealer),GTK_ARROW_RIGHT);
}
else {
gtk_revealer_set_reveal_child(GTK_REVEALER(widgets->Revealer),1);
gtk_menu_button_set_direction(GTK_MENU_BUTTON(widgets->BannerRevealer),GTK_ARROW_LEFT);
}
}
}
void on_about(GtkWidget *button){ void on_about(GtkWidget *button){
GtkBuilder *builder = gtk_builder_new_from_file(GladePath); GtkBuilder *builder = gtk_builder_new_from_file(GladePath);
GtkWidget *AboutButtons = GTK_WIDGET(gtk_builder_get_object(builder,"AboutButtons")); GtkWidget *AboutButtons = GTK_WIDGET(gtk_builder_get_object(builder,"AboutButtons"));
@ -925,9 +938,9 @@ int setup_config(){
main_config.sections->next=NULL; main_config.sections->next=NULL;
} }
if (main_config.windowWidth<1024&&main_config.windowHeight<720){ // if (main_config.windowWidth<1024&&main_config.windowHeight<720){
main_config.WindowTheme=0; // main_config.WindowTheme=0;
} // }
return 1; return 1;
}; };
@ -1558,6 +1571,9 @@ dictionary *yon_dictionary_get_last(dictionary *dict){
} }
void yon_main_quit(actionWidgets *widgets){ void yon_main_quit(actionWidgets *widgets){
// GtkWindow *wnd=GTK_WINDOW(widgets->window);
// gtk_window_get_position(wnd,&main_config.windowPosX,&main_config.windowPosY);
// gtk_window_get_size(wnd,&main_config.windowWidth,&main_config.windowHeight);
save_config(widgets); save_config(widgets);
gtk_main_quit(); gtk_main_quit();
} }
@ -1590,6 +1606,8 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
curWidgets->MenuItemSettings=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemSettings"))); 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->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->MenuItemAboutSystem=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"MenuItemAboutSystem")));
curWidgets->BannerRevealer=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"RevealButton")));
curWidgets->Revealer=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,yon_char_get_augumented(theme_id,"Revealer")));
curWidgets->SettingsSections=main_config.SettingsSections; curWidgets->SettingsSections=main_config.SettingsSections;
if (main_config.lock_settings==1){ if (main_config.lock_settings==1){
gtk_widget_set_sensitive(curWidgets->MenuItemSettings,0); gtk_widget_set_sensitive(curWidgets->MenuItemSettings,0);
@ -1605,10 +1623,10 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
} }
g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets); g_signal_connect(G_OBJECT(curWidgets->window), "configure-event", G_CALLBACK(on_resized), widgets);
if (strcmp(theme_id,"Gnome")==0){ // if (strcmp(theme_id,"Gnome")==0){
g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets); // g_signal_connect(G_OBJECT(curWidgets->window), "event-after", G_CALLBACK(on_resized_done), widgets);
} // }
if (curWidgets->ButtonBackToMain!=NULL) if (curWidgets->ButtonBackToMain!=NULL)
g_signal_connect(G_OBJECT(curWidgets->ButtonBackToMain), "clicked", G_CALLBACK(on_backToSettingsButton_clicked), curWidgets); 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")); curWidgets->LabelTitle=GTK_WIDGET(gtk_builder_get_object(curWidgets->builder,"LabelTitle"));
@ -1654,6 +1672,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
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)); 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_about), curWidgets->builder); //on_ButtonOpenHelp_activated 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); g_signal_connect(G_OBJECT(curWidgets->MenuItemSettings), "activate", G_CALLBACK(on_settingsOpen), curWidgets);
g_signal_connect(G_OBJECT(curWidgets->BannerRevealer), "clicked", G_CALLBACK(on_reveal_banner), curWidgets);
if (gnld==0){ if (gnld==0){
gnld=1; gnld=1;
@ -1670,6 +1689,7 @@ dictionary *yon_theme_new(dictionary **widgetss, GtkBuilder *builder, char *them
g_signal_connect(G_OBJECT(curWidgets->CautionUnderstandButton), "clicked", G_CALLBACK(on_caution_understand), curWidgets); g_signal_connect(G_OBJECT(curWidgets->CautionUnderstandButton), "clicked", G_CALLBACK(on_caution_understand), curWidgets);
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);
} }
gtk_widget_hide_on_delete(curWidgets->window);
g_signal_connect(G_OBJECT(curWidgets->window), "destroy", G_CALLBACK(yon_main_quit), 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->LabelTitle),_("UBLinux Settings Manager"));
gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size")); gtk_label_set_text(GTK_LABEL(curWidgets->settingsSubmenuLabelSize),_("Icon size"));

@ -165,6 +165,8 @@ typedef struct {
GtkWidget *infoWarningWindow; GtkWidget *infoWarningWindow;
GtkWidget *infoWarningButton; GtkWidget *infoWarningButton;
GtkWidget *infoWarningLabel; GtkWidget *infoWarningLabel;
GtkWidget *BannerRevealer;
GtkWidget *Revealer;
} actionWidgets; } actionWidgets;

@ -2,6 +2,20 @@
background-color: #404040; background-color: #404040;
} }
.thin{
padding:0px;
margin:0px;
transition: 0ms ease-out;
}
.thin:active {
background-color: @theme_selected_bg_color;
transition: 10ms ease-out;
}
.transparent {
background:none;
border:none;
transition: 0ms ease-out;
}
#GnomeIcon{ #GnomeIcon{
border-style:solid; border-style:solid;

@ -364,6 +364,7 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkAction" id="action1"/>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property> <property name="lower">1</property>
<property name="upper">5</property> <property name="upper">5</property>
@ -642,7 +643,7 @@
<object class="GtkWindow" id="MainWindow"> <object class="GtkWindow" id="MainWindow">
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="default-width">800</property> <property name="default-width">800</property>
<property name="default-height">600</property> <property name="default-height">558</property>
<property name="icon-name">ubconfig-gui</property> <property name="icon-name">ubconfig-gui</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
@ -659,24 +660,72 @@
<object class="GtkBox" id="MainImageBackground"> <object class="GtkBox" id="MainImageBackground">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="orientation">vertical</property> <child>
<object class="GtkRevealer" id="MainRevealer">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="transition-type">slide-left</property>
<property name="reveal-child">True</property>
<child> <child>
<object class="GtkImage" id="MainBanner"> <object class="GtkImage" id="MainBanner">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">center</property> <property name="halign">start</property>
<property name="valign">start</property>
<property name="icon_size">3</property> <property name="icon_size">3</property>
<style> <style>
<class name="noborder"/> <class name="noborder"/>
<class name="img"/> <class name="img"/>
</style> </style>
</object> </object>
</child>
</object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuButton" id="MainRevealButton">
<property name="related-action">action1</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="direction">left</property>
<child>
<placeholder/>
</child>
<style>
<class name="thin"/>
<class name="transparent"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="transparent"/>
<class name="thin"/>
<class name="workingbg"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style> <style>
<class name="bannerbackground"/> <class name="bannerbackground"/>
</style> </style>
@ -696,9 +745,7 @@
<object class="GtkBox" id="MainHideWhileLaunch"> <object class="GtkBox" id="MainHideWhileLaunch">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="margin-left">5</property>
<property name="margin-right">5</property> <property name="margin-right">5</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property> <property name="margin-end">5</property>
<property name="margin-top">5</property> <property name="margin-top">5</property>
<property name="margin-bottom">5</property> <property name="margin-bottom">5</property>
@ -1211,7 +1258,7 @@
<object class="GtkWindow" id="GnomeWindow"> <object class="GtkWindow" id="GnomeWindow">
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="default-width">800</property> <property name="default-width">800</property>
<property name="default-height">600</property> <property name="default-height">558</property>
<property name="icon-name">ubconfig-gui</property> <property name="icon-name">ubconfig-gui</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
@ -1227,7 +1274,13 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="orientation">vertical</property> <child>
<object class="GtkRevealer" id="GnomeRevealer">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">start</property>
<property name="transition-type">slide-left</property>
<property name="reveal-child">True</property>
<child> <child>
<object class="GtkImage" id="GnomeBanner"> <object class="GtkImage" id="GnomeBanner">
<property name="visible">True</property> <property name="visible">True</property>
@ -1239,12 +1292,54 @@
<class name="img"/> <class name="img"/>
</style> </style>
</object> </object>
</child>
</object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuButton" id="GnomeRevealButton">
<property name="related-action">action1</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="use-underline">True</property>
<property name="direction">left</property>
<child>
<placeholder/>
</child>
<style>
<class name="thin"/>
<class name="transparent"/>
</style>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="transparent"/>
<class name="thin"/>
<class name="workingbg"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style> <style>
<class name="bannerbackground"/> <class name="bannerbackground"/>
</style> </style>
@ -1321,6 +1416,8 @@
<object class="GtkAlignment"> <object class="GtkAlignment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="left-padding">12</property> <property name="left-padding">12</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
@ -1332,26 +1429,8 @@
<object class="GtkImage" id="GnomeInfoLogo"> <object class="GtkImage" id="GnomeInfoLogo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="halign">end</property> <property name="halign">center</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="infobox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkLabel" id="GnomeInfoLabel">
<property name="name">desklabel</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="valign">center</property> <property name="valign">center</property>
<property name="justify">right</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -1360,17 +1439,7 @@
</packing> </packing>
</child> </child>
</object> </object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child> </child>
<style>
<class name="menubar"/>
</style>
</object> </object>
</child> </child>
<child type="label_item"> <child type="label_item">
@ -1697,7 +1766,7 @@
<object class="GtkWindow" id="LoaderWindow"> <object class="GtkWindow" id="LoaderWindow">
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="default-width">800</property> <property name="default-width">800</property>
<property name="default-height">600</property> <property name="default-height">558</property>
<property name="icon-name">ubconfig-gui</property> <property name="icon-name">ubconfig-gui</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">

Loading…
Cancel
Save