File tree Expand file tree Collapse file tree 1 file changed +23
-13
lines changed
qrenderdoc/3rdparty/toolwindowmanager Expand file tree Collapse file tree 1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,17 @@ ToolWindowManagerTabBar::ToolWindowManagerTabBar(QWidget *parent) :
69
69
ToolWindowManagerTabBar::~ToolWindowManagerTabBar () {
70
70
}
71
71
72
+ bool ToolWindowManagerTabBar::useMinimalBar () const
73
+ {
74
+ if (count () > 1 )
75
+ return false ;
76
+
77
+ if (m_area) {
78
+ return m_area->useMinimalTabBar ();
79
+ }
80
+ return true ;
81
+ }
82
+
72
83
QSize ToolWindowManagerTabBar::sizeHint () const {
73
84
if (useMinimalBar ()) {
74
85
if (floatingWindowChild ())
@@ -81,26 +92,25 @@ QSize ToolWindowManagerTabBar::sizeHint() const {
81
92
82
93
int h = qMax (fm.height (), iconSize) + 2 *mw;
83
94
84
- return QSize (h , h);
95
+ return QSize (m_area-> width () , h);
85
96
}
86
97
87
98
return QTabBar::sizeHint ();
88
99
}
89
100
90
- bool ToolWindowManagerTabBar::useMinimalBar () const
91
- {
92
- if (count () > 1 )
93
- return false ;
94
-
95
- if (m_area) {
96
- return m_area->useMinimalTabBar ();
97
- }
98
- return true ;
99
- }
100
-
101
101
QSize ToolWindowManagerTabBar::minimumSizeHint () const {
102
102
if (useMinimalBar ()) {
103
- return sizeHint ();
103
+ if (floatingWindowChild ())
104
+ return QSize (0 , 0 );
105
+
106
+ QFontMetrics fm = fontMetrics ();
107
+
108
+ int iconSize = style ()->pixelMetric (QStyle::PM_SmallIconSize, 0 , this );
109
+ int mw = style ()->pixelMetric (QStyle::PM_DockWidgetTitleMargin, 0 , this );
110
+
111
+ int h = qMax (fm.height (), iconSize) + 2 *mw;
112
+
113
+ return QSize (h, h);
104
114
}
105
115
106
116
return QTabBar::minimumSizeHint ();
You can’t perform that action at this time.
0 commit comments