View Issue Details

IDProjectCategoryView StatusLast Update
0016432ScribusUser Interfacepublic2021-03-21 15:37
Reporterbubu Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.7.svn 
Fixed in Version1.5.7.svn 
Summary0016432: Update layout for Image Effects dialog
DescriptionI propose several changes in Image Effects dialog:
- Change the layout order from left to right and top to bottom. In old layout the attention goes from left to right, than jumps back to left on options. I think this was wrong.
- Fix compressed layout for Quadtone.
- Change margins and spacing to the default as usual.

Please review the patch. Thanks.
TagsNo tags attached.
PatchNo

Relationships

child of 0013906 acknowledged Metabug: UI enhancement proposals (1.5.x.svn) 

Activities

bubu

2021-01-13 22:06

reporter  

0001-Update-layout-for-Image-Effects-dialog.patch (12,887 bytes)   
From e4eda5e75deba634c3143e5267fb63bb95b17b6a Mon Sep 17 00:00:00 2001
Message-Id: <e4eda5e75deba634c3143e5267fb63bb95b17b6a.1610574867.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Wed, 13 Jan 2021 22:54:16 +0100
Subject: [PATCH] Update layout for Image Effects dialog

---
 scribus/ui/effectsdialog.cpp | 131 +++++++++++++++++++----------------
 scribus/ui/effectsdialog.h   |   2 +
 2 files changed, 72 insertions(+), 61 deletions(-)

diff --git a/scribus/ui/effectsdialog.cpp b/scribus/ui/effectsdialog.cpp
index 420f36057..abe704b04 100644
--- a/scribus/ui/effectsdialog.cpp
+++ b/scribus/ui/effectsdialog.cpp
@@ -70,11 +70,20 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 		m_imageScale = qMin(sx, sy);
 	}
 	EffectsDialogLayout = new QHBoxLayout( this );
-	EffectsDialogLayout->setMargin(10);
-	EffectsDialogLayout->setSpacing(5);
+	EffectsDialogLayout->setContentsMargins(9, 9, 9, 9);
+	EffectsDialogLayout->setSpacing(6);
+	layout25 = new QVBoxLayout;
+	layout25->setContentsMargins(0, 0, 0, 0);
+	layout25->setSpacing(6);
+	EffectsDialogLayout->addLayout( layout25 );
+	layout27 = new QHBoxLayout;
+	layout27->setContentsMargins(0, 0, 0, 0);
+	layout27->setSpacing(6);
+	layout25->addLayout( layout27 );
+
 	layout16 = new QVBoxLayout;
-	layout16->setMargin(0);
-	layout16->setSpacing(5);
+	layout16->setContentsMargins(0, 0, 0, 0);
+	layout16->setSpacing(6);
 	pixmapLabel1 = new QLabel( this );
 	pixmapLabel1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 	pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
@@ -88,19 +97,19 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout16->addWidget( textLabel5 );
 	optionStack = new QStackedWidget( this );
 //	optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
-	optionStack->setMinimumSize( QSize( 220, 180 ) );
-	optionStack->setFrameShape( QFrame::Box );
+//	optionStack->setMinimumSize( QSize( 220, 280 ) );
+	optionStack->setFrameShape( QFrame::NoFrame );
 	WStackPage = new QWidget( optionStack );
 	optionStack->addWidget( WStackPage );
 
 	WStackPage_2 = new QWidget( optionStack );
 	WStackPageLayout = new QVBoxLayout( WStackPage_2 );
-	WStackPageLayout->setMargin(5);
-	WStackPageLayout->setSpacing(5);
+	WStackPageLayout->setContentsMargins(0, 0, 0, 0);
+	WStackPageLayout->setSpacing(6);
 	WStackPageLayout->setAlignment( Qt::AlignTop );
 	layout17 = new QHBoxLayout;
-	layout17->setMargin(0);
-	layout17->setSpacing(5);
+	layout17->setContentsMargins(0, 0, 0, 0);
+	layout17->setSpacing(6);
 	textLabel3 = new QLabel( tr( "Color:" ), WStackPage_2 );
 	layout17->addWidget( textLabel3 );
 
@@ -111,8 +120,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	WStackPageLayout->addLayout( layout17 );
 
 	layout19 = new QHBoxLayout;
-	layout19->setMargin(0);
-	layout19->setSpacing(5);
+	layout19->setContentsMargins(0, 0, 0, 0);
+	layout19->setSpacing(6);
 	textLabel4 = new QLabel( tr( "Shade:" ), WStackPage_2 );
 	layout19->addWidget( textLabel4 );
 	shade = new ShadeButton(WStackPage_2);
@@ -123,12 +132,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_3 = new QWidget( optionStack );
 	WStackPage3Layout = new QVBoxLayout( WStackPage_3 );
-	WStackPage3Layout->setMargin(5);
-	WStackPage3Layout->setSpacing(5);
+	WStackPage3Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage3Layout->setSpacing(6);
 	WStackPage3Layout->setAlignment( Qt::AlignTop );
 	layout20 = new QHBoxLayout;
-	layout20->setMargin(0);
-	layout20->setSpacing(5);
+	layout20->setContentsMargins(0, 0, 0, 0);
+	layout20->setSpacing(6);
 	textLabel6 = new QLabel( tr( "Brightness:" ), WStackPage_3 );
 	layout20->addWidget( textLabel6, Qt::AlignLeft );
 	textLabel7 = new QLabel( "0", WStackPage_3 );
@@ -145,12 +154,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_4 = new QWidget( optionStack );
 	WStackPage4Layout = new QVBoxLayout( WStackPage_4 );
-	WStackPage4Layout->setMargin(5);
-	WStackPage4Layout->setSpacing(5);
+	WStackPage4Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage4Layout->setSpacing(6);
 	WStackPage4Layout->setAlignment( Qt::AlignTop );
 	layout21 = new QHBoxLayout;
-	layout21->setMargin(0);
-	layout21->setSpacing(5);
+	layout21->setContentsMargins(0, 0, 0, 0);
+	layout21->setSpacing(6);
 	textLabel8 = new QLabel( tr( "Contrast:" ), WStackPage_4 );
 	layout21->addWidget( textLabel8, Qt::AlignLeft );
 	textLabel9 = new QLabel( "0", WStackPage_4 );
@@ -167,12 +176,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_5 = new QWidget( optionStack );
 	WStackPage5Layout = new QVBoxLayout( WStackPage_5 );
-	WStackPage5Layout->setMargin(5);
-	WStackPage5Layout->setSpacing(5);
+	WStackPage5Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage5Layout->setSpacing(6);
 	WStackPage5Layout->setAlignment( Qt::AlignTop );
 	layout22 = new QHBoxLayout;
-	layout22->setMargin(0);
-	layout22->setSpacing(5);
+	layout22->setContentsMargins(0, 0, 0, 0);
+	layout22->setSpacing(6);
 	textLabel10 = new QLabel( tr( "Radius:" ), WStackPage_5 );
 	layout22->addWidget( textLabel10 );
 	shRadius = new ScrSpinBox( 0.0, 10.0, WStackPage_5, 1 );
@@ -182,8 +191,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout22->addWidget( shRadius );
 	WStackPage5Layout->addLayout( layout22 );
 	layout23 = new QHBoxLayout;
-	layout23->setMargin(0);
-	layout23->setSpacing(5);
+	layout23->setContentsMargins(0, 0, 0, 0);
+	layout23->setSpacing(6);
 	textLabel11 = new QLabel( tr("Value:"), WStackPage_5 );
 	layout23->addWidget( textLabel11 );
 	shValue = new ScrSpinBox( 0.0, 5.0, WStackPage_5, 1 );
@@ -196,12 +205,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_6 = new QWidget( optionStack );
 	WStackPage6Layout = new QVBoxLayout( WStackPage_6 );
-	WStackPage6Layout->setMargin(5);
-	WStackPage6Layout->setSpacing(5);
+	WStackPage6Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage6Layout->setSpacing(6);
 	WStackPage6Layout->setAlignment( Qt::AlignTop );
 	layout24 = new QHBoxLayout;
-	layout24->setMargin(0);
-	layout24->setSpacing(5);
+	layout24->setContentsMargins(0, 0, 0, 0);
+	layout24->setSpacing(6);
 	textLabel12 = new QLabel( tr( "Radius:" ), WStackPage_6 );
 	layout24->addWidget( textLabel12 );
 	blRadius = new ScrSpinBox( 0.0, 30.0, WStackPage_6, 1 );
@@ -214,12 +223,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_7 = new QWidget( optionStack );
 	WStackPage7Layout = new QVBoxLayout( WStackPage_7 );
-	WStackPage7Layout->setMargin(5);
-	WStackPage7Layout->setSpacing(5);
+	WStackPage7Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage7Layout->setSpacing(6);
 	WStackPage7Layout->setAlignment( Qt::AlignTop );
 	layout26 = new QHBoxLayout;
-	layout26->setMargin(0);
-	layout26->setSpacing(5);
+	layout26->setContentsMargins(0, 0, 0, 0);
+	layout26->setSpacing(6);
 	textLabel14 = new QLabel( tr( "Posterize:" ), WStackPage_7 );
 	layout26->addWidget( textLabel14, Qt::AlignLeft );
 	textLabel15 = new QLabel( "0", WStackPage_7 );
@@ -236,8 +245,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_8 = new QWidget( optionStack );
 	WStackPage8Layout = new QGridLayout( WStackPage_8 );
-	WStackPage8Layout->setMargin(4);
-	WStackPage8Layout->setSpacing(5);
+	WStackPage8Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage8Layout->setSpacing(6);
 	WStackPage8Layout->setAlignment( Qt::AlignTop );
 	textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8 );
 	WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
