┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabpage.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2020-09-20 18:53:59 +0200
committerElvis Angelaccio <[email protected]>2020-11-09 23:49:07 +0100
commit37327c9b0aae112c5890703cba1f0157043007e0 (patch)
tree5cda9876f310a258b95226bc0d9681acc665f98e /src/dolphintabpage.h
parent6151a7aec0516570926cb1d15da48936e38e6765 (diff)
Make UrlNavigators in the toolbar the only option
The UrlNavigators will be automatically added to the toolbar. The Sort By action is removed from the default toolbar to make space. Remove all options to have UrlNavigators outside the toolbar and remove those code paths. Make it so the new NavigatorsWidgetAction contains two UrlNavigators when in split view mode. Spacing was also added to align these UrlNavigators with the ViewContainers when enough space is available. Force the toolbar to be either at the top or bottom of the window. Set a sane sizeHint for DolphinUrlNavigator. It would be better to do this in KUrlNavigator in the future. This commit also contains a changes which should be moved to a separate merge requests before this gets merged: - Add an expansion animation when split view is enabled by the user
Diffstat (limited to 'src/dolphintabpage.h')
-rw-r--r--src/dolphintabpage.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/dolphintabpage.h b/src/dolphintabpage.h
index 74344acd1..6a8801edd 100644
--- a/src/dolphintabpage.h
+++ b/src/dolphintabpage.h
@@ -11,8 +11,10 @@
#include <QUrl>
#include <QWidget>
-class QSplitter;
+class DolphinNavigatorsWidgetAction;
class DolphinViewContainer;
+class QSplitter;
+class QVariantAnimation;
class KFileItemList;
class DolphinTabPage : public QWidget
@@ -67,6 +69,30 @@ public:
int selectedItemsCount() const;
/**
+ * Connects a navigatorsWidget to this. It will be connected to the DolphinViewContainers
+ * managed by this tab. For alignment purposes this will from now on notify the
+ * navigatorsWidget when this tab or its viewContainers are resized.
+ */
+ void connectNavigators(DolphinNavigatorsWidgetAction *navigatorsWidget);
+
+ /**
+ * Makes it so this tab and its DolphinViewContainers aren't controlled by any
+ * UrlNavigators anymore.
+ */
+ void disconnectNavigators();
+
+ /**
+ * Calls resizeNavigators() when a watched object is resized.
+ */
+ bool eventFilter(QObject */* watched */, QEvent *event) override;
+
+ /**
+ * Notify the connected DolphinNavigatorsWidgetAction of geometry changes which it
+ * needs for visual alignment.
+ */
+ void resizeNavigators() const;
+
+ /**
* Marks the items indicated by \p urls to get selected after the
* directory DolphinView::url() has been loaded. Note that nothing
* gets selected if no loading of a directory has been triggered
@@ -81,14 +107,6 @@ public:
void markUrlAsCurrent(const QUrl& url);
/**
- * Sets the places selector visible, if \a visible is true.
- * The places selector allows to select the places provided
- * by the places model passed in the constructor. Per default
- * the places selector is visible.
- */
- void setPlacesSelectorVisible(bool visible);
-
- /**
* Refreshes the views of the main window by recreating them according to
* the given Dolphin settings.
*/
@@ -125,6 +143,7 @@ public:
signals:
void activeViewChanged(DolphinViewContainer* viewContainer);
void activeViewUrlChanged(const QUrl& url);
+ void splitterMoved(int pos, int index);
private slots:
/**
@@ -153,8 +172,10 @@ private:
private:
QSplitter* m_splitter;
+ QPointer<DolphinNavigatorsWidgetAction> m_navigatorsWidget;
QPointer<DolphinViewContainer> m_primaryViewContainer;
QPointer<DolphinViewContainer> m_secondaryViewContainer;
+ QPointer<QVariantAnimation> m_splitViewAnimation;
bool m_primaryViewActive;
bool m_splitViewEnabled;