]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/places/placesitemlistwidget.h
Only check if place url is mount point once during polish event.
[dolphin.git] / src / panels / places / placesitemlistwidget.h
1 /*
2 * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef PLACESITEMLISTWIDGET_H
8 #define PLACESITEMLISTWIDGET_H
9
10 #include "kitemviews/kstandarditemlistwidget.h"
11
12 /**
13 * @brief Extends KStandardItemListWidget to interpret the hidden
14 * property of the PlacesModel and use the right text color.
15 */
16 class PlacesItemListWidget : public KStandardItemListWidget
17 {
18 Q_OBJECT
19
20 public:
21 PlacesItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent);
22 ~PlacesItemListWidget() override;
23
24 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
25 void polishEvent() override;
26
27 protected:
28 bool isHidden() const override;
29 QPalette::ColorRole normalTextColorRole() const override;
30 void updateCapacityBar();
31 void resetCapacityBar();
32
33 private:
34 bool m_isMountPoint;
35 bool m_drawCapacityBar;
36 qreal m_capacityBarRatio;
37 };
38
39 #endif
40
41