@@ -288,8 +297,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_9 = new QWidget( optionStack );
 	WStackPage9Layout = new QGridLayout( WStackPage_9 );
-	WStackPage9Layout->setMargin(4);
-	WStackPage9Layout->setSpacing(5);
+	WStackPage9Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage9Layout->setSpacing(6);
 	WStackPage9Layout->setAlignment( Qt::AlignTop );
 	textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9 );
 	WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
@@ -358,8 +367,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_10 = new QWidget( optionStack );
 	WStackPage10Layout = new QGridLayout( WStackPage_10 );
-	WStackPage10Layout->setMargin(4);
-	WStackPage10Layout->setSpacing(5);
+	WStackPage10Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage10Layout->setSpacing(6);
 	textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10 );
 	WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
 	colDataq1 = new ColorCombo(false, WStackPage_10);
@@ -448,25 +457,22 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_11 = new QWidget( optionStack );
 	WStackPage11Layout = new QVBoxLayout( WStackPage_11 );
-	WStackPage11Layout->setMargin(5);
-	WStackPage11Layout->setSpacing(5);
+	WStackPage11Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage11Layout->setSpacing(6);
 	WStackPage11Layout->setAlignment( Qt::AlignTop );
 	Kdisplay = new CurveWidget(WStackPage_11);
 	WStackPage11Layout->addWidget( Kdisplay );
 	optionStack->addWidget( WStackPage_11 );
 
-	layout16->addWidget( optionStack );
-	EffectsDialogLayout->addLayout( layout16 );
-
 	layout18 = new QVBoxLayout;
-	layout18->setMargin(0);
-	layout18->setSpacing(5);
+	layout18->setContentsMargins(0, 0, 0, 0);
+	layout18->setSpacing(6);
 	layout10 = new QGridLayout;
-	layout10->setMargin(0);
-	layout10->setSpacing(5);
+	layout10->setContentsMargins(0, 0, 0, 0);
+	layout10->setSpacing(6);
 	layout2 = new QVBoxLayout;
-	layout2->setMargin(0);
-	layout2->setSpacing(5);
+	layout2->setContentsMargins(0, 0, 0, 0);
+	layout2->setSpacing(6);
 	textLabel1 = new QLabel( this );
 	textLabel1->setText( tr( "Available Effects" ) );
 	layout2->addWidget( textLabel1 );
@@ -493,8 +499,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout(layout2, 0, 0);
 
 	layout1 = new QVBoxLayout;
-	layout1->setMargin(0);
-	layout1->setSpacing(5);
+	layout1->setContentsMargins(0, 0, 0, 0);
+	layout1->setSpacing(6);
 	auto* spacer1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	layout1->addItem( spacer1 );
 	toEffects = new QPushButton( this );
@@ -510,8 +516,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout( layout1, 0, 1 );
 
 	layout8 = new QVBoxLayout;
-	layout8->setMargin(0);
-	layout8->setSpacing(5);
+	layout8->setContentsMargins(0, 0, 0, 0);
+	layout8->setSpacing(6);
 	textLabel2 = new QLabel( this );
 	textLabel2->setText( tr( "Applied Effects" ) );
 	layout8->addWidget( textLabel2 );
@@ -605,8 +611,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	}
 	layout8->addWidget( usedEffects );
 	layout7 = new QHBoxLayout;
-	layout7->setMargin(0);
-	layout7->setSpacing(5);
+	layout7->setContentsMargins(0, 0, 0, 0);
+	layout7->setSpacing(6);
 	QSpacerItem* spacer4 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
 	layout7->addItem( spacer4 );
 	effectUp = new QPushButton( this );
@@ -625,9 +631,13 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout( layout8, 0, 2 );
 	layout18->addLayout( layout10 );
 
+	layout27->addLayout( layout18 );
+	layout16->addWidget( optionStack );
+	layout27->addLayout( layout16 );
+
 	layout9 = new QHBoxLayout;
-	layout9->setMargin(0);
-	layout9->setSpacing(5);
+	layout9->setContentsMargins(0, 0, 0, 0);
+	layout9->setSpacing(6);
 	QSpacerItem* spacer3 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
 	layout9->addItem( spacer3 );
 
@@ -638,8 +648,7 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	cancelButton = new QPushButton( this );
 	cancelButton->setText( tr( "Cancel" ) );
 	layout9->addWidget( cancelButton );
-	layout18->addLayout( layout9 );
-	EffectsDialogLayout->addLayout( layout18 );
+	layout25->addLayout( layout9 );
 	optionStack->setCurrentIndex(0);
 	usedEffects->clearSelection();
 	availableEffects->clearSelection();
diff --git a/scribus/ui/effectsdialog.h b/scribus/ui/effectsdialog.h
index b89ff8cfd..80bc09580 100644
--- a/scribus/ui/effectsdialog.h
+++ b/scribus/ui/effectsdialog.h
@@ -212,6 +212,8 @@ protected:
 	QVBoxLayout* layout16;
 	QVBoxLayout* layout18;
 	QHBoxLayout* layout9;
+	QVBoxLayout* layout25;
+	QHBoxLayout* layout27;
 };
 
 #endif // EFFECTSDIALOG_H
-- 
2.27.0

image_effects.gif (148,718 bytes)   
image_effects.gif (148,718 bytes)   

PeterBenedek

2021-01-14 08:53

developer   ~0048690

In this case above "ok" and "cancel" button the place is too small.

bubu

2021-01-17 12:48

reporter   ~0048699

@PeterBenedek, there is a standard 6px spacing. it is OK.
Or... we can put the "Options" section to a group box with a border and another 9px margin. Do I do such a patch?

PeterBenedek

2021-01-17 14:47

developer   ~0048700

Only an idea...

PeterBenedek

2021-01-17 15:05

developer  

ImageEffects.png (79,289 bytes)   
ImageEffects.png (79,289 bytes)   

PeterBenedek

2021-01-17 15:15

developer   ~0048701

Last edited: 2021-01-17 16:13

...and added "Preview" title

ImageEffects_02.png (94,059 bytes)   
ImageEffects_02.png (94,059 bytes)   

bubu

2021-01-17 18:04

reporter   ~0048703

@PeterBenedek, here is my proposal, inspired by your mockup. It should be applied after previous "0001-Update-layout-for-Image-Effects-dialog.patch" patch.
0001-Layout-inspired-by-Benedek.patch (4,417 bytes)   
From c475c036ab4402b56ae19cc600bf5967322e786f Mon Sep 17 00:00:00 2001
Message-Id: <c475c036ab4402b56ae19cc600bf5967322e786f.1610906482.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sun, 17 Jan 2021 19:01:09 +0100
Subject: [PATCH] Layout inspired by Benedek

---
 scribus/ui/effectsdialog.cpp | 30 ++++++++++--------------------
 scribus/ui/effectsdialog.h   |  2 +-
 2 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/scribus/ui/effectsdialog.cpp b/scribus/ui/effectsdialog.cpp
index abe704b04..12e7949a1 100644
--- a/scribus/ui/effectsdialog.cpp
+++ b/scribus/ui/effectsdialog.cpp
@@ -84,6 +84,9 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout16 = new QVBoxLayout;
 	layout16->setContentsMargins(0, 0, 0, 0);
 	layout16->setSpacing(6);
+	textLabel16 = new QLabel( this );
+	textLabel16->setText( tr( "Preview" ) );
+	layout16->addWidget( textLabel16 );
 	pixmapLabel1 = new QLabel( this );
 	pixmapLabel1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 	pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
@@ -93,7 +96,7 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	pixmapLabel1->setScaledContents( false );
 	layout16->addWidget( pixmapLabel1 );
 	textLabel5 = new QLabel( this );
-	textLabel5->setText( tr( "Options:" ) );
+	textLabel5->setText( tr( "Options" ) );
 	layout16->addWidget( textLabel5 );
 	optionStack = new QStackedWidget( this );
 //	optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
@@ -496,24 +499,11 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	availableEffects->setMinimumSize(availableEffectsAdvance + 40, 180);
 	layout2->addWidget(availableEffects);
-	layout10->addLayout(layout2, 0, 0);
-
-	layout1 = new QVBoxLayout;
-	layout1->setContentsMargins(0, 0, 0, 0);
-	layout1->setSpacing(6);
-	auto* spacer1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer1 );
 	toEffects = new QPushButton( this );
 	toEffects->setText( tr( "Add" ) );
 	toEffects->setEnabled(false);
-	layout1->addWidget( toEffects );
-	fromEffects = new QPushButton( this );
-	fromEffects->setText( tr( "Remove" ) );
-	fromEffects->setEnabled(false);
-	layout1->addWidget( fromEffects );
-	auto* spacer2 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer2 );
-	layout10->addLayout( layout1, 0, 1 );
+	layout2->addWidget( toEffects );
+	layout10->addLayout(layout2, 0, 0);
 
 	layout8 = new QVBoxLayout;
 	layout8->setContentsMargins(0, 0, 0, 0);
@@ -613,8 +603,10 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout7 = new QHBoxLayout;
 	layout7->setContentsMargins(0, 0, 0, 0);
 	layout7->setSpacing(6);
-	QSpacerItem* spacer4 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer4 );
+	fromEffects = new QPushButton( this );
+	fromEffects->setText( tr( "Remove" ) );
+	fromEffects->setEnabled(false);
+	layout7->addWidget( fromEffects );
 	effectUp = new QPushButton( this );
 	effectUp->setText( "" );
 	effectUp->setIcon(IconManager::instance().loadIcon("16/go-up.png"));
@@ -625,8 +617,6 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	effectDown->setIcon(IconManager::instance().loadIcon("16/go-down.png"));
 	effectDown->setEnabled(false);
 	layout7->addWidget( effectDown );
