Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kdiroperatoriconview_p.h
- This file was added.
| 1 | /***************************************************************************** | ||||
|---|---|---|---|---|---|
| 2 | * Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at> * | ||||
| 3 | * Copyright (C) 2019 by Méven Car <meven.car@kdemail.net> * | ||||
| 4 | * * | ||||
| 5 | * This library is free software; you can redistribute it and/or * | ||||
| 6 | * modify it under the terms of the GNU Library General Public * | ||||
| 7 | * License version 2 as published by the Free Software Foundation. * | ||||
| 8 | * * | ||||
| 9 | * This library is distributed in the hope that it will be useful, * | ||||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||||
| 12 | * Library General Public License for more details. * | ||||
| 13 | * * | ||||
| 14 | * You should have received a copy of the GNU Library General Public License * | ||||
| 15 | * along with this library; see the file COPYING.LIB. If not, write to * | ||||
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||||
| 17 | * Boston, MA 02110-1301, USA. * | ||||
| 18 | *****************************************************************************/ | ||||
| 19 | | ||||
| 20 | #ifndef KDIROPERATORICONVIEW_P_H | ||||
| 21 | #define KDIROPERATORICONVIEW_P_H | ||||
| 22 | | ||||
| 23 | #include <QListView> | ||||
| 24 | | ||||
| 25 | /** | ||||
| 26 | * Default icon view for KDirOperator using | ||||
| 27 | * custom view options. | ||||
| 28 | */ | ||||
| 29 | class KDirOperatorIconView : public QListView | ||||
| 30 | { | ||||
| 31 | Q_OBJECT | ||||
| 32 | | ||||
| 33 | public: | ||||
| 34 | enum Kind { | ||||
| 35 | Icon = 0, | ||||
| 36 | Compact = 1 | ||||
| 37 | }; | ||||
| 38 | KDirOperatorIconView(QWidget *parent = nullptr, const Kind kind = Icon); | ||||
| 39 | ~KDirOperatorIconView() override; | ||||
| 40 | | ||||
| 41 | protected: | ||||
| 42 | QStyleOptionViewItem viewOptions() const override; | ||||
| 43 | void dragEnterEvent(QDragEnterEvent *event) override; | ||||
| 44 | void mousePressEvent(QMouseEvent *event) override; | ||||
| 45 | void wheelEvent(QWheelEvent *event) override; | ||||
| 46 | void resizeEvent(QResizeEvent *event) override; | ||||
| 47 | | ||||
| 48 | protected Q_SLOTS: | ||||
| 49 | void updateLayout(); | ||||
| 50 | | ||||
| 51 | private: | ||||
| 52 | Kind viewKind; | ||||
| 53 | }; | ||||
| 54 | | ||||
| 55 | #endif // KDIROPERATORICONVIEW_P_H | ||||