2 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef DOLPHINITEMLISTVIEW_H
8 #define DOLPHINITEMLISTVIEW_H
10 #include "dolphin_export.h"
11 #include "kitemviews/kfileitemlistview.h"
13 class KFileItemListView
;
16 * @brief Dolphin specific view-implementation.
18 * Offers zoom-level support and takes care for translating
19 * the view-properties into the corresponding KItemListView
22 class DOLPHIN_EXPORT DolphinItemListView
: public KFileItemListView
27 explicit DolphinItemListView(QGraphicsWidget
*parent
= nullptr);
28 ~DolphinItemListView() override
;
30 void setZoomLevel(int level
);
31 int zoomLevel() const;
33 enum SelectionTogglesEnabled
{ True
, False
, FollowSetting
};
35 * Sets whether the items in this view should show a small selection toggle area on mouse hover.
36 * The default for this view is to follow the "showSelectionToggle" setting but this method can
37 * be used to ignore that setting and force a different value.
39 void setEnabledSelectionToggles(SelectionTogglesEnabled selectionTogglesEnabled
);
45 KItemListWidgetCreatorBase
*defaultWidgetCreator() const override
;
46 /** Overwriting in the Dolphin-specific class because we want this to be user-configurable.
47 * @see KStandardItemListView::itemLayoutHighlightEntireRow */
48 bool itemLayoutHighlightEntireRow(ItemLayout layout
) const override
;
49 bool itemLayoutSupportsItemExpanding(ItemLayout layout
) const override
;
50 void onItemLayoutChanged(ItemLayout current
, ItemLayout previous
) override
;
51 void onPreviewsShownChanged(bool shown
) override
;
52 void onVisibleRolesChanged(const QList
<QByteArray
> ¤t
, const QList
<QByteArray
> &previous
) override
;
54 void updateFont() override
;
57 void updateGridSize();
59 using KItemListView::setEnabledSelectionToggles
; // Makes sure that the setEnabledSelectionToggles() declaration above doesn't hide
60 // the one from the base class so we can still use it privately.
61 SelectionTogglesEnabled m_selectionTogglesEnabled
= FollowSetting
;