-	QSpacerItem* spacer5 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer5 );
 	layout8->addLayout( layout7 );
 	layout10->addLayout( layout8, 0, 2 );
 	layout18->addLayout( layout10 );
diff --git a/scribus/ui/effectsdialog.h b/scribus/ui/effectsdialog.h
index 80bc09580..4a359ada9 100644
--- a/scribus/ui/effectsdialog.h
+++ b/scribus/ui/effectsdialog.h
@@ -60,6 +60,7 @@ public:
 	QLabel* textLabel12;
 	QLabel* textLabel14;
 	QLabel* textLabel15;
+	QLabel* textLabel16;
 	QStackedWidget* optionStack;
 	QWidget* WStackPage;
 	QWidget* WStackPage_2;
@@ -207,7 +208,6 @@ protected:
 	QGridLayout* layout10;
 	QVBoxLayout* layout8;
 	QHBoxLayout* layout7;
-	QVBoxLayout* layout1;
 	QVBoxLayout* layout2;
 	QVBoxLayout* layout16;
 	QVBoxLayout* layout18;
-- 
2.27.0

jghali

2021-01-18 09:37

administrator   ~0048710

Last edited: 2021-01-18 09:37

>> Or... we can put the "Options" section to a group box with a border and another 9px margin. Do I do such a patch?

I tend to think that options should indeed be in a frame or a groupbox, cannot say however if I prefer the first or second version of the patch...

bubu

2021-01-23 00:06

reporter   ~0048742

OK, thanks for replay. Here I propose two competing patches (overwriting previous proposals):
A) First proposal + added a group box for options.
B) Benedek Peter's proposal + added a group box for options.
I hope you like one of these proposals. Proposal A) is a little bit conservative, proposal B) is bolder.

Please review them and correct them if necessary. Thanks.
image_effect_A.diff (13,944 bytes)   
diff --git a/scribus/ui/effectsdialog.cpp b/scribus/ui/effectsdialog.cpp
index 420f3605719a179dadc21ca4a603ce4f0f00e080..b7e67c7aef6f27616fbebefe30eef3157ae481c2 100644
--- a/scribus/ui/effectsdialog.cpp
+++ b/scribus/ui/effectsdialog.cpp
@@ -23,6 +23,8 @@ for which a new license (GPL+exception) is in place.
 #include <QWidgetAction>
 #include <QTime>
 #include <QStackedWidget>
+#include <QGroupBox>
+#include <QSpacerItem>
 
 #include "cmsettings.h"
 #include "colorcombo.h"
@@ -70,11 +72,20 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 		m_imageScale = qMin(sx, sy);
 	}
 	EffectsDialogLayout = new QHBoxLayout( this );
-	EffectsDialogLayout->setMargin(10);
-	EffectsDialogLayout->setSpacing(5);
+	EffectsDialogLayout->setContentsMargins(9, 9, 9, 9);
+	EffectsDialogLayout->setSpacing(6);
+	layout25 = new QVBoxLayout;
+	layout25->setContentsMargins(0, 0, 0, 0);
+	layout25->setSpacing(6);
+	EffectsDialogLayout->addLayout( layout25 );
+	layout27 = new QHBoxLayout;
+	layout27->setContentsMargins(0, 0, 0, 0);
+	layout27->setSpacing(6);
+	layout25->addLayout( layout27 );
+
 	layout16 = new QVBoxLayout;
-	layout16->setMargin(0);
-	layout16->setSpacing(5);
+	layout16->setContentsMargins(0, 0, 0, 0);
+	layout16->setSpacing(6);
 	pixmapLabel1 = new QLabel( this );
 	pixmapLabel1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 	pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
@@ -83,24 +94,21 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	pixmapLabel1->setFrameShadow( QLabel::Sunken );
 	pixmapLabel1->setScaledContents( false );
 	layout16->addWidget( pixmapLabel1 );
-	textLabel5 = new QLabel( this );
-	textLabel5->setText( tr( "Options:" ) );
-	layout16->addWidget( textLabel5 );
 	optionStack = new QStackedWidget( this );
 //	optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
-	optionStack->setMinimumSize( QSize( 220, 180 ) );
-	optionStack->setFrameShape( QFrame::Box );
+//	optionStack->setMinimumSize( QSize( 220, 280 ) );
+	optionStack->setFrameShape( QFrame::NoFrame );
 	WStackPage = new QWidget( optionStack );
 	optionStack->addWidget( WStackPage );
 
 	WStackPage_2 = new QWidget( optionStack );
 	WStackPageLayout = new QVBoxLayout( WStackPage_2 );
-	WStackPageLayout->setMargin(5);
-	WStackPageLayout->setSpacing(5);
+	WStackPageLayout->setContentsMargins(0, 0, 0, 0);
+	WStackPageLayout->setSpacing(6);
 	WStackPageLayout->setAlignment( Qt::AlignTop );
 	layout17 = new QHBoxLayout;
-	layout17->setMargin(0);
-	layout17->setSpacing(5);
+	layout17->setContentsMargins(0, 0, 0, 0);
+	layout17->setSpacing(6);
 	textLabel3 = new QLabel( tr( "Color:" ), WStackPage_2 );
 	layout17->addWidget( textLabel3 );
 
@@ -111,8 +119,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	WStackPageLayout->addLayout( layout17 );
 
 	layout19 = new QHBoxLayout;
-	layout19->setMargin(0);
-	layout19->setSpacing(5);
+	layout19->setContentsMargins(0, 0, 0, 0);
+	layout19->setSpacing(6);
 	textLabel4 = new QLabel( tr( "Shade:" ), WStackPage_2 );
 	layout19->addWidget( textLabel4 );
 	shade = new ShadeButton(WStackPage_2);
@@ -123,12 +131,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_3 = new QWidget( optionStack );
 	WStackPage3Layout = new QVBoxLayout( WStackPage_3 );
-	WStackPage3Layout->setMargin(5);
-	WStackPage3Layout->setSpacing(5);
+	WStackPage3Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage3Layout->setSpacing(6);
 	WStackPage3Layout->setAlignment( Qt::AlignTop );
 	layout20 = new QHBoxLayout;
-	layout20->setMargin(0);
-	layout20->setSpacing(5);
+	layout20->setContentsMargins(0, 0, 0, 0);
+	layout20->setSpacing(6);
 	textLabel6 = new QLabel( tr( "Brightness:" ), WStackPage_3 );
 	layout20->addWidget( textLabel6, Qt::AlignLeft );
 	textLabel7 = new QLabel( "0", WStackPage_3 );
@@ -145,12 +153,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_4 = new QWidget( optionStack );
 	WStackPage4Layout = new QVBoxLayout( WStackPage_4 );
-	WStackPage4Layout->setMargin(5);
-	WStackPage4Layout->setSpacing(5);
+	WStackPage4Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage4Layout->setSpacing(6);
 	WStackPage4Layout->setAlignment( Qt::AlignTop );
 	layout21 = new QHBoxLayout;
-	layout21->setMargin(0);
-	layout21->setSpacing(5);
+	layout21->setContentsMargins(0, 0, 0, 0);
+	layout21->setSpacing(6);
 	textLabel8 = new QLabel( tr( "Contrast:" ), WStackPage_4 );
 	layout21->addWidget( textLabel8, Qt::AlignLeft );
 	textLabel9 = new QLabel( "0", WStackPage_4 );
@@ -167,12 +175,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_5 = new QWidget( optionStack );
 	WStackPage5Layout = new QVBoxLayout( WStackPage_5 );
-	WStackPage5Layout->setMargin(5);
-	WStackPage5Layout->setSpacing(5);
+	WStackPage5Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage5Layout->setSpacing(6);
 	WStackPage5Layout->setAlignment( Qt::AlignTop );
 	layout22 = new QHBoxLayout;
-	layout22->setMargin(0);
-	layout22->setSpacing(5);
+	layout22->setContentsMargins(0, 0, 0, 0);
+	layout22->setSpacing(6);
 	textLabel10 = new QLabel( tr( "Radius:" ), WStackPage_5 );
 	layout22->addWidget( textLabel10 );
 	shRadius = new ScrSpinBox( 0.0, 10.0, WStackPage_5, 1 );
@@ -182,8 +190,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout22->addWidget( shRadius );
 	WStackPage5Layout->addLayout( layout22 );
 	layout23 = new QHBoxLayout;
-	layout23->setMargin(0);
-	layout23->setSpacing(5);
+	layout23->setContentsMargins(0, 0, 0, 0);
+	layout23->setSpacing(6);
 	textLabel11 = new QLabel( tr("Value:"), WStackPage_5 );
 	layout23->addWidget( textLabel11 );
 	shValue = new ScrSpinBox( 0.0, 5.0, WStackPage_5, 1 );
@@ -196,12 +204,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_6 = new QWidget( optionStack );
 	WStackPage6Layout = new QVBoxLayout( WStackPage_6 );
-	WStackPage6Layout->setMargin(5);
-	WStackPage6Layout->setSpacing(5);
+	WStackPage6Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage6Layout->setSpacing(6);
 	WStackPage6Layout->setAlignment( Qt::AlignTop );
 	layout24 = new QHBoxLayout;
-	layout24->setMargin(0);
-	layout24->setSpacing(5);
+	layout24->setContentsMargins(0, 0, 0, 0);
+	layout24->setSpacing(6);
 	textLabel12 = new QLabel( tr( "Radius:" ), WStackPage_6 );
 	layout24->addWidget( textLabel12 );
 	blRadius = new ScrSpinBox( 0.0, 30.0, WStackPage_6, 1 );
@@ -214,12 +222,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_7 = new QWidget( optionStack );
 	WStackPage7Layout = new QVBoxLayout( WStackPage_7 );
-	WStackPage7Layout->setMargin(5);
-	WStackPage7Layout->setSpacing(5);
+	WStackPage7Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage7Layout->setSpacing(6);
 	WStackPage7Layout->setAlignment( Qt::AlignTop );
 	layout26 = new QHBoxLayout;
