┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinnavigatorswidgetaction.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2020-11-05 23:30:07 +0100
committerElvis Angelaccio <[email protected]>2020-11-09 23:49:07 +0100
commit2d4d2ce9a14902ee5a2b236f8510596fc2f86b99 (patch)
tree07607a2561e3f6e268e4e883f422582bdc908013 /src/dolphinnavigatorswidgetaction.h
parent42023831374496c62708ce7ad2cdd69104a1c820 (diff)
Adress most of the second round of Angelaccio's review comments
This commit applies most suggestions which were made on the MR. Most notably the DolphinUrlNavigator class is split up which leads to the creation of a DolphinUrlNavigatorsController class. Additionally some minor coding style and const correctness changes are included. The error value of cached integers is changed from -1 to INT_MIN because situations could come up in which -1 would be a valid value.
Diffstat (limited to 'src/dolphinnavigatorswidgetaction.h')
-rw-r--r--src/dolphinnavigatorswidgetaction.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/dolphinnavigatorswidgetaction.h b/src/dolphinnavigatorswidgetaction.h
index 8046ce2dc..f343e6a1c 100644
--- a/src/dolphinnavigatorswidgetaction.h
+++ b/src/dolphinnavigatorswidgetaction.h
@@ -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);
@@ -95,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
@@ -104,6 +96,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.
*/
QWidget *createNavigatorWidget(Side side) const;
@@ -134,6 +133,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.
*/
std::unique_ptr<QSplitter> m_splitter;