sola.lu
7 天以前 df53287060966d78ffccac78342fb5d0a028f835
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware)
// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
// SPDX-License-Identifier: Apache-2.0
 
#ifndef WINDOWBARPRIVATE_H
#define WINDOWBARPRIVATE_H
 
#include <QBoxLayout>
 
#include "windowbar.h"
 
namespace QWK {
 
    class WindowBarPrivate {
        Q_DECLARE_PUBLIC(WindowBar)
    public:
        WindowBarPrivate();
        virtual ~WindowBarPrivate();
 
        void init();
 
        WindowBar *q_ptr;
 
        QWidget *w;
        bool autoTitle;
        bool autoIcon;
 
        enum WindowBarItem {
            IconButton,
            MenuWidget,
            TitleLabel,
            LoginButton,
            LanguageButton,
            ManualButton,
            AboutButton,
            PinButton,
            MinimizeButton,
            MaximizeButton,
            CloseButton,
        };
 
        QHBoxLayout *layout;
 
        inline QWidget *widgetAt(int index) const {
            return layout->itemAt(index)->widget();
        }
 
        void setWidgetAt(int index, QWidget *widget);
 
        QWidget *takeWidgetAt(int index);
 
        inline void insertDefaultSpace(int index) {
            layout->insertSpacerItem(index, new QSpacerItem(0, 0));
        }
 
    private:
        Q_DISABLE_COPY(WindowBarPrivate)
    };
 
}
 
#endif // WINDOWBARPRIVATE_H