-	layout26->setMargin(0);
-	layout26->setSpacing(5);
+	layout26->setContentsMargins(0, 0, 0, 0);
+	layout26->setSpacing(6);
 	textLabel14 = new QLabel( tr( "Posterize:" ), WStackPage_7 );
 	layout26->addWidget( textLabel14, Qt::AlignLeft );
 	textLabel15 = new QLabel( "0", WStackPage_7 );
@@ -236,8 +244,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_8 = new QWidget( optionStack );
 	WStackPage8Layout = new QGridLayout( WStackPage_8 );
-	WStackPage8Layout->setMargin(4);
-	WStackPage8Layout->setSpacing(5);
+	WStackPage8Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage8Layout->setSpacing(6);
 	WStackPage8Layout->setAlignment( Qt::AlignTop );
 	textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8 );
 	WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
@@ -288,8 +296,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_9 = new QWidget( optionStack );
 	WStackPage9Layout = new QGridLayout( WStackPage_9 );
-	WStackPage9Layout->setMargin(4);
-	WStackPage9Layout->setSpacing(5);
+	WStackPage9Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage9Layout->setSpacing(6);
 	WStackPage9Layout->setAlignment( Qt::AlignTop );
 	textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9 );
 	WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
@@ -358,8 +366,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_10 = new QWidget( optionStack );
 	WStackPage10Layout = new QGridLayout( WStackPage_10 );
-	WStackPage10Layout->setMargin(4);
-	WStackPage10Layout->setSpacing(5);
+	WStackPage10Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage10Layout->setSpacing(6);
 	textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10 );
 	WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
 	colDataq1 = new ColorCombo(false, WStackPage_10);
@@ -448,25 +456,24 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_11 = new QWidget( optionStack );
 	WStackPage11Layout = new QVBoxLayout( WStackPage_11 );
-	WStackPage11Layout->setMargin(5);
-	WStackPage11Layout->setSpacing(5);
+	WStackPage11Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage11Layout->setSpacing(6);
 	WStackPage11Layout->setAlignment( Qt::AlignTop );
 	Kdisplay = new CurveWidget(WStackPage_11);
 	WStackPage11Layout->addWidget( Kdisplay );
+	spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+	WStackPage11Layout->addItem( spacer );
 	optionStack->addWidget( WStackPage_11 );
 
-	layout16->addWidget( optionStack );
-	EffectsDialogLayout->addLayout( layout16 );
-
 	layout18 = new QVBoxLayout;
-	layout18->setMargin(0);
-	layout18->setSpacing(5);
+	layout18->setContentsMargins(0, 0, 0, 0);
+	layout18->setSpacing(6);
 	layout10 = new QGridLayout;
-	layout10->setMargin(0);
-	layout10->setSpacing(5);
+	layout10->setContentsMargins(0, 0, 0, 0);
+	layout10->setSpacing(6);
 	layout2 = new QVBoxLayout;
-	layout2->setMargin(0);
-	layout2->setSpacing(5);
+	layout2->setContentsMargins(0, 0, 0, 0);
+	layout2->setSpacing(6);
 	textLabel1 = new QLabel( this );
 	textLabel1->setText( tr( "Available Effects" ) );
 	layout2->addWidget( textLabel1 );
@@ -493,8 +500,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout(layout2, 0, 0);
 
 	layout1 = new QVBoxLayout;
-	layout1->setMargin(0);
-	layout1->setSpacing(5);
+	layout1->setContentsMargins(0, 0, 0, 0);
+	layout1->setSpacing(6);
 	auto* spacer1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
 	layout1->addItem( spacer1 );
 	toEffects = new QPushButton( this );
@@ -510,8 +517,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout( layout1, 0, 1 );
 
 	layout8 = new QVBoxLayout;
-	layout8->setMargin(0);
-	layout8->setSpacing(5);
+	layout8->setContentsMargins(0, 0, 0, 0);
+	layout8->setSpacing(6);
 	textLabel2 = new QLabel( this );
 	textLabel2->setText( tr( "Applied Effects" ) );
 	layout8->addWidget( textLabel2 );
@@ -605,8 +612,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	}
 	layout8->addWidget( usedEffects );
 	layout7 = new QHBoxLayout;
-	layout7->setMargin(0);
-	layout7->setSpacing(5);
+	layout7->setContentsMargins(0, 0, 0, 0);
+	layout7->setSpacing(6);
 	QSpacerItem* spacer4 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
 	layout7->addItem( spacer4 );
 	effectUp = new QPushButton( this );
@@ -625,9 +632,21 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout10->addLayout( layout8, 0, 2 );
 	layout18->addLayout( layout10 );
 
+	groupBox = new QGroupBox( this );
+	groupBox->setTitle( tr( "Options:" ) );
+	layout28 = new QVBoxLayout( groupBox );
+	layout28->addWidget( optionStack );
+	layout28->setAlignment( Qt::AlignTop );
+	layout28->setSpacing(6);
+	layout28->setContentsMargins(9, 9, 9, 9);
+	layout16->addWidget( groupBox );
+
+	layout27->addLayout( layout18 );
+	layout27->addLayout( layout16 );
+
 	layout9 = new QHBoxLayout;
-	layout9->setMargin(0);
-	layout9->setSpacing(5);
+	layout9->setContentsMargins(0, 0, 0, 0);
+	layout9->setSpacing(6);
 	QSpacerItem* spacer3 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
 	layout9->addItem( spacer3 );
 
@@ -638,8 +657,7 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	cancelButton = new QPushButton( this );
 	cancelButton->setText( tr( "Cancel" ) );
 	layout9->addWidget( cancelButton );
-	layout18->addLayout( layout9 );
-	EffectsDialogLayout->addLayout( layout18 );
+	layout25->addLayout( layout9 );
 	optionStack->setCurrentIndex(0);
 	usedEffects->clearSelection();
 	availableEffects->clearSelection();
diff --git a/scribus/ui/effectsdialog.h b/scribus/ui/effectsdialog.h
index b89ff8cfdf64d6c3d25d54ba8d0dc867acc432f0..f4a4d7cbea954aaa92ff8cbd972b70faea5da273 100644
--- a/scribus/ui/effectsdialog.h
+++ b/scribus/ui/effectsdialog.h
@@ -34,6 +34,8 @@ class QListWidgetItem;
 class QListWidget;
 class ScrSpinBox;
 class CurveWidget;
+class QGroupBox;
+class QSpacerItem;
 
 class SCRIBUS_API EffectsDialog : public QDialog
 {
@@ -50,7 +52,6 @@ public:
 	QLabel* textLabel2;
 	QLabel* textLabel3;
 	QLabel* textLabel4;
-	QLabel* textLabel5;
 	QLabel* textLabel6;
 	QLabel* textLabel7;
 	QLabel* textLabel8;
@@ -158,6 +159,9 @@ public:
 	QPushButton* cancelButton;
 	QListWidgetItem* currentOptions;
 
+	QGroupBox *groupBox;
+	QSpacerItem* spacer;
+
 	ScImageEffectList effectsList;
 
 public slots:
@@ -212,6 +216,9 @@ protected:
 	QVBoxLayout* layout16;
 	QVBoxLayout* layout18;
 	QHBoxLayout* layout9;
+	QVBoxLayout* layout25;
+	QHBoxLayout* layout27;
+	QVBoxLayout* layout28;
 };
 
 #endif // EFFECTSDIALOG_H
image_effect_A.diff (13,944 bytes)   
image_effect_B.patch (15,720 bytes)   
From 118c4392049ec03e6c91ea2729edfa366ac4a24b Mon Sep 17 00:00:00 2001
Message-Id: <118c4392049ec03e6c91ea2729edfa366ac4a24b.1611359778.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sat, 23 Jan 2021 00:56:08 +0100
Subject: [PATCH] Update layout for Image Effects dialog

---
 scribus/ui/effectsdialog.cpp | 170 ++++++++++++++++++-----------------
 scribus/ui/effectsdialog.h   |  11 ++-
 2 files changed, 98 insertions(+), 83 deletions(-)

diff --git a/scribus/ui/effectsdialog.cpp b/scribus/ui/effectsdialog.cpp
index 420f36057..02af086a8 100644
--- a/scribus/ui/effectsdialog.cpp
+++ b/scribus/ui/effectsdialog.cpp
@@ -23,6 +23,8 @@ for which a new license (GPL+exception) is in place.
 #include <QWidgetAction>
 #include <QTime>
 #include <QStackedWidget>
+#include <QGroupBox>
+#include <QSpacerItem>
 
 #include "cmsettings.h"
 #include "colorcombo.h"
@@ -70,11 +72,23 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 		m_imageScale = qMin(sx, sy);
 	}
 	EffectsDialogLayout = new QHBoxLayout( this );
-	EffectsDialogLayout->setMargin(10);
-	EffectsDialogLayout->setSpacing(5);
+	EffectsDialogLayout->setContentsMargins(9, 9, 9, 9);
+	EffectsDialogLayout->setSpacing(6);
+	layout25 = new QVBoxLayout;
+	layout25->setContentsMargins(0, 0, 0, 0);
+	layout25->setSpacing(6);
+	EffectsDialogLayout->addLayout( layout25 );
+	layout27 = new QHBoxLayout;
+	layout27->setContentsMargins(0, 0, 0, 0);
+	layout27->setSpacing(6);
+	layout25->addLayout( layout27 );
+
 	layout16 = new QVBoxLayout;
-	layout16->setMargin(0);
-	layout16->setSpacing(5);
+	layout16->setContentsMargins(0, 0, 0, 0);
+	layout16->setSpacing(6);
+	textLabel16 = new QLabel( this );
+	textLabel16->setText( tr( "Preview" ) );
+	layout16->addWidget( textLabel16 );
 	pixmapLabel1 = new QLabel( this );
 	pixmapLabel1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 	pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
