SARibbon 2.5.2
SARibbon wiki
载入中...
搜索中...
未找到
SARibbonBarLayout.h
1#ifndef SARIBBONBARLAYOUT_H
2#define SARIBBONBARLAYOUT_H
3
4#include "SARibbonGlobal.h"
5#include "SARibbonBar.h"
6#include <QLayout>
7#include <QPointer>
8
14
26class SA_RIBBON_EXPORT SARibbonBarLayout : public QLayout
27{
28 Q_OBJECT
29 SA_RIBBON_DECLARE_PRIVATE(SARibbonBarLayout)
30public:
31 // Constructor for SARibbonBarLayout
32 explicit SARibbonBarLayout(SARibbonBar* parent);
33 // Destructor for SARibbonBarLayout
34 virtual ~SARibbonBarLayout();
35
36 // QLayout interface implementations
37 // Add a layout item
38 void addItem(QLayoutItem* item) override;
39 // Get the layout item at the specified index
40 QLayoutItem* itemAt(int index) const override;
41 // Take and remove the layout item at the specified index
42 QLayoutItem* takeAt(int index) override;
43 // Get the number of layout items
44 int count() const override;
45 // Get the recommended size for the layout
46 QSize sizeHint() const override;
47 // Get the minimum size for the layout
48 QSize minimumSize() const override;
49 // Set the geometry of the layout
50 void setGeometry(const QRect& rect) override;
51
52 // Perform the layout
53 virtual void doLayout();
54
55 // Style related methods
56 // Check if the current style is loose style
57 bool isLooseStyle() const;
58 // Check if the current style is compact style
59 bool isCompactStyle() const;
60
61 // Title rectangle
62 // Get the title rectangle
63 const QRect& titleRect() const;
64
65 // Calculate minimum TabBar width
66 int calcMinTabBarWidth() const;
67
68 // Reset size, called when ribbon mode changes
69 void resetSize();
70
71 // Update title rectangle
72 void layoutTitleRect();
73
74 // Adjust StackedContainerWidget position
75 void layoutStackedContainerWidget();
76
77 // Re-layout category, called when category alignment changes
78 void layoutCategory();
79
80 // Set system button size
81 void setSystemButtonSize(const QSize& size);
82
83 // Set whether tab is on title bar
84 void setTabOnTitle(bool on);
85 // Check if tab is on title bar
86 bool isTabOnTitle() const;
87
88 // Get main bar height in minimum mode
89 int minimumModeMainBarHeight() const;
90
91 // Get main bar height in normal mode
92 int normalModeMainBarHeight() const;
93
94 // Ribbon tab bar height
95 // Get tab bar height
96 int tabBarHeight() const;
97 // Set tab bar height
98 void setTabBarHeight(int h);
99
100 // Title bar height
101 // Get title bar height
102 int titleBarHeight() const;
103 // Set title bar height
104 void setTitleBarHeight(int h);
105
106 // Category height
107 // Get category height
108 int categoryHeight() const;
109 // Set category height
110 void setCategoryHeight(int h);
111
112 // Panel title height
113 // Get panel title height
114 int panelTitleHeight() const;
115 // Set panel title height
116 void setPanelTitleHeight(int h);
117
118 // Window icon
119 // Set window icon
120 void setWindowIcon(const QIcon& icon);
121 // Get window icon
122 QIcon windowIcon() const;
123
124 // Application button vertical expansion
125 // Set whether application button is vertically expanded
126 void setApplicationButtonVerticalExpansion(bool on = true);
127 // Check if application button is vertically expanded
128 bool isApplicationButtonVerticalExpansion() const;
129
130 // Get elements
131 // Get ribbon bar
132 SARibbonBar* ribbonBar() const;
133 // Get ribbon tab bar
134 SARibbonTabBar* ribbonTabBar() const;
135 // Get stacked container widget
136 SARibbonStackedWidget* stackedContainerWidget() const;
137 // Get quick access bar
138 SARibbonQuickAccessBar* quickAccessBar() const;
139 // Get right button group
140 SARibbonButtonGroupWidget* rightButtonGroup() const;
141 // Get application button
142 QAbstractButton* applicationButton() const;
143 // Get title icon widget
144 SARibbonTitleIconWidget* titleIconWidget() const;
145
146protected:
147 // Resize in loose style
148 void resizeInLooseStyle();
149 // Resize in compact style
150 void resizeInCompactStyle();
151
152private:
153 // Initialize the layout
154 void init();
155};
156
157#endif // SARIBBONBARLAYOUT_H
Definition SARibbonBarLayout.h:27
Definition SARibbonBar.h:171
Definition SARibbonButtonGroupWidget.h:19
Definition SARibbonContextCategory.h:19
Definition SARibbonQuickAccessBar.h:67
Definition SARibbonStackedWidget.h:34
Definition SARibbonTabBar.h:17
Ribbon风格的标题栏图标控件 模拟Windows原生窗口左上角的程序图标功能,支持右键菜单和窗口控制操作
Definition SARibbonTitleIconWidget.h:13