X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/de8ea90ca78ccfb26dd501dc3bc089fb24ad9094..c4ffe88c9fafaed4b66a010a25b117427ba709f6:/src/dolphinnavigatorswidgetaction.h diff --git a/src/dolphinnavigatorswidgetaction.h b/src/dolphinnavigatorswidgetaction.h index 6f5f8e7af..c9ce4ece2 100644 --- a/src/dolphinnavigatorswidgetaction.h +++ b/src/dolphinnavigatorswidgetaction.h @@ -1,6 +1,6 @@ /* This file is part of the KDE project - SPDX-FileCopyrightText: 2020 Felix Ernst + SPDX-FileCopyrightText: 2020 Felix Ernst SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ @@ -57,7 +57,7 @@ public: * 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 + * - A switch to a tab that is already in split view mode is occurring */ void createSecondaryUrlNavigator(); @@ -65,8 +65,7 @@ public: * Notify this widget of changes in geometry of the ViewContainers it tries to be * aligned with. */ - void followViewContainersGeometry(QWidget *primaryViewContainer, - QWidget *secondaryViewContainer = nullptr); + void followViewContainersGeometry(QWidget *primaryViewContainer, QWidget *secondaryViewContainer = nullptr); bool isInToolbar() const; @@ -86,13 +85,20 @@ public: */ void setSecondaryNavigatorVisible(bool visible); + /** + * Sets the background cosmetic of the location bar(s) visible or hidden. + * In frameless designs it's better to hide the background. + * @param enabled True for showing background cosmetic, false for hiding it. + */ + void setBackgroundEnabled(bool enabled); + protected: /** * There should always ever be one navigatorsWidget for this action so * this method always returns the same widget and reparents it. * You normally don't have to use this method directly because * QWidgetAction::requestWidget() is used to obtain the navigatorsWidget - * and to steal it from whereever it was prior. + * and to steal it from wherever it was prior. * @param parent the new parent of the navigatorsWidget. */ QWidget *createWidget(QWidget *parent) override; @@ -104,10 +110,7 @@ private: /** * In Left-to-right languages the Primary side will be the left one. */ - enum Side { - Primary, - Secondary - }; + enum Side { Primary, Secondary }; /** * Used to create the navigatorWidgets for both sides of the QSplitter. */ @@ -142,10 +145,7 @@ private: */ QPushButton *newNetworkFolderButton(const DolphinUrlNavigator *urlNavigator, QWidget *parent) const; - enum Position { - Leading, - Trailing - }; + enum Position { Leading, Trailing }; /** * Used to retrieve both the leading and trailing spacing for the navigatorWidgets * on both sides. A secondary leading spacing does not exist. @@ -191,8 +191,7 @@ private: /** * Sets the ViewContainers whose geometry is obtained when viewGeometries() is called. */ - void setViewContainers(QWidget *primaryViewContainer, - QWidget *secondaryViewContainer = nullptr); + void setViewContainers(QWidget *primaryViewContainer, QWidget *secondaryViewContainer = nullptr); struct Geometries { int globalXOfNavigatorsWidget; @@ -216,6 +215,12 @@ private: }; ViewGeometriesHelper m_viewGeometriesHelper; + + /** + * Used to check if the window has been resized. + * @see ViewGeometriesHelper::eventFilter() for why this is needed. + */ + int m_previousWindowWidth = -1; }; #endif // DOLPHINNAVIGATORSWIDGETACTION_H