@@ -83,24 +97,21 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	pixmapLabel1->setFrameShadow( QLabel::Sunken );
 	pixmapLabel1->setScaledContents( false );
 	layout16->addWidget( pixmapLabel1 );
-	textLabel5 = new QLabel( this );
-	textLabel5->setText( tr( "Options:" ) );
-	layout16->addWidget( textLabel5 );
 	optionStack = new QStackedWidget( this );
 //	optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
-	optionStack->setMinimumSize( QSize( 220, 180 ) );
-	optionStack->setFrameShape( QFrame::Box );
+//	optionStack->setMinimumSize( QSize( 220, 280 ) );
+	optionStack->setFrameShape( QFrame::NoFrame );
 	WStackPage = new QWidget( optionStack );
 	optionStack->addWidget( WStackPage );
 
 	WStackPage_2 = new QWidget( optionStack );
 	WStackPageLayout = new QVBoxLayout( WStackPage_2 );
-	WStackPageLayout->setMargin(5);
-	WStackPageLayout->setSpacing(5);
+	WStackPageLayout->setContentsMargins(0, 0, 0, 0);
+	WStackPageLayout->setSpacing(6);
 	WStackPageLayout->setAlignment( Qt::AlignTop );
 	layout17 = new QHBoxLayout;
-	layout17->setMargin(0);
-	layout17->setSpacing(5);
+	layout17->setContentsMargins(0, 0, 0, 0);
+	layout17->setSpacing(6);
 	textLabel3 = new QLabel( tr( "Color:" ), WStackPage_2 );
 	layout17->addWidget( textLabel3 );
 
@@ -111,8 +122,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	WStackPageLayout->addLayout( layout17 );
 
 	layout19 = new QHBoxLayout;
-	layout19->setMargin(0);
-	layout19->setSpacing(5);
+	layout19->setContentsMargins(0, 0, 0, 0);
+	layout19->setSpacing(6);
 	textLabel4 = new QLabel( tr( "Shade:" ), WStackPage_2 );
 	layout19->addWidget( textLabel4 );
 	shade = new ShadeButton(WStackPage_2);
@@ -123,12 +134,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_3 = new QWidget( optionStack );
 	WStackPage3Layout = new QVBoxLayout( WStackPage_3 );
-	WStackPage3Layout->setMargin(5);
-	WStackPage3Layout->setSpacing(5);
+	WStackPage3Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage3Layout->setSpacing(6);
 	WStackPage3Layout->setAlignment( Qt::AlignTop );
 	layout20 = new QHBoxLayout;
-	layout20->setMargin(0);
-	layout20->setSpacing(5);
+	layout20->setContentsMargins(0, 0, 0, 0);
+	layout20->setSpacing(6);
 	textLabel6 = new QLabel( tr( "Brightness:" ), WStackPage_3 );
 	layout20->addWidget( textLabel6, Qt::AlignLeft );
 	textLabel7 = new QLabel( "0", WStackPage_3 );
@@ -145,12 +156,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_4 = new QWidget( optionStack );
 	WStackPage4Layout = new QVBoxLayout( WStackPage_4 );
-	WStackPage4Layout->setMargin(5);
-	WStackPage4Layout->setSpacing(5);
+	WStackPage4Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage4Layout->setSpacing(6);
 	WStackPage4Layout->setAlignment( Qt::AlignTop );
 	layout21 = new QHBoxLayout;
-	layout21->setMargin(0);
-	layout21->setSpacing(5);
+	layout21->setContentsMargins(0, 0, 0, 0);
+	layout21->setSpacing(6);
 	textLabel8 = new QLabel( tr( "Contrast:" ), WStackPage_4 );
 	layout21->addWidget( textLabel8, Qt::AlignLeft );
 	textLabel9 = new QLabel( "0", WStackPage_4 );
@@ -167,12 +178,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_5 = new QWidget( optionStack );
 	WStackPage5Layout = new QVBoxLayout( WStackPage_5 );
-	WStackPage5Layout->setMargin(5);
-	WStackPage5Layout->setSpacing(5);
+	WStackPage5Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage5Layout->setSpacing(6);
 	WStackPage5Layout->setAlignment( Qt::AlignTop );
 	layout22 = new QHBoxLayout;
-	layout22->setMargin(0);
-	layout22->setSpacing(5);
+	layout22->setContentsMargins(0, 0, 0, 0);
+	layout22->setSpacing(6);
 	textLabel10 = new QLabel( tr( "Radius:" ), WStackPage_5 );
 	layout22->addWidget( textLabel10 );
 	shRadius = new ScrSpinBox( 0.0, 10.0, WStackPage_5, 1 );
@@ -182,8 +193,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout22->addWidget( shRadius );
 	WStackPage5Layout->addLayout( layout22 );
 	layout23 = new QHBoxLayout;
-	layout23->setMargin(0);
-	layout23->setSpacing(5);
+	layout23->setContentsMargins(0, 0, 0, 0);
+	layout23->setSpacing(6);
 	textLabel11 = new QLabel( tr("Value:"), WStackPage_5 );
 	layout23->addWidget( textLabel11 );
 	shValue = new ScrSpinBox( 0.0, 5.0, WStackPage_5, 1 );
@@ -196,12 +207,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_6 = new QWidget( optionStack );
 	WStackPage6Layout = new QVBoxLayout( WStackPage_6 );
-	WStackPage6Layout->setMargin(5);
-	WStackPage6Layout->setSpacing(5);
+	WStackPage6Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage6Layout->setSpacing(6);
 	WStackPage6Layout->setAlignment( Qt::AlignTop );
 	layout24 = new QHBoxLayout;
-	layout24->setMargin(0);
-	layout24->setSpacing(5);
+	layout24->setContentsMargins(0, 0, 0, 0);
+	layout24->setSpacing(6);
 	textLabel12 = new QLabel( tr( "Radius:" ), WStackPage_6 );
 	layout24->addWidget( textLabel12 );
 	blRadius = new ScrSpinBox( 0.0, 30.0, WStackPage_6, 1 );
@@ -214,12 +225,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_7 = new QWidget( optionStack );
 	WStackPage7Layout = new QVBoxLayout( WStackPage_7 );
-	WStackPage7Layout->setMargin(5);
-	WStackPage7Layout->setSpacing(5);
+	WStackPage7Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage7Layout->setSpacing(6);
 	WStackPage7Layout->setAlignment( Qt::AlignTop );
 	layout26 = new QHBoxLayout;
-	layout26->setMargin(0);
-	layout26->setSpacing(5);
+	layout26->setContentsMargins(0, 0, 0, 0);
+	layout26->setSpacing(6);
 	textLabel14 = new QLabel( tr( "Posterize:" ), WStackPage_7 );
 	layout26->addWidget( textLabel14, Qt::AlignLeft );
 	textLabel15 = new QLabel( "0", WStackPage_7 );
@@ -236,8 +247,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_8 = new QWidget( optionStack );
 	WStackPage8Layout = new QGridLayout( WStackPage_8 );
-	WStackPage8Layout->setMargin(4);
-	WStackPage8Layout->setSpacing(5);
+	WStackPage8Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage8Layout->setSpacing(6);
 	WStackPage8Layout->setAlignment( Qt::AlignTop );
 	textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8 );
 	WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
@@ -288,8 +299,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_9 = new QWidget( optionStack );
 	WStackPage9Layout = new QGridLayout( WStackPage_9 );
-	WStackPage9Layout->setMargin(4);
-	WStackPage9Layout->setSpacing(5);
+	WStackPage9Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage9Layout->setSpacing(6);
 	WStackPage9Layout->setAlignment( Qt::AlignTop );
 	textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9 );
 	WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
@@ -358,8 +369,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_10 = new QWidget( optionStack );
 	WStackPage10Layout = new QGridLayout( WStackPage_10 );
-	WStackPage10Layout->setMargin(4);
-	WStackPage10Layout->setSpacing(5);
+	WStackPage10Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage10Layout->setSpacing(6);
 	textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10 );
 	WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
 	colDataq1 = new ColorCombo(false, WStackPage_10);
@@ -448,25 +459,24 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_11 = new QWidget( optionStack );
 	WStackPage11Layout = new QVBoxLayout( WStackPage_11 );
-	WStackPage11Layout->setMargin(5);
-	WStackPage11Layout->setSpacing(5);
+	WStackPage11Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage11Layout->setSpacing(6);
 	WStackPage11Layout->setAlignment( Qt::AlignTop );
 	Kdisplay = new CurveWidget(WStackPage_11);
 	WStackPage11Layout->addWidget( Kdisplay );
+	spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+	WStackPage11Layout->addItem( spacer );
 	optionStack->addWidget( WStackPage_11 );
 
-	layout16->addWidget( optionStack );
-	EffectsDialogLayout->addLayout( layout16 );
-
 	layout18 = new QVBoxLayout;
-	layout18->setMargin(0);
-	layout18->setSpacing(5);
+	layout18->setContentsMargins(0, 0, 0, 0);
+	layout18->setSpacing(6);
 	layout10 = new QGridLayout;
-	layout10->setMargin(0);
-	layout10->setSpacing(5);
+	layout10->setContentsMargins(0, 0, 0, 0);
+	layout10->setSpacing(6);
 	layout2 = new QVBoxLayout;
-	layout2->setMargin(0);
-	layout2->setSpacing(5);
+	layout2->setContentsMargins(0, 0, 0, 0);
+	layout2->setSpacing(6);
 	textLabel1 = new QLabel( this );
 	textLabel1->setText( tr( "Available Effects" ) );
 	layout2->addWidget( textLabel1 );
