X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fc965a725cd0cfdca520b1a08e1f144f06aab7d2..78cffd2979a6ed87e044fcb024cf4fdfc5c7cb3d:/src/views/dolphinview.h diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index b40be8936..9b0dee62e 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -14,7 +14,7 @@ #include #include -#include +#include "config-dolphin.h" #include #include @@ -23,6 +23,8 @@ #include #include +#include + typedef KIO::FileUndoManager::CommandType CommandType; class QVBoxLayout; class DolphinItemListView; @@ -35,6 +37,8 @@ class VersionControlObserver; class ViewProperties; class QLabel; class QGraphicsSceneDragDropEvent; +class QHelpEvent; +class QProxyStyle; class QRegularExpression; /** @@ -105,8 +109,14 @@ public: * (GeneralSettings::globalViewProps() returns false), then the * changed view mode will be stored automatically. */ - void setMode(Mode mode); - Mode mode() const; + void setViewMode(Mode mode); + Mode viewMode() const; + + /** + * Enables or disables a mode for quick and easy selection of items. + */ + void setSelectionMode(bool enabled); + bool selectionMode() const; /** * Turns on the file preview for the all files of the current directory, @@ -598,6 +608,13 @@ Q_SIGNALS: */ void goForwardRequested(); + /** + * Is emitted when the selection mode is requested for the current view. + * This typically happens on press and hold. + * @see KItemListController::longPress() + */ + void selectionModeRequested(); + /** * Is emitted when the user wants to move the focus to another view. */ @@ -634,7 +651,7 @@ private Q_SLOTS: void slotViewContextMenuRequested(const QPointF& pos); void slotHeaderContextMenuRequested(const QPointF& pos); void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current); - void slotLeadingPaddingWidthChanged(qreal width); + void slotSidePaddingWidthChanged(qreal width); void slotItemHovered(int index); void slotItemUnhovered(int index); void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); @@ -862,7 +879,7 @@ private: void updatePlaceholderLabel(); - void tryShowNameToolTip(QEvent* event); + void tryShowNameToolTip(QHelpEvent* event); private: void updatePalette(); @@ -874,7 +891,14 @@ private: bool m_isFolderWritable; bool m_dragging; // True if a dragging is done. Required to be able to decide whether a // tooltip may be shown when hovering an item. - bool m_loading; + + enum class LoadingState { + Idle, + Loading, + Canceled, + Completed + }; + LoadingState m_loadingState = LoadingState::Idle; QUrl m_url; QString m_viewPropertiesContext; @@ -908,9 +932,13 @@ private: QLabel* m_placeholderLabel; QTimer* m_showLoadingPlaceholderTimer; + /// Used for selection mode. @see setSelectionMode() + std::unique_ptr m_proxyStyle; + // For unit tests friend class TestBase; friend class DolphinDetailsViewTest; + friend class DolphinMainWindowTest; friend class DolphinPart; // Accesses m_model };