]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphindockwidget.h
SVN_SILENT made messages (.desktop file) - always resolve ours
[dolphin.git] / src / dolphindockwidget.h
1 /*
2 * SPDX-FileCopyrightText: 2010 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef DOLPHIN_DOCK_WIDGET_H
8 #define DOLPHIN_DOCK_WIDGET_H
9
10 #include <QDockWidget>
11
12 /**
13 * @brief Extends QDockWidget to be able to get locked.
14 */
15 class DolphinDockWidget : public QDockWidget
16 {
17 Q_OBJECT
18
19 public:
20 explicit DolphinDockWidget(const QString &title = QString(), QWidget *parent = nullptr, Qt::WindowFlags flags = {});
21 ~DolphinDockWidget() override;
22
23 /**
24 * @param lock If \a lock is true, the title bar of the dock-widget will get hidden so
25 * that it is not possible for the user anymore to move or undock the dock-widget.
26 */
27 void setLocked(bool lock);
28 bool isLocked() const;
29
30 protected:
31 /**
32 * Make sure we do not emit QDockWidget::visibilityChanged() signals whenever Dolphin's window is minimized or restored.
33 */
34 bool event(QEvent *event) override;
35
36 private:
37 bool m_locked;
38 QWidget *m_dockTitleBar;
39 };
40
41 #endif