@@ -490,28 +500,15 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	availableEffects->setMinimumSize(availableEffectsAdvance + 40, 180);
 	layout2->addWidget(availableEffects);
-	layout10->addLayout(layout2, 0, 0);
-
-	layout1 = new QVBoxLayout;
-	layout1->setMargin(0);
-	layout1->setSpacing(5);
-	auto* spacer1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer1 );
 	toEffects = new QPushButton( this );
 	toEffects->setText( tr( "Add" ) );
 	toEffects->setEnabled(false);
-	layout1->addWidget( toEffects );
-	fromEffects = new QPushButton( this );
-	fromEffects->setText( tr( "Remove" ) );
-	fromEffects->setEnabled(false);
-	layout1->addWidget( fromEffects );
-	auto* spacer2 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer2 );
-	layout10->addLayout( layout1, 0, 1 );
+	layout2->addWidget( toEffects );
+	layout10->addLayout(layout2, 0, 0);
 
 	layout8 = new QVBoxLayout;
-	layout8->setMargin(0);
-	layout8->setSpacing(5);
+	layout8->setContentsMargins(0, 0, 0, 0);
+	layout8->setSpacing(6);
 	textLabel2 = new QLabel( this );
 	textLabel2->setText( tr( "Applied Effects" ) );
 	layout8->addWidget( textLabel2 );
@@ -605,10 +602,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	}
 	layout8->addWidget( usedEffects );
 	layout7 = new QHBoxLayout;
-	layout7->setMargin(0);
-	layout7->setSpacing(5);
-	QSpacerItem* spacer4 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer4 );
+	layout7->setContentsMargins(0, 0, 0, 0);
+	layout7->setSpacing(6);
+	fromEffects = new QPushButton( this );
+	fromEffects->setText( tr( "Remove" ) );
+	fromEffects->setEnabled(false);
+	layout7->addWidget( fromEffects );
 	effectUp = new QPushButton( this );
 	effectUp->setText( "" );
 	effectUp->setIcon(IconManager::instance().loadIcon("16/go-up.png"));
@@ -619,15 +618,25 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	effectDown->setIcon(IconManager::instance().loadIcon("16/go-down.png"));
 	effectDown->setEnabled(false);
 	layout7->addWidget( effectDown );
-	QSpacerItem* spacer5 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer5 );
 	layout8->addLayout( layout7 );
 	layout10->addLayout( layout8, 0, 2 );
 	layout18->addLayout( layout10 );
 
+	groupBox = new QGroupBox( this );
+	groupBox->setTitle( tr( "Options:" ) );
+	layout28 = new QVBoxLayout( groupBox );
+	layout28->addWidget( optionStack );
+	layout28->setAlignment( Qt::AlignTop );
+	layout28->setSpacing(6);
+	layout28->setContentsMargins(9, 9, 9, 9);
+	layout16->addWidget( groupBox );
+
+	layout27->addLayout( layout18 );
+	layout27->addLayout( layout16 );
+
 	layout9 = new QHBoxLayout;
-	layout9->setMargin(0);
-	layout9->setSpacing(5);
+	layout9->setContentsMargins(0, 0, 0, 0);
+	layout9->setSpacing(6);
 	QSpacerItem* spacer3 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
 	layout9->addItem( spacer3 );
 
@@ -638,8 +647,7 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	cancelButton = new QPushButton( this );
 	cancelButton->setText( tr( "Cancel" ) );
 	layout9->addWidget( cancelButton );
-	layout18->addLayout( layout9 );
-	EffectsDialogLayout->addLayout( layout18 );
+	layout25->addLayout( layout9 );
 	optionStack->setCurrentIndex(0);
 	usedEffects->clearSelection();
 	availableEffects->clearSelection();
diff --git a/scribus/ui/effectsdialog.h b/scribus/ui/effectsdialog.h
index b89ff8cfd..2f5e9ff76 100644
--- a/scribus/ui/effectsdialog.h
+++ b/scribus/ui/effectsdialog.h
@@ -34,6 +34,8 @@ class QListWidgetItem;
 class QListWidget;
 class ScrSpinBox;
 class CurveWidget;
+class QGroupBox;
+class QSpacerItem;
 
 class SCRIBUS_API EffectsDialog : public QDialog
 {
@@ -50,7 +52,6 @@ public:
 	QLabel* textLabel2;
 	QLabel* textLabel3;
 	QLabel* textLabel4;
-	QLabel* textLabel5;
 	QLabel* textLabel6;
 	QLabel* textLabel7;
 	QLabel* textLabel8;
@@ -60,6 +61,7 @@ public:
 	QLabel* textLabel12;
 	QLabel* textLabel14;
 	QLabel* textLabel15;
+	QLabel* textLabel16;
 	QStackedWidget* optionStack;
 	QWidget* WStackPage;
 	QWidget* WStackPage_2;
@@ -158,6 +160,9 @@ public:
 	QPushButton* cancelButton;
 	QListWidgetItem* currentOptions;
 
+	QGroupBox *groupBox;
+	QSpacerItem* spacer;
+
 	ScImageEffectList effectsList;
 
 public slots:
@@ -207,11 +212,13 @@ protected:
 	QGridLayout* layout10;
 	QVBoxLayout* layout8;
 	QHBoxLayout* layout7;
-	QVBoxLayout* layout1;
 	QVBoxLayout* layout2;
 	QVBoxLayout* layout16;
 	QVBoxLayout* layout18;
 	QHBoxLayout* layout9;
+	QVBoxLayout* layout25;
+	QHBoxLayout* layout27;
+	QVBoxLayout* layout28;
 };
 
 #endif // EFFECTSDIALOG_H
-- 
2.27.0

image_effect_B.patch (15,720 bytes)   
image_effect_A.png (97,556 bytes)   
image_effect_A.png (97,556 bytes)   
image_effect_B.png (96,139 bytes)   
image_effect_B.png (96,139 bytes)   

PeterBenedek

2021-01-23 08:05

developer   ~0048743

B version is perfect (in my opinion).

jghali

2021-01-24 03:05

administrator   ~0048744

For some reason, with version B, there is a small misalignment between the bottom of available and applied effects list on Windows.
16431_versionB_win.png (68,901 bytes)   
16431_versionB_win.png (68,901 bytes)   

bubu

2021-01-29 21:33

reporter   ~0048785

Jean, thank you for reviewing. I see the misalignment. unfortunately I can not find any reason in the code. I tried to study how to build Scribus in Windows, but I am not in close friendship with Windows. I can't correct version B for Windows. If you agree, please commit version A.

bubu

2021-01-30 10:12

reporter   ~0048789

Version B: Learning from the case 0016452 I will try to recreate the left side of the dialog with grid layout. Maybe than this misalignment disappears.

bubu

2021-01-30 17:13

reporter   ~0048790

Here is the B version on grid layout. Please review it. I hope this version is better on Window than previous one.
0001-Update-layout-for-Image-Effects-dialog-B-grid.patch (16,415 bytes)   
From 1d13408ba551fadb679e3065dfc6056e018f4116 Mon Sep 17 00:00:00 2001
Message-Id: <1d13408ba551fadb679e3065dfc6056e018f4116.1612026225.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sat, 30 Jan 2021 18:03:28 +0100
Subject: [PATCH] Update layout for Image Effects dialog

---
 scribus/ui/effectsdialog.cpp | 187 ++++++++++++++++-------------------
 scribus/ui/effectsdialog.h   |  16 +--
 2 files changed, 95 insertions(+), 108 deletions(-)

diff --git a/scribus/ui/effectsdialog.cpp b/scribus/ui/effectsdialog.cpp
index 420f36057..0cce90816 100644
--- a/scribus/ui/effectsdialog.cpp
+++ b/scribus/ui/effectsdialog.cpp
@@ -23,6 +23,8 @@ for which a new license (GPL+exception) is in place.
 #include <QWidgetAction>
 #include <QTime>
 #include <QStackedWidget>
+#include <QGroupBox>
+#include <QSpacerItem>
 
 #include "cmsettings.h"
 #include "colorcombo.h"
@@ -69,12 +71,15 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 			m_image.createLowRes(sy);
 		m_imageScale = qMin(sx, sy);
 	}
-	EffectsDialogLayout = new QHBoxLayout( this );
-	EffectsDialogLayout->setMargin(10);
-	EffectsDialogLayout->setSpacing(5);
-	layout16 = new QVBoxLayout;
-	layout16->setMargin(0);
-	layout16->setSpacing(5);
+	EffectsDialogLayout = new QVBoxLayout( this );
+	EffectsDialogLayout->setContentsMargins(9, 9, 9, 9);
+	EffectsDialogLayout->setSpacing(6);
+	layoutGrid = new QGridLayout();
+	layoutGrid->setContentsMargins(0, 0, 0, 0);
+	layoutGrid->setSpacing(6);
+
+	textLabel5 = new QLabel( this );
+	textLabel5->setText( tr( "Preview" ) );
 	pixmapLabel1 = new QLabel( this );
 	pixmapLabel1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
 	pixmapLabel1->setMinimumSize( QSize( 220, 220 ) );
@@ -82,25 +87,22 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	pixmapLabel1->setFrameShape( QLabel::StyledPanel );
 	pixmapLabel1->setFrameShadow( QLabel::Sunken );
 	pixmapLabel1->setScaledContents( false );
-	layout16->addWidget( pixmapLabel1 );
-	textLabel5 = new QLabel( this );
-	textLabel5->setText( tr( "Options:" ) );
-	layout16->addWidget( textLabel5 );
+
 	optionStack = new QStackedWidget( this );
 //	optionStack->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, optionStack->sizePolicy().hasHeightForWidth() ) );
