Mercurial > hg > svgui
comparison view/PaneStack.h @ 1447:8afea53332f3 single-point
Add option to make pane sizes auto-resize-only (i.e. remove user control via a splitter); also place alignment views above panes instead of below, meaning the extra bit of space that we currently have for the pane without one at least goes to the primary pane
author | Chris Cannam |
---|---|
date | Tue, 30 Apr 2019 15:53:21 +0100 |
parents | 7527701c8076 |
children | 69b7fdd6394f |
comparison
equal
deleted
inserted
replaced
1446:1ed6d666ec9e | 1447:8afea53332f3 |
---|---|
23 #include "base/BaseTypes.h" | 23 #include "base/BaseTypes.h" |
24 | 24 |
25 class QWidget; | 25 class QWidget; |
26 class QLabel; | 26 class QLabel; |
27 class QStackedWidget; | 27 class QStackedWidget; |
28 class QVBoxLayout; | |
28 class QSplitter; | 29 class QSplitter; |
29 class QGridLayout; | 30 class QGridLayout; |
30 class QPushButton; | 31 class QPushButton; |
31 class View; | 32 class View; |
32 class Pane; | 33 class Pane; |
39 class PaneStack : public QFrame | 40 class PaneStack : public QFrame |
40 { | 41 { |
41 Q_OBJECT | 42 Q_OBJECT |
42 | 43 |
43 public: | 44 public: |
44 PaneStack(QWidget *parent, ViewManager *viewManager); | 45 PaneStack(QWidget *parent, |
46 ViewManager *viewManager); | |
45 | 47 |
46 Pane *addPane(bool suppressPropertyBox = false); // I own the returned value | 48 Pane *addPane(bool suppressPropertyBox = false); // I own the returned value |
47 Pane *insertPane(int index, bool suppressPropertyBox = false); // I own the returned value | |
48 void deletePane(Pane *pane); // Deletes the pane, but _not_ its layers | 49 void deletePane(Pane *pane); // Deletes the pane, but _not_ its layers |
49 | 50 |
50 int getPaneCount() const; // Returns only count of visible panes | 51 int getPaneCount() const; // Returns only count of visible panes |
51 Pane *getPane(int n); // Of visible panes; I own the returned value | 52 Pane *getPane(int n); // Of visible panes; I own the returned value |
52 int getPaneIndex(Pane *pane); // so getPane(index)==pane; -1 if absent | 53 int getPaneIndex(Pane *pane); // so getPane(index)==pane; -1 if absent |
67 PropertyStackPerPaneLayout = 2 | 68 PropertyStackPerPaneLayout = 2 |
68 }; | 69 }; |
69 | 70 |
70 LayoutStyle getLayoutStyle() const { return m_layoutStyle; } | 71 LayoutStyle getLayoutStyle() const { return m_layoutStyle; } |
71 void setLayoutStyle(LayoutStyle style); | 72 void setLayoutStyle(LayoutStyle style); |
73 | |
74 enum ResizeMode { | |
75 UserResizeable = 0, | |
76 AutoResizeOnly = 1 | |
77 }; | |
78 | |
79 ResizeMode getResizeMode() const { return m_resizeMode; } | |
80 void setResizeMode(ResizeMode); | |
72 | 81 |
73 void setPropertyStackMinWidth(int mw); | 82 void setPropertyStackMinWidth(int mw); |
74 | 83 |
75 void setShowPaneAccessories(bool show); // current indicator, close button | 84 void setShowPaneAccessories(bool show); // current indicator, close button |
76 | 85 |
130 std::vector<PaneRec> m_hiddenPanes; | 139 std::vector<PaneRec> m_hiddenPanes; |
131 | 140 |
132 bool m_showAccessories; | 141 bool m_showAccessories; |
133 bool m_showAlignmentViews; | 142 bool m_showAlignmentViews; |
134 | 143 |
135 QSplitter *m_splitter; | 144 QSplitter *m_splitter; // constitutes the stack in UserResizeable mode |
145 QWidget *m_autoResizeStack; // constitutes the stack in AutoResizeOnly mode | |
146 QVBoxLayout *m_autoResizeLayout; | |
147 | |
136 QStackedWidget *m_propertyStackStack; | 148 QStackedWidget *m_propertyStackStack; |
137 | 149 |
138 ViewManager *m_viewManager; // I don't own this | 150 ViewManager *m_viewManager; // I don't own this |
139 int m_propertyStackMinWidth; | 151 int m_propertyStackMinWidth; |
140 void sizePropertyStacks(); | 152 void sizePropertyStacks(); |
143 | 155 |
144 void unlinkAlignmentViews(); | 156 void unlinkAlignmentViews(); |
145 void relinkAlignmentViews(); | 157 void relinkAlignmentViews(); |
146 | 158 |
147 LayoutStyle m_layoutStyle; | 159 LayoutStyle m_layoutStyle; |
160 ResizeMode m_resizeMode; | |
148 }; | 161 }; |
149 | 162 |
150 #endif | 163 #endif |
151 | 164 |