@@ -131,7 +131,7 @@ void DockWidgetPrivate::capturedState()
131
131
// ============================================================================
132
132
void DockWidgetPrivate::showDockWidget ()
133
133
{
134
- if (!CapturedState.DockContainer )
134
+ /* if (!CapturedState.DockContainer)
135
135
{
136
136
auto FloatingWidget = new CFloatingDockContainer(_this);
137
137
FloatingWidget->setGeometry(CapturedState.GlobalGeometry);
@@ -151,6 +151,16 @@ void DockWidgetPrivate::showDockWidget()
151
151
for (const auto& TreeItem : DockTree)
152
152
{
153
153
154
+ }*/
155
+
156
+ std::cout << " DockWidgetPrivate::showDockWidget()" << std::endl;
157
+ _this->show ();
158
+ DockArea->show ();
159
+
160
+ QSplitter* Splitter = internal::findParent<QSplitter*>(_this);
161
+ if (Splitter)
162
+ {
163
+ Splitter->show ();
154
164
}
155
165
}
156
166
@@ -270,7 +280,7 @@ QAction* CDockWidget::toggleViewAction() const
270
280
// ============================================================================
271
281
void CDockWidget::toggleView (bool Open)
272
282
{
273
- if ((d->DockArea != nullptr ) == Open)
283
+ /* if ((d->DockArea != nullptr) == Open)
274
284
{
275
285
return;
276
286
}
@@ -280,9 +290,18 @@ void CDockWidget::toggleView(bool Open)
280
290
hideDockWidget(true);
281
291
}
282
292
else if (Open && !d->DockArea)
293
+ {
294
+ d->showDockWidget();
295
+ }*/
296
+
297
+ if (Open)
283
298
{
284
299
d->showDockWidget ();
285
300
}
301
+ else
302
+ {
303
+ hideDockWidget (true );
304
+ }
286
305
}
287
306
288
307
@@ -298,7 +317,7 @@ void CDockWidget::setDockArea(CDockAreaWidget* DockArea)
298
317
// ============================================================================
299
318
void CDockWidget::hideDockWidget (bool RemoveFromDockArea)
300
319
{
301
- d->capturedState ();
320
+ /* d->capturedState();
302
321
if (d->DockArea && RemoveFromDockArea)
303
322
{
304
323
d->DockArea->removeDockWidget(this);
@@ -307,7 +326,48 @@ void CDockWidget::hideDockWidget(bool RemoveFromDockArea)
307
326
this->setDockArea(nullptr);
308
327
// Remove title from dock area widget to prevent its deletion if dock
309
328
// area is deleted
310
- d->TitleWidget ->setParent (this );
329
+ d->TitleWidget->setParent(this);*/
330
+
331
+ std::cout << " CDockWidget::hideDockWidget" << std::endl;
332
+ this ->hide ();
333
+ d->ToggleViewAction ->setChecked (false );
334
+ d->TitleWidget ->hide ();
335
+ CDockAreaWidget* DockArea = d->DockArea ;
336
+ for (int i = 0 ; i < DockArea->count (); ++i)
337
+ {
338
+ if (DockArea->dockWidget (i)->isVisible ())
339
+ {
340
+ return ;
341
+ }
342
+ }
343
+
344
+ if (DockArea->count () > 1 )
345
+ {
346
+ if (DockArea->currentIndex () == (DockArea->count () - 1 ))
347
+ {
348
+ DockArea->setCurrentIndex (DockArea->currentIndex () - 1 );
349
+ }
350
+ else
351
+ {
352
+ DockArea->setCurrentIndex (DockArea->currentIndex () + 1 );
353
+ }
354
+ }
355
+ QSplitter* Splitter = internal::findParent<QSplitter*>(this );
356
+ if (!Splitter)
357
+ {
358
+ return ;
359
+ }
360
+
361
+ std::cout << " DockWidgets " << Splitter->count () << std::endl;
362
+ for (int i = 0 ; i < Splitter->count (); ++i)
363
+ {
364
+ if (Splitter->widget (i)->isVisible ())
365
+ {
366
+ return ;
367
+ }
368
+ }
369
+
370
+ Splitter->hide ();
311
371
}
312
372
313
373
} // namespace ads
0 commit comments