]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Set initial size corectly
authorNate Graham <nate@kde.org>
Fri, 23 Apr 2021 00:06:06 +0000 (18:06 -0600)
committerMéven Car <meven29@gmail.com>
Wed, 5 May 2021 03:50:44 +0000 (03:50 +0000)
The resize() that we do to set the initial size is working around a
bug in frameworks that is going to be fixed soon. See
https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/53.

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index 80c6aa320ebc301b51fd65acb8a25bfede088cd4..e9c0c3813f5e5b55b7414381475e2b9f624844c2 100644 (file)
@@ -178,8 +178,6 @@ DolphinMainWindow::DolphinMainWindow() :
 
     if (firstRun) {
         menuBar()->setVisible(false);
-        // Assure a proper default size if Dolphin runs the first time
-        resize(760, 550);
     }
 
     const bool showMenu = !menuBar()->isHidden();
@@ -2412,6 +2410,12 @@ bool DolphinMainWindow::eventFilter(QObject* obj, QEvent* event)
     return false;
 }
 
+// Set a sane initial window size
+QSize DolphinMainWindow::sizeHint() const
+{
+    return KXmlGuiWindow::sizeHint().expandedTo(QSize(760, 550));
+}
+
 void DolphinMainWindow::saveNewToolbarConfig()
 {
     KXmlGuiWindow::saveNewToolbarConfig(); // Applies the new config. This has to be called first
index 40101852bab369f9ace27040ebab9fd5d12cbeb7..3c83b21789afd16b6722bc9f73e8145e1b2b6b29 100644 (file)
@@ -225,6 +225,9 @@ protected:
     /** Handles QWhatsThisClickedEvent and passes all others on. */
     bool eventFilter(QObject*, QEvent*) override;
 
+    /** Sets a sane initial window size **/
+    QSize sizeHint() const override;
+
 protected Q_SLOTS:
     /**
      * Calls the base method KXmlGuiWindow::saveNewToolbarConfig().