]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinnavigatorswidgetaction.h
Adress most of the second round of Angelaccio's review comments
[dolphin.git] / src / dolphinnavigatorswidgetaction.h
index c1808d68e6a7ddd68d864a9f93d6ffcef0efae28..f343e6a1c23a1dc8dd32debf45b6d24d54be9417 100644 (file)
@@ -38,14 +38,6 @@ class DolphinNavigatorsWidgetAction : public QWidgetAction
 {
     Q_OBJECT
 
-    /**
-     * In Left-to-right languages the Primary side will be the left one.
-     */
-    enum Side {
-        Primary,
-        Secondary
-    };
-
 public:
     DolphinNavigatorsWidgetAction(QWidget *parent = nullptr);
 
@@ -57,7 +49,13 @@ public:
     bool addToToolbarAndSave(KXmlGuiWindow *mainWindow);
 
     /**
-     * Different to the primary UrlNavigator, the secondary UrlNavigator is only created on-demand.
+     * The secondary UrlNavigator is only created on-demand. Such an action is not necessary
+     * for the primary UrlNavigator which is created preemptively.
+     *
+     * This method should preferably only be called when:
+     * - Split view is activated in the active tab
+     * OR
+     * - A switch to a tab that is already in split view mode is occuring
      */
     void createSecondaryUrlNavigator();
 
@@ -89,7 +87,7 @@ public:
      */
     void setSecondaryNavigatorVisible(bool visible);
 
-protected:
+private:
     /**
      * Adjusts the width of the spacings used to align the UrlNavigators with ViewContainers.
      * This can only work nicely if up-to-date geometry of ViewContainers is cached so
@@ -97,6 +95,13 @@ protected:
      */
     void adjustSpacing();
 
+    /**
+     * In Left-to-right languages the Primary side will be the left one.
+     */
+    enum Side {
+        Primary,
+        Secondary
+    };
     /**
      * Used to create the navigatorWidgets for both sides of the QSplitter.
      */
@@ -127,6 +132,11 @@ protected:
      */
     QWidget *spacing(Side side, Position position) const;
 
+    /**
+     * Sets this action's text depending on the amount of visible UrlNavigators.
+     */
+    void updateText();
+
     /**
      * The defaultWidget() of this QWidgetAction.
      */