-	optionStack->setMinimumSize( QSize( 220, 180 ) );
-	optionStack->setFrameShape( QFrame::Box );
+//	optionStack->setMinimumSize( QSize( 220, 280 ) );
+	optionStack->setFrameShape( QFrame::NoFrame );
 	WStackPage = new QWidget( optionStack );
 	optionStack->addWidget( WStackPage );
 
 	WStackPage_2 = new QWidget( optionStack );
 	WStackPageLayout = new QVBoxLayout( WStackPage_2 );
-	WStackPageLayout->setMargin(5);
-	WStackPageLayout->setSpacing(5);
+	WStackPageLayout->setContentsMargins(0, 0, 0, 0);
+	WStackPageLayout->setSpacing(6);
 	WStackPageLayout->setAlignment( Qt::AlignTop );
 	layout17 = new QHBoxLayout;
-	layout17->setMargin(0);
-	layout17->setSpacing(5);
+	layout17->setContentsMargins(0, 0, 0, 0);
+	layout17->setSpacing(6);
 	textLabel3 = new QLabel( tr( "Color:" ), WStackPage_2 );
 	layout17->addWidget( textLabel3 );
 
@@ -111,8 +113,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	WStackPageLayout->addLayout( layout17 );
 
 	layout19 = new QHBoxLayout;
-	layout19->setMargin(0);
-	layout19->setSpacing(5);
+	layout19->setContentsMargins(0, 0, 0, 0);
+	layout19->setSpacing(6);
 	textLabel4 = new QLabel( tr( "Shade:" ), WStackPage_2 );
 	layout19->addWidget( textLabel4 );
 	shade = new ShadeButton(WStackPage_2);
@@ -123,12 +125,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_3 = new QWidget( optionStack );
 	WStackPage3Layout = new QVBoxLayout( WStackPage_3 );
-	WStackPage3Layout->setMargin(5);
-	WStackPage3Layout->setSpacing(5);
+	WStackPage3Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage3Layout->setSpacing(6);
 	WStackPage3Layout->setAlignment( Qt::AlignTop );
 	layout20 = new QHBoxLayout;
-	layout20->setMargin(0);
-	layout20->setSpacing(5);
+	layout20->setContentsMargins(0, 0, 0, 0);
+	layout20->setSpacing(6);
 	textLabel6 = new QLabel( tr( "Brightness:" ), WStackPage_3 );
 	layout20->addWidget( textLabel6, Qt::AlignLeft );
 	textLabel7 = new QLabel( "0", WStackPage_3 );
@@ -145,12 +147,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_4 = new QWidget( optionStack );
 	WStackPage4Layout = new QVBoxLayout( WStackPage_4 );
-	WStackPage4Layout->setMargin(5);
-	WStackPage4Layout->setSpacing(5);
+	WStackPage4Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage4Layout->setSpacing(6);
 	WStackPage4Layout->setAlignment( Qt::AlignTop );
 	layout21 = new QHBoxLayout;
-	layout21->setMargin(0);
-	layout21->setSpacing(5);
+	layout21->setContentsMargins(0, 0, 0, 0);
+	layout21->setSpacing(6);
 	textLabel8 = new QLabel( tr( "Contrast:" ), WStackPage_4 );
 	layout21->addWidget( textLabel8, Qt::AlignLeft );
 	textLabel9 = new QLabel( "0", WStackPage_4 );
@@ -167,12 +169,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_5 = new QWidget( optionStack );
 	WStackPage5Layout = new QVBoxLayout( WStackPage_5 );
-	WStackPage5Layout->setMargin(5);
-	WStackPage5Layout->setSpacing(5);
+	WStackPage5Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage5Layout->setSpacing(6);
 	WStackPage5Layout->setAlignment( Qt::AlignTop );
 	layout22 = new QHBoxLayout;
-	layout22->setMargin(0);
-	layout22->setSpacing(5);
+	layout22->setContentsMargins(0, 0, 0, 0);
+	layout22->setSpacing(6);
 	textLabel10 = new QLabel( tr( "Radius:" ), WStackPage_5 );
 	layout22->addWidget( textLabel10 );
 	shRadius = new ScrSpinBox( 0.0, 10.0, WStackPage_5, 1 );
@@ -182,8 +184,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	layout22->addWidget( shRadius );
 	WStackPage5Layout->addLayout( layout22 );
 	layout23 = new QHBoxLayout;
-	layout23->setMargin(0);
-	layout23->setSpacing(5);
+	layout23->setContentsMargins(0, 0, 0, 0);
+	layout23->setSpacing(6);
 	textLabel11 = new QLabel( tr("Value:"), WStackPage_5 );
 	layout23->addWidget( textLabel11 );
 	shValue = new ScrSpinBox( 0.0, 5.0, WStackPage_5, 1 );
@@ -196,12 +198,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_6 = new QWidget( optionStack );
 	WStackPage6Layout = new QVBoxLayout( WStackPage_6 );
-	WStackPage6Layout->setMargin(5);
-	WStackPage6Layout->setSpacing(5);
+	WStackPage6Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage6Layout->setSpacing(6);
 	WStackPage6Layout->setAlignment( Qt::AlignTop );
 	layout24 = new QHBoxLayout;
-	layout24->setMargin(0);
-	layout24->setSpacing(5);
+	layout24->setContentsMargins(0, 0, 0, 0);
+	layout24->setSpacing(6);
 	textLabel12 = new QLabel( tr( "Radius:" ), WStackPage_6 );
 	layout24->addWidget( textLabel12 );
 	blRadius = new ScrSpinBox( 0.0, 30.0, WStackPage_6, 1 );
@@ -214,12 +216,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_7 = new QWidget( optionStack );
 	WStackPage7Layout = new QVBoxLayout( WStackPage_7 );
-	WStackPage7Layout->setMargin(5);
-	WStackPage7Layout->setSpacing(5);
+	WStackPage7Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage7Layout->setSpacing(6);
 	WStackPage7Layout->setAlignment( Qt::AlignTop );
 	layout26 = new QHBoxLayout;
-	layout26->setMargin(0);
-	layout26->setSpacing(5);
+	layout26->setContentsMargins(0, 0, 0, 0);
+	layout26->setSpacing(6);
 	textLabel14 = new QLabel( tr( "Posterize:" ), WStackPage_7 );
 	layout26->addWidget( textLabel14, Qt::AlignLeft );
 	textLabel15 = new QLabel( "0", WStackPage_7 );
@@ -236,8 +238,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_8 = new QWidget( optionStack );
 	WStackPage8Layout = new QGridLayout( WStackPage_8 );
-	WStackPage8Layout->setMargin(4);
-	WStackPage8Layout->setSpacing(5);
+	WStackPage8Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage8Layout->setSpacing(6);
 	WStackPage8Layout->setAlignment( Qt::AlignTop );
 	textLabel1d = new QLabel( tr( "Color 1:" ), WStackPage_8 );
 	WStackPage8Layout->addWidget( textLabel1d, 0, 0 );
@@ -288,8 +290,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_9 = new QWidget( optionStack );
 	WStackPage9Layout = new QGridLayout( WStackPage_9 );
-	WStackPage9Layout->setMargin(4);
-	WStackPage9Layout->setSpacing(5);
+	WStackPage9Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage9Layout->setSpacing(6);
 	WStackPage9Layout->setAlignment( Qt::AlignTop );
 	textLabel1t = new QLabel( tr( "Color 1:" ), WStackPage_9 );
 	WStackPage9Layout->addWidget( textLabel1t, 0, 0 );
@@ -358,8 +360,8 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_10 = new QWidget( optionStack );
 	WStackPage10Layout = new QGridLayout( WStackPage_10 );
-	WStackPage10Layout->setMargin(4);
-	WStackPage10Layout->setSpacing(5);
+	WStackPage10Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage10Layout->setSpacing(6);
 	textLabel1q = new QLabel( tr( "Color 1:" ), WStackPage_10 );
 	WStackPage10Layout->addWidget( textLabel1q, 0, 0 );
 	colDataq1 = new ColorCombo(false, WStackPage_10);
@@ -448,28 +450,17 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 
 	WStackPage_11 = new QWidget( optionStack );
 	WStackPage11Layout = new QVBoxLayout( WStackPage_11 );
-	WStackPage11Layout->setMargin(5);
-	WStackPage11Layout->setSpacing(5);
+	WStackPage11Layout->setContentsMargins(0, 0, 0, 0);
+	WStackPage11Layout->setSpacing(6);
 	WStackPage11Layout->setAlignment( Qt::AlignTop );
 	Kdisplay = new CurveWidget(WStackPage_11);
 	WStackPage11Layout->addWidget( Kdisplay );
+	spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+	WStackPage11Layout->addItem( spacer );
 	optionStack->addWidget( WStackPage_11 );
 
-	layout16->addWidget( optionStack );
-	EffectsDialogLayout->addLayout( layout16 );
-
-	layout18 = new QVBoxLayout;
-	layout18->setMargin(0);
-	layout18->setSpacing(5);
-	layout10 = new QGridLayout;
-	layout10->setMargin(0);
-	layout10->setSpacing(5);
-	layout2 = new QVBoxLayout;
-	layout2->setMargin(0);
-	layout2->setSpacing(5);
 	textLabel1 = new QLabel( this );
 	textLabel1->setText( tr( "Available Effects" ) );
-	layout2->addWidget( textLabel1 );
 	availableEffects = new QListWidget( this );
 	availableEffects->clear();
 	availableEffects->addItem( tr("Blur"));
@@ -489,32 +480,12 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	int availableEffectsAdvance = ftMetrics.horizontalAdvance( tr("Available Effects"));
 
 	availableEffects->setMinimumSize(availableEffectsAdvance + 40, 180);
