OSDN Git Service

Added logic to remember if window was maximized, so it restores properly out of the...
authorRandy Baumgarte <randy@fbn.cx>
Wed, 29 Sep 2010 11:06:21 +0000 (07:06 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Fri, 1 Oct 2010 16:43:56 +0000 (12:43 -0400)
src/cx/fbn/nevernote/NeverNote.java

index 0a09fcc..983f644 100644 (file)
@@ -288,6 +288,7 @@ public class NeverNote extends QMainWindow{
     boolean                            decryptOnShutdown;                      // should I decrypt on shutdown;
     String                             encryptCipher;                          // What cipher should I use?
     Signal0                    minimizeToTray;
     boolean                            decryptOnShutdown;                      // should I decrypt on shutdown;
     String                             encryptCipher;                          // What cipher should I use?
     Signal0                    minimizeToTray;
+    boolean                            windowMaximized = false;        // Keep track of the window state for restores
     
     String iconPath = new String("classpath:cx/fbn/nevernote/icons/");
        
     
     String iconPath = new String("classpath:cx/fbn/nevernote/icons/");
        
@@ -2178,6 +2179,10 @@ public class NeverNote extends QMainWindow{
                hide();
        } else {
                show();
                hide();
        } else {
                show();
+               if (windowMaximized)
+                       showMaximized();
+               else
+                       showNormal();
                raise();
        }
     }
                raise();
        }
     }
@@ -4911,6 +4916,10 @@ public class NeverNote extends QMainWindow{
                                QTimer.singleShot(200, this, "hide()");
                                return;
                        }
                                QTimer.singleShot(200, this, "hide()");
                                return;
                        }
+                       if (isMaximized())
+                               windowMaximized = true;
+                       else 
+                               windowMaximized = false;
                }
        }
        
                }
        }