79
79
#include " FloatingDockContainer.h"
80
80
#include " DockComponentsFactory.h"
81
81
#include " StatusDialog.h"
82
-
82
+ # include " DockSplitter.h "
83
83
84
84
85
85
/* *
@@ -417,6 +417,22 @@ void MainWindowPrivate::createContent()
417
417
DockWidget = createCalendarDockWidget ();
418
418
DockWidget->setTabToolTip (QString (" Tab ToolTip\n Hodie est dies magna" ));
419
419
auto DockArea = DockManager->addDockWidget (ads::CenterDockWidgetArea, DockWidget, TopDockArea);
420
+ // Now we create a action to test resizing of DockArea widget
421
+ auto Action = ui.menuTests ->addAction (QString (" Resize %1" ).arg (DockWidget->windowTitle ()));
422
+ QObject::connect (Action, &QAction::triggered, [DockArea]()
423
+ {
424
+ // Resizing only works, if the Splitter is visible and has a valid
425
+ // sizes
426
+ auto Splitter = ads::internal::findParent<ads::CDockSplitter*>(DockArea);
427
+ if (!Splitter)
428
+ {
429
+ return ;
430
+ }
431
+ // We change the sizes of the splitter that contains the Calendar 1 widget
432
+ // to resize the dock widget
433
+ int Width = Splitter->width ();
434
+ Splitter->setSizes ({Width * 2 /3 , Width * 1 /3 });
435
+ });
420
436
421
437
// Now we add a custom button to the dock area title bar that will create
422
438
// new editor widgets when clicked
@@ -443,13 +459,14 @@ void MainWindowPrivate::createContent()
443
459
DockManager->addDockWidget (ads::CenterDockWidgetArea, createLongTextLabelDockWidget (), RighDockArea);
444
460
DockManager->addDockWidget (ads::CenterDockWidgetArea, createLongTextLabelDockWidget (), BottomDockArea);
445
461
446
- auto Action = ui.menuTests ->addAction (QString (" Set %1 Floating" ).arg (DockWidget->windowTitle ()));
462
+ Action = ui.menuTests ->addAction (QString (" Set %1 Floating" ).arg (DockWidget->windowTitle ()));
447
463
DockWidget->connect (Action, SIGNAL (triggered ()), SLOT (setFloating ()));
448
464
Action = ui.menuTests ->addAction (QString (" Set %1 As Current Tab" ).arg (DockWidget->windowTitle ()));
449
465
DockWidget->connect (Action, SIGNAL (triggered ()), SLOT (setAsCurrentTab ()));
450
466
Action = ui.menuTests ->addAction (QString (" Raise %1" ).arg (DockWidget->windowTitle ()));
451
467
DockWidget->connect (Action, SIGNAL (triggered ()), SLOT (raise ()));
452
468
469
+
453
470
#ifdef Q_OS_WIN
454
471
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
455
472
if (!ads::CDockManager::testConfigFlag (ads::CDockManager::OpaqueUndocking))
0 commit comments