-	layout2->addWidget(availableEffects);
-	layout10->addLayout(layout2, 0, 0);
-
-	layout1 = new QVBoxLayout;
-	layout1->setMargin(0);
-	layout1->setSpacing(5);
-	auto* spacer1 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer1 );
 	toEffects = new QPushButton( this );
 	toEffects->setText( tr( "Add" ) );
 	toEffects->setEnabled(false);
-	layout1->addWidget( toEffects );
-	fromEffects = new QPushButton( this );
-	fromEffects->setText( tr( "Remove" ) );
-	fromEffects->setEnabled(false);
-	layout1->addWidget( fromEffects );
-	auto* spacer2 = new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding );
-	layout1->addItem( spacer2 );
-	layout10->addLayout( layout1, 0, 1 );
 
-	layout8 = new QVBoxLayout;
-	layout8->setMargin(0);
-	layout8->setSpacing(5);
 	textLabel2 = new QLabel( this );
 	textLabel2->setText( tr( "Applied Effects" ) );
-	layout8->addWidget( textLabel2 );
 	usedEffects = new QListWidget( this );
 	usedEffects->setMinimumSize(availableEffectsAdvance + 40, 180);
 	usedEffects->clear();
@@ -603,12 +574,13 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 			m_effectValMap.insert(usedEffects->item(usedEffects->count()-1), effectsList.at(i).effectParameters);
 		}
 	}
-	layout8->addWidget( usedEffects );
 	layout7 = new QHBoxLayout;
-	layout7->setMargin(0);
-	layout7->setSpacing(5);
-	QSpacerItem* spacer4 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer4 );
+	layout7->setContentsMargins(0, 0, 0, 0);
+	layout7->setSpacing(6);
+	fromEffects = new QPushButton( this );
+	fromEffects->setText( tr( "Remove" ) );
+	fromEffects->setEnabled(false);
+	layout7->addWidget( fromEffects );
 	effectUp = new QPushButton( this );
 	effectUp->setText( "" );
 	effectUp->setIcon(IconManager::instance().loadIcon("16/go-up.png"));
@@ -619,27 +591,40 @@ EffectsDialog::EffectsDialog( QWidget* parent, PageItem* item, ScribusDoc* docc
 	effectDown->setIcon(IconManager::instance().loadIcon("16/go-down.png"));
 	effectDown->setEnabled(false);
 	layout7->addWidget( effectDown );
-	QSpacerItem* spacer5 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout7->addItem( spacer5 );
-	layout8->addLayout( layout7 );
-	layout10->addLayout( layout8, 0, 2 );
-	layout18->addLayout( layout10 );
 
-	layout9 = new QHBoxLayout;
-	layout9->setMargin(0);
-	layout9->setSpacing(5);
-	QSpacerItem* spacer3 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
-	layout9->addItem( spacer3 );
+	groupBox = new QGroupBox( this );
+	groupBox->setTitle( tr( "Options:" ) );
+	layout8 = new QVBoxLayout( groupBox );
+	layout8->addWidget( optionStack );
+	layout8->setAlignment( Qt::AlignTop );
+	layout8->setSpacing(6);
+	layout8->setContentsMargins(9, 9, 9, 9);
 
+	layoutGrid->addWidget(textLabel1,       0, 0, 1, 1);
+	layoutGrid->addWidget(textLabel2,       0, 1, 1, 1);
+	layoutGrid->addWidget(textLabel5,       0, 2, 1, 1);
+	layoutGrid->addWidget(availableEffects, 1, 0, 2, 1);
+	layoutGrid->addWidget(usedEffects,      1, 1, 2, 1);
+	layoutGrid->addWidget(pixmapLabel1,     1, 2, 1, 1);
+	layoutGrid->addWidget(groupBox,         2, 2, 2, 1);
+	layoutGrid->addWidget(toEffects,        3, 0, 1, 1);
+	layoutGrid->addLayout(layout7,          3, 1, 1, 1);
+	EffectsDialogLayout->addLayout( layoutGrid );
+
+	layoutDialogButtonBox = new QHBoxLayout;
+	layoutDialogButtonBox->setContentsMargins(0, 0, 0, 0);
+	layoutDialogButtonBox->setSpacing(6);
+	spacer3 = new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum );
+	layoutDialogButtonBox->addItem( spacer3 );
 	okButton = new QPushButton( this );
 	okButton->setText( tr( "OK" ) );
-	layout9->addWidget( okButton );
-
+	layoutDialogButtonBox->addWidget( okButton );
 	cancelButton = new QPushButton( this );
 	cancelButton->setText( tr( "Cancel" ) );
-	layout9->addWidget( cancelButton );
-	layout18->addLayout( layout9 );
-	EffectsDialogLayout->addLayout( layout18 );
+	layoutDialogButtonBox->addWidget( cancelButton );
+	EffectsDialogLayout->addLayout( layoutDialogButtonBox );
+
+
 	optionStack->setCurrentIndex(0);
 	usedEffects->clearSelection();
 	availableEffects->clearSelection();
diff --git a/scribus/ui/effectsdialog.h b/scribus/ui/effectsdialog.h
index b89ff8cfd..e83fd50a8 100644
--- a/scribus/ui/effectsdialog.h
+++ b/scribus/ui/effectsdialog.h
@@ -34,6 +34,8 @@ class QListWidgetItem;
 class QListWidget;
 class ScrSpinBox;
 class CurveWidget;
+class QGroupBox;
+class QSpacerItem;
 
 class SCRIBUS_API EffectsDialog : public QDialog
 {
@@ -158,6 +160,10 @@ public:
 	QPushButton* cancelButton;
 	QListWidgetItem* currentOptions;
 
+	QGroupBox *groupBox;
+	QSpacerItem* spacer;
+	QSpacerItem* spacer3;
+
 	ScImageEffectList effectsList;
 
 public slots:
@@ -185,7 +191,8 @@ protected:
 	QElapsedTimer m_time;
 	QMap<QListWidgetItem*, QString> m_effectValMap;
 
-	QHBoxLayout* EffectsDialogLayout;
+	QGridLayout* layoutGrid;
+	QVBoxLayout* EffectsDialogLayout;
 	QVBoxLayout* WStackPageLayout;
 	QVBoxLayout* WStackPage3Layout;
 	QHBoxLayout* layout20;
@@ -204,14 +211,9 @@ protected:
 	QHBoxLayout* layout26;
 	QHBoxLayout* layout17;
 	QHBoxLayout* layout19;
-	QGridLayout* layout10;
 	QVBoxLayout* layout8;
 	QHBoxLayout* layout7;
-	QVBoxLayout* layout1;
-	QVBoxLayout* layout2;
-	QVBoxLayout* layout16;
-	QVBoxLayout* layout18;
-	QHBoxLayout* layout9;
+	QHBoxLayout* layoutDialogButtonBox;
 };
 
 #endif // EFFECTSDIALOG_H
-- 
2.27.0

jghali

2021-01-31 21:21

administrator   ~0048792

Yup, this version is indeed better on Windows. Patch has been applied, thanks!

FirasH

2021-03-21 15:37

reporter   ~0049042

Thanks!
Fixed in 1.5.7.svn (24437)

Issue History

Date Modified Username Field Change
2021-01-13 22:06 bubu New Issue
2021-01-13 22:06 bubu File Added: 0001-Update-layout-for-Image-Effects-dialog.patch
2021-01-13 22:06 bubu File Added: image_effects.gif
2021-01-14 08:47 PeterBenedek Relationship added child of 0013906
2021-01-14 08:53 PeterBenedek Note Added: 0048690
2021-01-17 12:48 bubu Note Added: 0048699
2021-01-17 14:46 PeterBenedek File Added: ImageEffects.png
2021-01-17 14:47 PeterBenedek Note Added: 0048700
2021-01-17 15:05 PeterBenedek File Deleted: ImageEffects.png
2021-01-17 15:05 PeterBenedek File Added: ImageEffects.png
2021-01-17 15:15 PeterBenedek File Added: ImageEffects_02.png
2021-01-17 15:15 PeterBenedek Note Added: 0048701
2021-01-17 16:13 PeterBenedek Note Edited: 0048701
2021-01-17 18:04 bubu File Added: 0001-Layout-inspired-by-Benedek.patch
2021-01-17 18:04 bubu File Added: 0001-Layout-inspired-by-Benedek.png
2021-01-17 18:04 bubu Note Added: 0048703
2021-01-18 09:37 jghali Note Added: 0048710
2021-01-18 09:37 jghali Note Edited: 0048710
2021-01-23 00:06 bubu File Added: image_effect_A.diff
2021-01-23 00:06 bubu File Added: image_effect_B.patch
2021-01-23 00:06 bubu File Added: image_effect_A.png
2021-01-23 00:06 bubu File Added: image_effect_B.png
2021-01-23 00:06 bubu Note Added: 0048742
2021-01-23 08:05 PeterBenedek Note Added: 0048743
2021-01-24 03:05 jghali File Added: 16431_versionB_win.png
2021-01-24 03:05 jghali Note Added: 0048744
2021-01-29 21:33 bubu Note Added: 0048785
2021-01-30 10:12 bubu Note Added: 0048789
2021-01-30 17:13 bubu File Added: 0001-Update-layout-for-Image-Effects-dialog-B-grid.patch
2021-01-30 17:13 bubu File Added: 0001-Update-layout-for-Image-Effects-dialog-B-grid.png
2021-01-30 17:13 bubu Note Added: 0048790
2021-01-31 21:21 jghali Note Added: 0048792
2021-01-31 21:22 jghali Assigned To => jghali
2021-01-31 21:22 jghali Status new => resolved
2021-01-31 21:22 jghali Resolution open => fixed
2021-01-31 21:22 jghali Fixed in Version => 1.5.7.svn
2021-03-21 15:37 FirasH Status resolved => closed
2021-03-21 15:37 FirasH Note Added: 0049042