File indexing completed on 2024-05-12 16:02:09
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2007 Marijn Kruisselbrink <mkruisselbrink@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #ifndef KODOCKWIDGETTITLEBAR_H_ 0007 #define KODOCKWIDGETTITLEBAR_H_ 0008 0009 #include "kritawidgets_export.h" 0010 #include <QDockWidget> 0011 0012 /** 0013 * @short A custom title bar for dock widgets. 0014 * 0015 * Allow customization such as hidden text. 0016 * 0017 * @see KoDockWidgetTitleBarButton 0018 */ 0019 class KRITAWIDGETS_EXPORT KoDockWidgetTitleBar : public QWidget 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit KoDockWidgetTitleBar(QDockWidget *dockWidget); 0024 ~KoDockWidgetTitleBar() override; 0025 0026 void updateIcons(); 0027 0028 public Q_SLOTS: 0029 void setLocked(bool locked); 0030 0031 protected: 0032 void paintEvent(QPaintEvent* event) override; ///< reimplemented from QWidget 0033 void resizeEvent(QResizeEvent* event) override; ///< reimplemented from QWidget 0034 private: 0035 Q_PRIVATE_SLOT(d, void toggleFloating()) 0036 Q_PRIVATE_SLOT(d, void topLevelChanged(bool topLevel)) 0037 Q_PRIVATE_SLOT(d, void featuresChanged(QDockWidget::DockWidgetFeatures)) 0038 Q_PRIVATE_SLOT(d, void dockWidgetTitleChanged(const QString &title)) 0039 0040 class Private; 0041 Private * const d; 0042 }; 0043 0044 #endif // KODOCKWIDGETTITLEBAR_H_