┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmode/bottombar.h
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2022-04-25 12:52:05 +0200
committerFelix Ernst <[email protected]>2022-08-14 14:42:40 +0000
commit78cffd2979a6ed87e044fcb024cf4fdfc5c7cb3d (patch)
tree7e5b66a5b4fc8c3328949d80898be2d1d57da5b7 /src/selectionmode/bottombar.h
parent8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576 (diff)
Improve code quality
Diffstat (limited to 'src/selectionmode/bottombar.h')
-rw-r--r--src/selectionmode/bottombar.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/selectionmode/bottombar.h b/src/selectionmode/bottombar.h
index ff23b6699..ab29a85a5 100644
--- a/src/selectionmode/bottombar.h
+++ b/src/selectionmode/bottombar.h
@@ -15,8 +15,6 @@
#include <QPropertyAnimation>
#include <QWidget>
-#include <memory>
-
class KActionCollection;
class KFileItemList;
class QAction;
@@ -30,7 +28,7 @@ namespace SelectionMode
class BottomBarContentsContainer;
/**
- * A bar used in selection mode that serves various purposes depending on what the user is currently trying to do.
+ * @brief A bar used in selection mode that serves various purposes depending on what the user is currently trying to do.
*
* The Contents enum below gives a rough idea about the different states this bar might have.
* The bar is notified of various changes that make changing or updating the content worthwhile.
@@ -43,7 +41,7 @@ class BottomBar : public QWidget
public:
/** The different contents this bar can have. */
- enum Contents{
+ enum Contents {
CopyContents,
CopyLocationContents,
CopyToOtherViewContents,
@@ -69,11 +67,20 @@ public:
*
* This bar might also not show itself when setVisible(true), when context menu actions are supposed to be shown
* for the selected items but no items have been selected yet. In that case it will only show itself once items were selected.
+ *
+ * This bar might also ignore a setVisible(false) call, if it has PasteContents because that bar is supposed to stay visible
+ * even outside of selection mode.
+ *
+ * @param visible Whether this bar is supposed to be visible long term
+ * @param animated Whether this should be animated. The animation is skipped if the users' settings are configured that way.
+ *
* @see QWidget::setVisible()
*/
void setVisible(bool visible, Animated animated);
- using QWidget::setVisible; // Makes sure that the setVisible() declaration above doesn't hide the one from QWidget.
+ /**
+ * Changes the contents of the bar to @p contents.
+ */
void resetContents(Contents contents);
Contents contents() const;
@@ -81,6 +88,7 @@ public:
QSize sizeHint() const override;
public Q_SLOTS:
+ /** Adapts the contents based on the selection in the related view. */
void slotSelectionChanged(const KFileItemList &selection, const QUrl &baseUrl);
/** Used to notify the m_selectionModeBottomBar that there is no other ViewContainer in the tab. */
@@ -102,6 +110,8 @@ protected:
void resizeEvent(QResizeEvent *resizeEvent) override;
private:
+ using QWidget::setVisible; // Makes sure that the setVisible() declaration above doesn't hide the one from QWidget so we can still use it privately.
+
/**
* Identical to SelectionModeBottomBar::setVisible() but doesn't change m_allowedToBeVisible.
* @see SelectionModeBottomBar::setVisible()
@@ -119,7 +129,7 @@ private:
* This is necessary because this bar might have been setVisible(true) but there is no reason to show the bar currently so it was kept hidden.
* @see SelectionModeBottomBar::setVisible() */
bool m_allowedToBeVisible = false;
- /// @see SelectionModeBottomBar::setVisible()
+ /** @see SelectionModeBottomBar::setVisible() */
QPointer<QPropertyAnimation> m_heightAnimation;
};