@@ -117,7 +117,7 @@ struct AutoHideDockContainerPrivate
117
117
CResizeHandle* ResizeHandle = nullptr ;
118
118
QSize Size; // creates invalid size
119
119
QPointer<CAutoHideTab> SideTab;
120
- QSize InitialDockWidgetSize ;
120
+ QSize SizeCache ;
121
121
122
122
/* *
123
123
* Private data constructor
@@ -216,7 +216,7 @@ CAutoHideDockContainer::CAutoHideDockContainer(CDockWidget* DockWidget, SideBarL
216
216
bool OpaqueResize = CDockManager::testConfigFlag (CDockManager::OpaqueSplitterResize);
217
217
d->ResizeHandle ->setOpaqueResize (OpaqueResize);
218
218
d->Size = d->DockArea ->size ();
219
- d->InitialDockWidgetSize = DockWidget->size ();
219
+ d->SizeCache = DockWidget->size ();
220
220
221
221
addDockWidget (DockWidget);
222
222
parent->registerAutoHideWidget (this );
@@ -239,12 +239,6 @@ void CAutoHideDockContainer::updateSize()
239
239
}
240
240
241
241
auto rect = dockContainerParent->contentRect ();
242
- qDebug () << " dockContainerParent->contentRect() " << rect;
243
- qDebug () << " dockWidget()->rect()" << dockWidget ()->rect ();
244
- qDebug () << " dockAreaWidget()->rect(): " << dockAreaWidget ()->rect ();
245
- qDebug () << " CAutoHideDockContainer::isVisible " << this ->isVisible ();
246
- qDebug () << " CAutoHideDockContainer::rect " << this ->rect ();
247
-
248
242
switch (sideBarLocation ())
249
243
{
250
244
case SideBarLocation::SideBarTop:
@@ -279,8 +273,14 @@ void CAutoHideDockContainer::updateSize()
279
273
break ;
280
274
}
281
275
282
- qDebug () << " CAutoHideDockContainer::rect (after): " << this ->rect ();
283
- qDebug () << " dockAreaWidget()->rect(): " << dockAreaWidget ()->rect ();
276
+ if (orientation () == Qt::Horizontal)
277
+ {
278
+ d->SizeCache .setHeight (this ->height ());
279
+ }
280
+ else
281
+ {
282
+ d->SizeCache .setWidth (this ->width ());
283
+ }
284
284
}
285
285
286
286
// ============================================================================
@@ -658,31 +658,24 @@ bool CAutoHideDockContainer::event(QEvent* event)
658
658
}
659
659
660
660
661
- // ============================================================================
662
- QSize CAutoHideDockContainer::initialDockWidgetSize () const
663
- {
664
- return d->InitialDockWidgetSize ;
665
- }
666
-
667
-
668
661
// ============================================================================
669
662
Qt::Orientation CAutoHideDockContainer::orientation () const
670
663
{
671
- return autoHideSideBar ()->orientation ();
664
+ return ads::internal::isHorizontalSideBarLocation (d->SideTabBarArea )
665
+ ? Qt::Horizontal : Qt::Vertical;
672
666
}
673
667
674
668
675
669
// ============================================================================
676
670
void CAutoHideDockContainer::resetToInitialDockWidgetSize ()
677
671
{
678
- auto OriginalSize = initialDockWidgetSize ();
679
672
if (orientation () == Qt::Horizontal)
680
673
{
681
- setSize (OriginalSize .height ());
674
+ setSize (d-> SizeCache .height ());
682
675
}
683
676
else
684
677
{
685
- setSize (OriginalSize .width ());
678
+ setSize (d-> SizeCache .width ());
686
679
}
687
680
}
688
681
@@ -691,8 +684,6 @@ void CAutoHideDockContainer::resetToInitialDockWidgetSize()
691
684
void CAutoHideDockContainer::moveToNewSideBarLocation (SideBarLocation NewSideBarLocation,
692
685
int TabIndex)
693
686
{
694
- qDebug () << " CAutoHideDockContainer::moveToNewSideBarLocation TabIndex " <<
695
- TabIndex << " this->tabIndex: " << this ->tabIndex ();
696
687
if (NewSideBarLocation == sideBarLocation () && TabIndex == this ->tabIndex ())
697
688
{
698
689
return ;
0 commit comments