[chronojump] (Un)maximize app1 is changed at start, not after user closing preferences



commit a7ba14a6fc2358dfca28578e277b3df682b3e99c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 23 18:27:12 2018 +0100

    (Un)maximize app1 is changed at start, not after user closing preferences

 glade/preferences_win.glade |    2 +-
 src/gui/networks.cs         |   23 +++++++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index f99dc70..fe9a4ec 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -48,7 +48,7 @@
                             <property name="spacing">10</property>
                             <child>
                               <widget class="GtkCheckButton" id="check_appearance_maximized">
-                                <property name="label" translatable="yes">Maximized</property>
+                                <property name="label" translatable="yes">Start Chronojump 
maximized</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index d871206..8340ce3 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -100,6 +100,8 @@ public partial class ChronoJumpWindow
        DialogPersonPopup dialogPersonPopup;
                
        Config configChronojump;
+       bool maximizeWindowAtStartDone = false;
+
        private void configInitRead()
        {
                configChronojump.Read();
@@ -243,15 +245,20 @@ public partial class ChronoJumpWindow
                 * But note this has to be executed only if it has changed!!
                 */
 
-               if(configChronojump.Maximized == Preferences.MaximizedTypes.NO)
+               //only change maximizez status on start
+               if( ! maximizeWindowAtStartDone )
                {
-                       app1.Unmaximize();
-                       app1.Decorated = true;
-                       button_start_quit.Visible = false;
-               } else {
-                       app1.Decorated = (configChronojump.Maximized != 
Preferences.MaximizedTypes.YESUNDECORATED);
-                       app1.Maximize();
-                       button_start_quit.Visible = ! app1.Decorated;
+                       if(configChronojump.Maximized == Preferences.MaximizedTypes.NO)
+                       {
+                               app1.Unmaximize();
+                               app1.Decorated = true;
+                               button_start_quit.Visible = false;
+                       } else {
+                               app1.Decorated = (configChronojump.Maximized != 
Preferences.MaximizedTypes.YESUNDECORATED);
+                               app1.Maximize();
+                               button_start_quit.Visible = ! app1.Decorated;
+                       }
+                       maximizeWindowAtStartDone = true;
                }
 
                if(configChronojump.CustomButtons)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]