diff --git a/app/src/basedockwidget.cpp b/app/src/basedockwidget.cpp index d052dd1cc1..4d9cac3662 100644 --- a/app/src/basedockwidget.cpp +++ b/app/src/basedockwidget.cpp @@ -34,34 +34,8 @@ BaseDockWidget::BaseDockWidget(QWidget* pParent) "border-width: 1px; }"); } #endif - } BaseDockWidget::~BaseDockWidget() { } - -void BaseDockWidget::resizeEvent(QResizeEvent *event) -{ - QDockWidget::resizeEvent(event); - - // Not sure where the -2 comes from, but the event width is always 2 more than what is passed to FlowLayout::setGeometry - int minHeight = getMinHeightForWidth(event->size().width() - 2); - - if (minHeight < 0) return; - -#ifdef __APPLE__ - // For some reason the behavior of minimumSize and the margin changes on mac when floating, so we need to do this -#else - int top, bottom; - layout()->getContentsMargins(nullptr, &top, nullptr, &bottom); - minHeight += top + bottom; -#endif - setMinimumSize(QSize(layout()->minimumSize().width(), minHeight)); -} - -int BaseDockWidget::getMinHeightForWidth(int width) -{ - Q_UNUSED(width) - return -1; -} diff --git a/app/src/basedockwidget.h b/app/src/basedockwidget.h index ddc91c2a5d..2f4e349264 100644 --- a/app/src/basedockwidget.h +++ b/app/src/basedockwidget.h @@ -30,8 +30,6 @@ class BaseDockWidget : public QDockWidget explicit BaseDockWidget(QWidget* pParent); virtual ~BaseDockWidget(); - void resizeEvent(QResizeEvent *event) override; - public: virtual void initUI() = 0; virtual void updateUI() = 0; @@ -39,9 +37,6 @@ class BaseDockWidget : public QDockWidget Editor* editor() const { return mEditor; } void setEditor( Editor* e ) { mEditor = e; } -protected: - virtual int getMinHeightForWidth(int width); - private: Editor* mEditor = nullptr; }; diff --git a/app/src/colorbox.cpp b/app/src/colorbox.cpp index 249fca92c4..4b11f3ff15 100644 --- a/app/src/colorbox.cpp +++ b/app/src/colorbox.cpp @@ -35,7 +35,7 @@ void ColorBox::initUI() mColorWheel = new ColorWheel(this); QVBoxLayout* layout = new QVBoxLayout; - layout->setContentsMargins(5, 5, 5, 5); + layout->setContentsMargins(3, 3, 3, 3); layout->addWidget(mColorWheel); layout->setStretch(0, 1); layout->setStretch(1, 0); diff --git a/app/src/toolbox.cpp b/app/src/toolbox.cpp index ff155ec225..653172cff7 100644 --- a/app/src/toolbox.cpp +++ b/app/src/toolbox.cpp @@ -137,8 +137,18 @@ void ToolBoxWidget::initUI() connect(editor()->layers(), &LayerManager::currentLayerChanged, this, &ToolBoxWidget::onLayerDidChange); - - FlowLayout* flowlayout = new FlowLayout; + connect(this, &QDockWidget::dockLocationChanged, this, [=](Qt::DockWidgetArea area) { + if (area == Qt::DockWidgetArea::TopDockWidgetArea || area == Qt::BottomDockWidgetArea) { + const int minimumHeight = ui->scrollAreaWidgetContents_2->layout()->heightForWidth(width()); + ui->scrollArea->setMinimumHeight(minimumHeight); + setMinimumHeight(minimumHeight); + } else { + ui->scrollArea->setMinimumHeight(0); // Default value + // Don't set own minimum height and let Qt come up with a sensible value + } + }); + + FlowLayout* flowlayout = new FlowLayout(3,3,3); flowlayout->addWidget(ui->pencilButton); flowlayout->addWidget(ui->eraserButton); @@ -154,6 +164,7 @@ void ToolBoxWidget::initUI() delete ui->scrollAreaWidgetContents_2->layout(); ui->scrollAreaWidgetContents_2->setLayout(flowlayout); + ui->scrollAreaWidgetContents_2->setContentsMargins(0,0,0,0); QSettings settings(PENCIL2D, PENCIL2D); restoreGeometry(settings.value("ToolBoxGeom").toByteArray()); @@ -163,6 +174,15 @@ void ToolBoxWidget::updateUI() { } +void ToolBoxWidget::resizeEvent(QResizeEvent* event) +{ + QDockWidget::resizeEvent(event); + + const int minimumHeight = ui->scrollArea->minimumHeight(); + if (minimumHeight <= 0) { return; } + setMinimumHeight(minimumHeight); +} + void ToolBoxWidget::onToolSetActive(ToolType toolType) { deselectAllTools(); @@ -265,11 +285,6 @@ void ToolBoxWidget::smudgeOn() toolOn(SMUDGE, ui->smudgeButton); } -int ToolBoxWidget::getMinHeightForWidth(int width) -{ - return ui->toolGroup->layout()->heightForWidth(width); -} - void ToolBoxWidget::deselectAllTools() { ui->pencilButton->setChecked(false); diff --git a/app/src/toolbox.h b/app/src/toolbox.h index e053988b2b..617d9b07a1 100644 --- a/app/src/toolbox.h +++ b/app/src/toolbox.h @@ -59,7 +59,7 @@ public slots: void smudgeOn(); protected: - int getMinHeightForWidth(int width) override; + void resizeEvent(QResizeEvent* event) override; private: void deselectAllTools(); diff --git a/app/ui/bucketoptionswidget.ui b/app/ui/bucketoptionswidget.ui index 49ffe7ee29..f3fd9c2554 100644 --- a/app/ui/bucketoptionswidget.ui +++ b/app/ui/bucketoptionswidget.ui @@ -6,10 +6,16 @@ 0 0 - 400 + 140 221 + + + 140 + 0 + + Form @@ -92,8 +98,17 @@ QLayout::SetDefaultConstraint + + 3 + - 0 + 3 + + + 3 + + + 3 6 diff --git a/app/ui/cameraoptionswidget.ui b/app/ui/cameraoptionswidget.ui index f2100f77f5..092c75fb6e 100644 --- a/app/ui/cameraoptionswidget.ui +++ b/app/ui/cameraoptionswidget.ui @@ -6,10 +6,16 @@ 0 0 - 254 + 140 208 + + + 140 + 0 + + 0 @@ -30,16 +36,16 @@ - 0 + 3 - 0 + 3 - 0 + 3 - 0 + 3 2 @@ -122,19 +128,19 @@ - 2 + 0 - 4 + 0 - 4 + 0 - 4 + 0 - 4 + 0 diff --git a/app/ui/colorinspector.ui b/app/ui/colorinspector.ui index e228df76c7..2140a289c6 100644 --- a/app/ui/colorinspector.ui +++ b/app/ui/colorinspector.ui @@ -7,10 +7,16 @@ 0 0 - 271 + 120 263 + + + 120 + 0 + + 0 @@ -19,16 +25,16 @@ - 5 + 3 - 2 + 3 - 2 + 3 - 2 + 3 @@ -39,13 +45,25 @@ - 1 + 0 HSV + + 3 + + + 3 + + + 3 + + + 3 + @@ -75,16 +93,44 @@ - + + + + 0 + 0 + + + - + + + + 0 + 0 + + + - + + + + 0 + 0 + + + - + + + + 0 + 0 + + + @@ -133,6 +179,18 @@ RGB + + 3 + + + 3 + + + 3 + + + 3 + @@ -148,10 +206,24 @@ - + + + + 0 + 0 + + + - + + + + 0 + 0 + + + @@ -161,10 +233,24 @@ - + + + + 0 + 0 + + + - + + + + 0 + 0 + + + diff --git a/app/ui/colorpalette.ui b/app/ui/colorpalette.ui index 559d9a1e7e..1155562fdd 100644 --- a/app/ui/colorpalette.ui +++ b/app/ui/colorpalette.ui @@ -6,10 +6,16 @@ 0 0 - 268 + 140 241 + + + 140 + 132 + + Color Palette @@ -225,12 +231,6 @@ 0 - - - 0 - 0 - - 16777215 diff --git a/app/ui/onionskin.ui b/app/ui/onionskin.ui index 20c6eec598..9694cfc12f 100644 --- a/app/ui/onionskin.ui +++ b/app/ui/onionskin.ui @@ -6,13 +6,13 @@ 0 0 - 213 - 382 + 140 + 291 - 187 + 140 122 @@ -30,6 +30,9 @@ + + 0 + 0 @@ -76,8 +79,8 @@ 0 0 - 213 - 360 + 160 + 254 @@ -87,17 +90,20 @@ + + 3 + - 6 + 3 - 6 + 3 - 6 + 3 - 6 + 3 @@ -108,6 +114,9 @@ true + + 3 + QLayout::SetDefaultConstraint @@ -115,13 +124,13 @@ 0 - 6 + 3 0 - 6 + 3 @@ -189,6 +198,9 @@ true + + 3 + QLayout::SetDefaultConstraint @@ -196,13 +208,13 @@ 0 - 6 + 3 0 - 6 + 3 @@ -278,25 +290,28 @@ Distributed Opacity - + - 6 + 0 0 - 6 + 0 0 - 6 + 3 - - + + + + 3 + 0 @@ -310,7 +325,7 @@ 0 - + 0 @@ -318,12 +333,15 @@ - Min + Max + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + 0 @@ -332,7 +350,7 @@ - 60 + 50 0 @@ -354,8 +372,11 @@ - - + + + + 3 + 0 @@ -369,7 +390,7 @@ 0 - + 0 @@ -377,12 +398,15 @@ - Max + Min + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + 0 @@ -391,7 +415,7 @@ - 60 + 50 0 @@ -416,18 +440,25 @@ - - - Show Keyframes Only + + + 0 - - - - - - Show During Playback - - + + + + Show Keyframes Only + + + + + + + Show During Playback + + + + diff --git a/app/ui/timelinepage.ui b/app/ui/timelinepage.ui index bb67929173..90e3c72e20 100644 --- a/app/ui/timelinepage.ui +++ b/app/ui/timelinepage.ui @@ -126,11 +126,6 @@ - - - 10 - - <html><head/><body><p>(Applies to Pencil, Eraser, Pen, Polyline, Bucket and Brush tools)</p></body></html> diff --git a/app/ui/toolboxwidget.ui b/app/ui/toolboxwidget.ui index b2c062096b..a2449d45f8 100644 --- a/app/ui/toolboxwidget.ui +++ b/app/ui/toolboxwidget.ui @@ -6,13 +6,13 @@ 0 0 - 88 + 38 502 - 88 + 38 105 @@ -55,8 +55,8 @@ 0 0 - 88 - 480 + 32 + 477 diff --git a/app/ui/tooloptions.ui b/app/ui/tooloptions.ui index b0ece6541d..ceae06cc47 100644 --- a/app/ui/tooloptions.ui +++ b/app/ui/tooloptions.ui @@ -6,10 +6,16 @@ 0 0 - 174 + 140 355 + + + 140 + 0 + + Form @@ -42,25 +48,25 @@ 0 0 - 164 - 431 + 153 + 340 - false + true - 6 + 3 - 6 + 3 - 6 + 3 - 6 + 3 @@ -135,24 +141,111 @@ - - - Enable or disable feathering - - - Use Feather + + + 0 - - - - - - Show Size and Diff. - - - false - - + + + + Enable or disable feathering + + + Use Feather + + + + + + + Show Size and Diff. + + + false + + + + + + + Contour will be filled + + + Fill Contour + + + + + + + Close Polyline path (hold Ctrl to temporarily invert) + + + Closed Path + + + + + + + Use Bézier curves to create curved lines + + + Bézier + + + + + + + Vary strokes based on pressure when drawing on a tablet + + + Pressure + + + + + + + Use anti-aliasing to create smooth edges + + + Anti-Aliasing + + + + + + + Make invisible + + + Invisible + + + + + + + Preserve Alpha + + + Alpha + + + + + + + Merge vector lines when they are close together + + + Merge + + + + @@ -167,86 +260,6 @@ - - - - Contour will be filled - - - Fill Contour - - - - - - - Use Bézier curves to create curved lines - - - Bézier - - - - - - - Close Polyline path (hold Ctrl to temporarily invert) - - - Closed Path - - - - - - - Vary strokes based on pressure when drawing on a tablet - - - Pressure - - - - - - - Use anti-aliasing to create smooth edges - - - Anti-Aliasing - - - - - - - Make invisible - - - Invisible - - - - - - - Preserve Alpha - - - Alpha - - - - - - - Merge vector lines when they are close together - - - Merge - - -