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    SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
0004 
0005    SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 #ifndef KoDockWidgetTitleBar_p_h
0008 #define KoDockWidgetTitleBar_p_h
0009 
0010 #include "KoDockWidgetTitleBar.h"
0011 #include "KoDockWidgetTitleBarButton.h"
0012 
0013 #include <KoIcon.h>
0014 
0015 #include <WidgetsDebug.h>
0016 
0017 #include <QAbstractButton>
0018 #include <QAction>
0019 #include <QLabel>
0020 #include <QLayout>
0021 #include <QStyle>
0022 #include <QStylePainter>
0023 #include <QStyleOptionFrame>
0024 
0025 class KSqueezedTextLabel;
0026 
0027 class Q_DECL_HIDDEN KoDockWidgetTitleBar::Private
0028 {
0029 public:
0030     Private(KoDockWidgetTitleBar* thePublic)
0031         : thePublic(thePublic)
0032         , locked(false)
0033     {
0034     }
0035 
0036     KoDockWidgetTitleBar* thePublic {nullptr};
0037     QIcon lockIcon, floatIcon, removeIcon; 
0038     QAbstractButton* closeButton {nullptr};
0039     QAbstractButton* floatButton {nullptr};
0040     QAbstractButton* lockButton {nullptr};
0041     KSqueezedTextLabel* titleLabel {nullptr};
0042     bool locked {false};
0043     QDockWidget::DockWidgetFeatures features;
0044 
0045     void toggleFloating();
0046     void topLevelChanged(bool topLevel);
0047     void featuresChanged(QDockWidget::DockWidgetFeatures features);
0048     void dockWidgetTitleChanged(const QString &title);
0049     void updateIcons();
0050     void updateButtonSizes();
0051 };
0052 #endif