View Issue Details

IDProjectCategoryView StatusLast Update
0016462ScribusUser Interfacepublic2021-02-19 18:28
Reporterbubu Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.5.7.svn 
Target VersionFixed in Version 
Summary0016462: Update Layout for Node Editor
DescriptionI propose two rival patches for Node Editor:

Patch A: "narrow version with 4 rows"
- use standard window dialog margin (9) and spacing (6)
- format some widget to be more narrower
- reorganize layout
- short one string to be more narrower (Absolute Coordinates -> Absolute)

Patch B: "version with 6 rows"
- use standard window dialog margin (9) and spacing (6)
- reorganize layout

My opinion: Patch A is an extreme narrower version to barely cover anything on the canvas while drawing. Patch B. is a conservative version, nothing had to be optimized, but narrower as original even with standard margin and spacing.

Please review. Thank you for your attention.
Jean, you are always free to modify my rudimentary patches. Thanks if you can improve them.
TagsNo tags attached.
PatchNo

Relationships

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

Activities

bubu

2021-02-07 18:55

reporter  

0001-Update-Layout-for-Node-Editor-A.patch (15,401 bytes)
From c51758fde02d044586d0412d04d365ec42f0c234 Mon Sep 17 00:00:00 2001
Message-Id: <c51758fde02d044586d0412d04d365ec42f0c234.1612707937.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sun, 7 Feb 2021 15:25:24 +0100
Subject: [PATCH] Update Layout for Node Editor

---
 scribus/ui/nodeeditpalette.cpp | 107 +++++++++++++++------------------
 scribus/ui/nodeeditpalette.h   |   1 -
 2 files changed, 49 insertions(+), 59 deletions(-)

diff --git a/scribus/ui/nodeeditpalette.cpp b/scribus/ui/nodeeditpalette.cpp
index 0b27e2b32..459a9645a 100644
--- a/scribus/ui/nodeeditpalette.cpp
+++ b/scribus/ui/nodeeditpalette.cpp
@@ -26,11 +26,13 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	m_doc = nullptr;
 	unitRatio = 1.0;
 	vboxLayout = new QVBoxLayout(this);
-	vboxLayout->setSpacing(2);
-	vboxLayout->setMargin(5);
+	vboxLayout->setSpacing(6);
+	vboxLayout->setContentsMargins(9, 9, 9, 9);
+
 	gridLayout = new QGridLayout();
-	gridLayout->setSpacing(2);
-	gridLayout->setMargin(0);
+	gridLayout->setSpacing(6);
+	gridLayout->setContentsMargins(0, 0, 0, 0);
+
 	MoveNode = new QToolButton(this);
 	MoveNode->setText( "" );
 	MoveNode->setIcon(im.loadIcon("MoveNode.png"));
@@ -38,7 +40,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	MoveNode->setContentsMargins(0, 0, 0, 0);
 	MoveNode->setCheckable(true);
 	MoveNode->setChecked(true);
-	MoveNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(MoveNode, 0, 0, 1, 1);
 
 	AddNode = new QToolButton(this);
@@ -47,7 +48,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	AddNode->setContentsMargins(0, 0, 0, 0);
 	AddNode->setEnabled(true);
 	AddNode->setCheckable(true);
-	AddNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(AddNode, 0, 1, 1, 1);
 
 	DeleteNode = new QToolButton(this);
@@ -56,7 +56,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	DeleteNode->setContentsMargins(0, 0, 0, 0);
 	DeleteNode->setEnabled(true);
 	DeleteNode->setCheckable(true);
-	DeleteNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(DeleteNode, 0, 2, 1, 1);
 
 	ResNode = new QToolButton(this);
@@ -64,7 +63,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	ResNode->setIconSize(iconSize);
 	ResNode->setContentsMargins(0, 0, 0, 0);
 	ResNode->setEnabled(true);
-	ResNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(ResNode, 0, 3, 1, 1);
 
 	MoveControl = new QToolButton(this);
@@ -72,7 +70,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	MoveControl->setIconSize(iconSize);
 	MoveControl->setContentsMargins(0, 0, 0, 0);
 	MoveControl->setCheckable(true);
-	MoveControl->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(MoveControl, 1, 0, 1, 1);
 
 	AsymMove = new QToolButton(this);
@@ -81,7 +78,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	AsymMove->setContentsMargins(0, 0, 0, 0);
 	AsymMove->setEnabled(false);
 	AsymMove->setCheckable(true);
-	AsymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(AsymMove, 1, 1, 1, 1);
 
 	SymMove = new QToolButton(this);
@@ -90,7 +86,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	SymMove->setContentsMargins(0, 0, 0, 0);
 	SymMove->setEnabled(false);
 	SymMove->setCheckable(true);
-	SymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(SymMove, 1, 2, 1, 1);
 
 	Res1Node = new QToolButton(this);
@@ -98,7 +93,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	Res1Node->setIconSize(iconSize);
 	Res1Node->setContentsMargins(0, 0, 0, 0);
 	Res1Node->setEnabled(false);
-	Res1Node->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(Res1Node, 1, 3, 1, 1);
 
 	PolySplit = new QToolButton(this);
@@ -107,7 +101,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	PolySplit->setIcon(im.loadIcon("PolyCut.png"));
 	PolySplit->setIconSize(iconSize);
 	PolySplit->setContentsMargins(0, 0, 0, 0);
-	PolySplit->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(PolySplit, 2, 0, 1, 1);
 
 	BezierClose = new QToolButton(this);
@@ -115,28 +108,24 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	BezierClose->setIcon(im.loadIcon("BezierClose.png"));
 	BezierClose->setIconSize(iconSize);
 	BezierClose->setContentsMargins(0, 0, 0, 0);
-	BezierClose->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(BezierClose, 2, 1, 1, 1);
 
 	PolyMirrorH = new QToolButton(this);
 	PolyMirrorH->setIcon(im.loadIcon("hmirror.png"));
 	PolyMirrorH->setIconSize(iconSize);
 	PolyMirrorH->setContentsMargins(0, 0, 0, 0);
-	PolyMirrorH->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(PolyMirrorH, 2, 2, 1, 1);
 
 	PolyMirrorV = new QToolButton(this);
 	PolyMirrorV->setIcon(im.loadIcon("vmirror.png"));
 	PolyMirrorV->setIconSize(iconSize);
 	PolyMirrorV->setContentsMargins(0, 0, 0, 0);
-	PolyMirrorV->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	gridLayout->addWidget(PolyMirrorV, 2, 3, 1, 1);
 
 	PolyShearL = new QToolButton(this);
 	PolyShearL->setIcon(im.loadIcon("22/transform-shear-left.png"));
 	PolyShearL->setIconSize(iconSize);
 	PolyShearL->setContentsMargins(0, 0, 0, 0);
-	PolyShearL->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearL->setAutoRepeat(true);
 	gridLayout->addWidget(PolyShearL, 3, 0, 1, 1);
 
@@ -144,7 +133,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	PolyShearR->setIcon(im.loadIcon("22/transform-shear-right.png"));
 	PolyShearR->setIconSize(iconSize);
 	PolyShearR->setContentsMargins(0, 0, 0, 0);
-	PolyShearR->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearR->setAutoRepeat(true);
 	gridLayout->addWidget(PolyShearR, 3, 1, 1, 1);
 
@@ -152,7 +140,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	PolyShearU->setIcon(im.loadIcon("22/transform-shear-up.png"));
 	PolyShearU->setIconSize(iconSize);
 	PolyShearU->setContentsMargins(0, 0, 0, 0);
-	PolyShearU->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearU->setAutoRepeat(true);
 	gridLayout->addWidget(PolyShearU, 3, 2, 1, 1);
 
@@ -160,149 +147,153 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	PolyShearD->setIcon(im.loadIcon("22/transform-shear-down.png"));
 	PolyShearD->setIconSize(iconSize);
 	PolyShearD->setContentsMargins(0, 0, 0, 0);
-	PolyShearD->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearD->setAutoRepeat(true);
 	gridLayout->addWidget(PolyShearD, 3, 3, 1, 1);
-	vboxLayout->addLayout(gridLayout);
-
-	gridLayout1 = new QGridLayout();
-	gridLayout1->setSpacing(5);
-	gridLayout1->setMargin(0);
 
 	RotateCCW = new QToolButton(this);
 	RotateCCW->setIcon(im.loadIcon("rotate_ccw.png"));
 	RotateCCW->setIconSize(iconSize);
 	RotateCCW->setContentsMargins(0, 0, 0, 0);
 	RotateCCW->setAutoRepeat(true);
-	gridLayout1->addWidget(RotateCCW, 0, 0, 1, 1);
+	gridLayout->addWidget(RotateCCW, 4, 0, 1, 1);
 
 	RotateCW = new QToolButton(this);
 	RotateCW->setIcon(im.loadIcon("rotate_cw.png"));
 	RotateCW->setIconSize(iconSize);
 	RotateCW->setContentsMargins(0, 0, 0, 0);
 	RotateCW->setAutoRepeat(true);
-	gridLayout1->addWidget(RotateCW, 0, 1, 1, 1);
+	gridLayout->addWidget(RotateCW, 4, 1, 1, 1);
 
 	RotVal = new QSpinBox(this);
 	RotVal->setMinimum(1);
 	RotVal->setMaximum(180);
 	RotVal->setValue(1);
 	RotVal->setSuffix( QString::fromUtf8(" °"));
-	gridLayout1->addWidget(RotVal, 0, 2, 1, 1);
+	gridLayout->addWidget(RotVal, 4, 2, 1, 2);
 
 	Expand = new QToolButton(this);
 	Expand->setIcon(im.loadIcon("expand.png"));
 	Expand->setIconSize(iconSize);
 	Expand->setContentsMargins(0, 0, 0, 0);
 	Expand->setAutoRepeat(true);
-	gridLayout1->addWidget(Expand, 1, 0, 1, 1);
+	gridLayout->addWidget(Expand, 5, 0, 1, 1);
 
 	Shrink = new QToolButton(this);
 	Shrink->setIcon(im.loadIcon("crop.png"));
 	Shrink->setIconSize(iconSize);
 	Shrink->setContentsMargins(0, 0, 0, 0);
 	Shrink->setAutoRepeat(true);
-	gridLayout1->addWidget(Shrink, 1, 1, 1, 1);
+	gridLayout->addWidget(Shrink, 5, 1, 1, 1);
 
 	scalePercentage = new QSpinBox(this);
 	scalePercentage->setMinimum(1);
 	scalePercentage->setMaximum(100);
 	scalePercentage->setValue(10);
-	gridLayout1->addWidget(scalePercentage, 1, 2, 1, 1);
+	gridLayout->addWidget(scalePercentage, 5, 2, 1, 2);
 
 	Enlarge = new QToolButton(this);
 	Enlarge->setIcon(im.loadIcon("expand.png"));
 	Enlarge->setIconSize(iconSize);
 	Enlarge->setContentsMargins(0, 0, 0, 0);
 	Enlarge->setAutoRepeat(true);
-	gridLayout1->addWidget(Enlarge, 2, 0, 1, 1);
+	gridLayout->addWidget(Enlarge, 6, 0, 1, 1);
 
 	Reduce = new QToolButton(this);
 	Reduce->setIcon(im.loadIcon("crop.png"));
 	Reduce->setIconSize(iconSize);
 	Reduce->setContentsMargins(0, 0, 0, 0);
 	Reduce->setAutoRepeat(true);
-	gridLayout1->addWidget(Reduce, 2, 1, 1, 1);
+	gridLayout->addWidget(Reduce, 6, 1, 1, 1);
 
 	scaleDistance = new ScrSpinBox( 1, 16777215, this, 0);
+	scaleDistance->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
 	scaleDistance->setValues(-16777215, 16777215, 2, 30);
-	gridLayout1->addWidget(scaleDistance, 2, 2, 1, 1);
-	vboxLayout->addLayout(gridLayout1);
+	gridLayout->addWidget(scaleDistance, 6, 2, 1, 2);
+	vboxLayout->addLayout(gridLayout);
 
 	gridLayout2 = new QGridLayout();
-	gridLayout2->setSpacing(5);
-	gridLayout2->setMargin(0);
+	gridLayout2->setSpacing(6);
+	gridLayout2->setContentsMargins(0, 0, 0, 0);
 
-	QSpacerItem* spacer = new QSpacerItem( 3, 3, QSizePolicy::Fixed, QSizePolicy::Fixed );
+	QSpacerItem* spacer = new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed );
 	vboxLayout->addItem(spacer);
 
-	AbsMode = new QGroupBox( "&Absolute Coordinates", this );
+	AbsMode = new QGroupBox( "&Absolute", this );
 	AbsMode->setCheckable(true);
 	AbsMode->setChecked(false);
 	vboxLayout1 = new QVBoxLayout(AbsMode);
-	vboxLayout1->setSpacing(2);
-	vboxLayout1->setMargin(5);
+	vboxLayout1->setSpacing(6);
+	vboxLayout1->setContentsMargins(9, 9, 9, 9);
 	absToCanvas = new QRadioButton( tr("to Canvas"), AbsMode);
+	absToCanvas->minimumSizeHint();
 	vboxLayout1->addWidget(absToCanvas);
 	absToPage = new QRadioButton( tr("to Page"), AbsMode);
+	absToPage->minimumSizeHint();
 	vboxLayout1->addWidget(absToPage);
 	absToCanvas->setChecked(true);
-	gridLayout2->addWidget(AbsMode, 1, 0, 1, 2);
+	vboxLayout->addWidget(AbsMode);
+
+	gridLayout2 = new QGridLayout();
+	gridLayout2->setSpacing(6);
+	gridLayout2->setContentsMargins(0, 0, 0, 0);
+	gridLayout2->setColumnStretch(0, 0);
+	gridLayout2->setColumnStretch(1, 1);
 
 	TextLabel1 = new QLabel(this);
-	gridLayout2->addWidget(TextLabel1, 2, 0, 1, 1);
+	gridLayout2->addWidget(TextLabel1, 0, 0, 1, 1);
 
 	XSpin = new ScrSpinBox( 0, 16777215, this, 2 );
+	XSpin->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
 	XSpin->setEnabled(false);
-	gridLayout2->addWidget(XSpin, 2, 1, 1, 1);
+	gridLayout2->addWidget(XSpin, 0, 1, 1, 1);
 
 	TextLabel2 = new QLabel(this);
-	gridLayout2->addWidget(TextLabel2, 3, 0, 1, 1);
+	gridLayout2->addWidget(TextLabel2, 1, 0, 1, 1);
 
 	YSpin = new ScrSpinBox( 0, 16777215, this, 2 );
+	YSpin->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
 	YSpin->setEnabled(false);
-	gridLayout2->addWidget(YSpin, 3, 1, 1, 1);
+	gridLayout2->addWidget(YSpin, 1, 1, 1, 1);
+	vboxLayout->addLayout(gridLayout2);
+
 	TextLabel1->setBuddy(XSpin);
 	TextLabel2->setBuddy(YSpin);
 
 	EditCont = new QCheckBox(this);
 	EditCont->setChecked(false);
-	gridLayout2->addWidget(EditCont, 4, 0, 1, 2);
+	vboxLayout->addWidget(EditCont);
 
 	PreviewMode = new QCheckBox(this);
 	PreviewMode->setChecked(false);
-	gridLayout2->addWidget(PreviewMode, 5, 0, 1, 2);
+	vboxLayout->addWidget(PreviewMode);
 
 	ResetCont = new QPushButton(this);
 	ResetCont->setEnabled(false);
-	gridLayout2->addWidget(ResetCont, 6, 0, 1, 2);
+	vboxLayout->addWidget(ResetCont);
 
 	ResetContClip = new QPushButton(this);
 	ResetContClip->setEnabled(true);
-	ResetContClip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
 	ResetContClip->hide();
-	gridLayout2->addWidget(ResetContClip, 7, 0, 1, 2);
+	vboxLayout->addWidget(ResetContClip);
 
 	ResetShape2Clip = new QPushButton(this);
 	ResetShape2Clip->setEnabled(true);
-	ResetShape2Clip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
 	ResetShape2Clip->hide();
-	gridLayout2->addWidget(ResetShape2Clip, 8, 0, 1, 2);
+	vboxLayout->addWidget(ResetShape2Clip);
 
 	resetDefaultButton = new QPushButton(this);
 	resetDefaultButton->setEnabled(true);
-	gridLayout2->addWidget(resetDefaultButton, 9, 0, 1, 2);
+	vboxLayout->addWidget(resetDefaultButton);
 
 	editEditButton = new QPushButton(IconManager::instance().loadIcon("22/exit.png"), tr("OK"), this);
 	editEditButton->setEnabled(true);
 	editEditButton->setDefault(true);
-	gridLayout2->addWidget(editEditButton, 10, 0, 1, 1);
+	vboxLayout->addWidget(editEditButton);
 
 	cancelEditButton = new QPushButton( tr("Cancel"), this);
 	cancelEditButton->setEnabled(true);
-	gridLayout2->addWidget(cancelEditButton, 10, 1, 1, 1);
+	vboxLayout->addWidget(cancelEditButton);
 
-	vboxLayout->addLayout(gridLayout2);
 	resize(QSize(170, 380).expandedTo(minimumSizeHint()));
 
 	languageChange();
@@ -1132,7 +1123,7 @@ void NodePalette::languageChange()
 	setWindowTitle( tr( "Nodes" ) );
 	scalePercentage->setSuffix( tr(" %"));
 
-	AbsMode->setTitle( tr("&Absolute Coordinates"));
+	AbsMode->setTitle( tr("&Absolute"));
 	absToCanvas->setText( tr("to Canvas"));
 	absToPage->setText( tr("to Page"));
 	TextLabel1->setText( tr("&X-Pos:"));
diff --git a/scribus/ui/nodeeditpalette.h b/scribus/ui/nodeeditpalette.h
index 74446f63a..8547d8b4f 100644
--- a/scribus/ui/nodeeditpalette.h
+++ b/scribus/ui/nodeeditpalette.h
@@ -139,7 +139,6 @@ protected:
 	QVBoxLayout *vboxLayout { nullptr };
 	QVBoxLayout *vboxLayout1 { nullptr };
 	QGridLayout *gridLayout { nullptr };
-	QGridLayout *gridLayout1 { nullptr };
 	QGridLayout *gridLayout2 { nullptr };
 
 	ScribusDoc *m_doc { nullptr };
-- 
2.27.0

node_editor-A.gif (37,142 bytes)
node_editor-A.gif (37,142 bytes)
0001-Update-Layout-for-Node-Editor-B.patch (15,980 bytes)
From 34897860d6ea92fd0f484175dff9b04ba88f27c5 Mon Sep 17 00:00:00 2001
Message-Id: <34897860d6ea92fd0f484175dff9b04ba88f27c5.1612723150.git.bubu@ujevangelizacio.hu>
From: =?UTF-8?q?Gyuris=20Gell=C3=A9rt?= <bubu@ujevangelizacio.hu>
Date: Sun, 7 Feb 2021 19:38:48 +0100
Subject: [PATCH] Update Layout for Node Editor

---
 scribus/ui/nodeeditpalette.cpp | 138 +++++++++++++++------------------
 scribus/ui/nodeeditpalette.h   |   3 +-
 2 files changed, 66 insertions(+), 75 deletions(-)

diff --git a/scribus/ui/nodeeditpalette.cpp b/scribus/ui/nodeeditpalette.cpp
index 0b27e2b32..f2326fa3e 100644
--- a/scribus/ui/nodeeditpalette.cpp
+++ b/scribus/ui/nodeeditpalette.cpp
@@ -26,11 +26,9 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	m_doc = nullptr;
 	unitRatio = 1.0;
 	vboxLayout = new QVBoxLayout(this);
-	vboxLayout->setSpacing(2);
-	vboxLayout->setMargin(5);
-	gridLayout = new QGridLayout();
-	gridLayout->setSpacing(2);
-	gridLayout->setMargin(0);
+	vboxLayout->setSpacing(6);
+	vboxLayout->setContentsMargins(9, 9, 9, 9);
+
 	MoveNode = new QToolButton(this);
 	MoveNode->setText( "" );
 	MoveNode->setIcon(im.loadIcon("MoveNode.png"));
@@ -38,8 +36,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	MoveNode->setContentsMargins(0, 0, 0, 0);
 	MoveNode->setCheckable(true);
 	MoveNode->setChecked(true);
-	MoveNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(MoveNode, 0, 0, 1, 1);
 
 	AddNode = new QToolButton(this);
 	AddNode->setIcon(im.loadIcon("AddNode.png"));
@@ -47,8 +43,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	AddNode->setContentsMargins(0, 0, 0, 0);
 	AddNode->setEnabled(true);
 	AddNode->setCheckable(true);
-	AddNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(AddNode, 0, 1, 1, 1);
 
 	DeleteNode = new QToolButton(this);
 	DeleteNode->setIcon(im.loadIcon("DeleteNode.png"));
@@ -56,24 +50,18 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	DeleteNode->setContentsMargins(0, 0, 0, 0);
 	DeleteNode->setEnabled(true);
 	DeleteNode->setCheckable(true);
-	DeleteNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(DeleteNode, 0, 2, 1, 1);
 
 	ResNode = new QToolButton(this);
 	ResNode->setIcon(im.loadIcon("ResetNode.png"));
 	ResNode->setIconSize(iconSize);
 	ResNode->setContentsMargins(0, 0, 0, 0);
 	ResNode->setEnabled(true);
-	ResNode->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(ResNode, 0, 3, 1, 1);
 
 	MoveControl = new QToolButton(this);
 	MoveControl->setIcon(im.loadIcon("MoveKontrol.png"));
 	MoveControl->setIconSize(iconSize);
 	MoveControl->setContentsMargins(0, 0, 0, 0);
 	MoveControl->setCheckable(true);
-	MoveControl->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(MoveControl, 1, 0, 1, 1);
 
 	AsymMove = new QToolButton(this);
 	AsymMove->setIcon(im.loadIcon("MoveAsym.png"));
@@ -81,8 +69,6 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	AsymMove->setContentsMargins(0, 0, 0, 0);
 	AsymMove->setEnabled(false);
 	AsymMove->setCheckable(true);
-	AsymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(AsymMove, 1, 1, 1, 1);
 
 	SymMove = new QToolButton(this);
 	SymMove->setIcon(im.loadIcon("MoveSym.png"));
@@ -90,16 +76,12 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	SymMove->setContentsMargins(0, 0, 0, 0);
 	SymMove->setEnabled(false);
 	SymMove->setCheckable(true);
-	SymMove->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(SymMove, 1, 2, 1, 1);
 
 	Res1Node = new QToolButton(this);
 	Res1Node->setIcon(im.loadIcon("Reset1Node.png"));
 	Res1Node->setIconSize(iconSize);
 	Res1Node->setContentsMargins(0, 0, 0, 0);
 	Res1Node->setEnabled(false);
-	Res1Node->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(Res1Node, 1, 3, 1, 1);
 
 	PolySplit = new QToolButton(this);
 	PolySplit->setEnabled(false);
@@ -107,202 +89,210 @@ NodePalette::NodePalette( QWidget* parent) : ScrPaletteBase(parent, "nodePalette
 	PolySplit->setIcon(im.loadIcon("PolyCut.png"));
 	PolySplit->setIconSize(iconSize);
 	PolySplit->setContentsMargins(0, 0, 0, 0);
-	PolySplit->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(PolySplit, 2, 0, 1, 1);
 
 	BezierClose = new QToolButton(this);
 	BezierClose->setEnabled(false);
 	BezierClose->setIcon(im.loadIcon("BezierClose.png"));
 	BezierClose->setIconSize(iconSize);
 	BezierClose->setContentsMargins(0, 0, 0, 0);
-	BezierClose->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(BezierClose, 2, 1, 1, 1);
 
 	PolyMirrorH = new QToolButton(this);
 	PolyMirrorH->setIcon(im.loadIcon("hmirror.png"));
 	PolyMirrorH->setIconSize(iconSize);
 	PolyMirrorH->setContentsMargins(0, 0, 0, 0);
-	PolyMirrorH->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(PolyMirrorH, 2, 2, 1, 1);
 
 	PolyMirrorV = new QToolButton(this);
 	PolyMirrorV->setIcon(im.loadIcon("vmirror.png"));
 	PolyMirrorV->setIconSize(iconSize);
 	PolyMirrorV->setContentsMargins(0, 0, 0, 0);
-	PolyMirrorV->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
-	gridLayout->addWidget(PolyMirrorV, 2, 3, 1, 1);
 
 	PolyShearL = new QToolButton(this);
 	PolyShearL->setIcon(im.loadIcon("22/transform-shear-left.png"));
 	PolyShearL->setIconSize(iconSize);
 	PolyShearL->setContentsMargins(0, 0, 0, 0);
-	PolyShearL->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearL->setAutoRepeat(true);
-	gridLayout->addWidget(PolyShearL, 3, 0, 1, 1);
 
 	PolyShearR = new QToolButton(this);
 	PolyShearR->setIcon(im.loadIcon("22/transform-shear-right.png"));
 	PolyShearR->setIconSize(iconSize);
 	PolyShearR->setContentsMargins(0, 0, 0, 0);
-	PolyShearR->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearR->setAutoRepeat(true);
-	gridLayout->addWidget(PolyShearR, 3, 1, 1, 1);
 
 	PolyShearU = new QToolButton(this);
 	PolyShearU->setIcon(im.loadIcon("22/transform-shear-up.png"));
 	PolyShearU->setIconSize(iconSize);
 	PolyShearU->setContentsMargins(0, 0, 0, 0);
-	PolyShearU->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearU->setAutoRepeat(true);
-	gridLayout->addWidget(PolyShearU, 3, 2, 1, 1);
 
 	PolyShearD = new QToolButton(this);
 	PolyShearD->setIcon(im.loadIcon("22/transform-shear-down.png"));
 	PolyShearD->setIconSize(iconSize);
 	PolyShearD->setContentsMargins(0, 0, 0, 0);
-	PolyShearD->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
 	PolyShearD->setAutoRepeat(true);
-	gridLayout->addWidget(PolyShearD, 3, 3, 1, 1);
-	vboxLayout->addLayout(gridLayout);
-
-	gridLayout1 = new QGridLayout();
-	gridLayout1->setSpacing(5);
-	gridLayout1->setMargin(0);
 
 	RotateCCW = new QToolButton(this);
 	RotateCCW->setIcon(im.loadIcon("rotate_ccw.png"));
 	RotateCCW->setIconSize(iconSize);
 	RotateCCW->setContentsMargins(0, 0, 0, 0);
 	RotateCCW->setAutoRepeat(true);
-	gridLayout1->addWidget(RotateCCW, 0, 0, 1, 1);
 
 	RotateCW = new QToolButton(this);
 	RotateCW->setIcon(im.loadIcon("rotate_cw.png"));
 	RotateCW->setIconSize(iconSize);
 	RotateCW->setContentsMargins(0, 0, 0, 0);
 	RotateCW->setAutoRepeat(true);
-	gridLayout1->addWidget(RotateCW, 0, 1, 1, 1);
 
 	RotVal = new QSpinBox(this);
 	RotVal->setMinimum(1);
 	RotVal->setMaximum(180);
 	RotVal->setValue(1);
 	RotVal->setSuffix( QString::fromUtf8(" °"));
-	gridLayout1->addWidget(RotVal, 0, 2, 1, 1);
 
 	Expand = new QToolButton(this);
 	Expand->setIcon(im.loadIcon("expand.png"));
 	Expand->setIconSize(iconSize);
 	Expand->setContentsMargins(0, 0, 0, 0);
 	Expand->setAutoRepeat(true);
-	gridLayout1->addWidget(Expand, 1, 0, 1, 1);
 
 	Shrink = new QToolButton(this);
 	Shrink->setIcon(im.loadIcon("crop.png"));
 	Shrink->setIconSize(iconSize);
 	Shrink->setContentsMargins(0, 0, 0, 0);
 	Shrink->setAutoRepeat(true);
-	gridLayout1->addWidget(Shrink, 1, 1, 1, 1);
 
 	scalePercentage = new QSpinBox(this);
 	scalePercentage->setMinimum(1);
 	scalePercentage->setMaximum(100);
 	scalePercentage->setValue(10);
-	gridLayout1->addWidget(scalePercentage, 1, 2, 1, 1);
 
 	Enlarge = new QToolButton(this);
 	Enlarge->setIcon(im.loadIcon("expand.png"));
 	Enlarge->setIconSize(iconSize);
 	Enlarge->setContentsMargins(0, 0, 0, 0);
 	Enlarge->setAutoRepeat(true);
-	gridLayout1->addWidget(Enlarge, 2, 0, 1, 1);
 
 	Reduce = new QToolButton(this);
 	Reduce->setIcon(im.loadIcon("crop.png"));
 	Reduce->setIconSize(iconSize);
 	Reduce->setContentsMargins(0, 0, 0, 0);
 	Reduce->setAutoRepeat(true);
-	gridLayout1->addWidget(Reduce, 2, 1, 1, 1);
 
 	scaleDistance = new ScrSpinBox( 1, 16777215, this, 0);
+	scaleDistance->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
 	scaleDistance->setValues(-16777215, 16777215, 2, 30);
-	gridLayout1->addWidget(scaleDistance, 2, 2, 1, 1);
-	vboxLayout->addLayout(gridLayout1);
+
+	gridLayout = new QGridLayout();
+	gridLayout->setSpacing(6);
+	gridLayout->setContentsMargins(0, 0, 0, 0);
+	gridLayout->addWidget(MoveNode,        0, 0, 1, 1);
+	gridLayout->addWidget(AddNode,         0, 1, 1, 1);
+	gridLayout->addWidget(DeleteNode,      0, 2, 1, 1);
+	gridLayout->addWidget(MoveControl,     0, 3, 1, 1);
+	gridLayout->addWidget(AsymMove,        0, 4, 1, 1);
+	gridLayout->addWidget(SymMove,         0, 5, 1, 1);
+	gridLayout->addWidget(ResNode,         1, 0, 1, 1);
+	gridLayout->addWidget(Res1Node,        1, 1, 1, 1);
+	gridLayout->addWidget(PolySplit,       1, 2, 1, 1);
+	gridLayout->addWidget(BezierClose,     1, 3, 1, 1);
+	gridLayout->addWidget(PolyMirrorH,     1, 4, 1, 1);
+	gridLayout->addWidget(PolyMirrorV,     1, 5, 1, 1);
+	gridLayout->addWidget(PolyShearL,      2, 0, 1, 1);
+	gridLayout->addWidget(PolyShearR,      2, 1, 1, 1);
+	gridLayout->addWidget(PolyShearU,      2, 2, 1, 1);
+	gridLayout->addWidget(PolyShearD,      2, 3, 1, 1);
+	gridLayout->addWidget(RotVal,          3, 0, 1, 4);
+	gridLayout->addWidget(RotateCCW,       3, 4, 1, 1);
+	gridLayout->addWidget(RotateCW,        3, 5, 1, 1);
+	gridLayout->addWidget(scalePercentage, 4, 0, 1, 4);
+	gridLayout->addWidget(Expand,          4, 4, 1, 1);
+	gridLayout->addWidget(Shrink,          4, 5, 1, 1);
+	gridLayout->addWidget(scaleDistance,   5, 0, 1, 4);
+	gridLayout->addWidget(Enlarge,         5, 4, 1, 1);
+	gridLayout->addWidget(Reduce,          5, 5, 1, 1);
+	vboxLayout->addLayout(gridLayout);
 
 	gridLayout2 = new QGridLayout();
-	gridLayout2->setSpacing(5);
-	gridLayout2->setMargin(0);
+	gridLayout2->setSpacing(6);
+	gridLayout2->setContentsMargins(0, 0, 0, 0);
 
-	QSpacerItem* spacer = new QSpacerItem( 3, 3, QSizePolicy::Fixed, QSizePolicy::Fixed );
+	QSpacerItem* spacer = new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed );
 	vboxLayout->addItem(spacer);
 
 	AbsMode = new QGroupBox( "&Absolute Coordinates", this );
 	AbsMode->setCheckable(true);
 	AbsMode->setChecked(false);
 	vboxLayout1 = new QVBoxLayout(AbsMode);
-	vboxLayout1->setSpacing(2);
-	vboxLayout1->setMargin(5);
+	vboxLayout1->setSpacing(6);
+	vboxLayout1->setContentsMargins(9, 9, 9, 9);
 	absToCanvas = new QRadioButton( tr("to Canvas"), AbsMode);
 	vboxLayout1->addWidget(absToCanvas);
 	absToPage = new QRadioButton( tr("to Page"), AbsMode);
 	vboxLayout1->addWidget(absToPage);
 	absToCanvas->setChecked(true);
-	gridLayout2->addWidget(AbsMode, 1, 0, 1, 2);
+	vboxLayout->addWidget(AbsMode);
+
+	gridLayout2 = new QGridLayout();
+	gridLayout2->setSpacing(6);
+	gridLayout2->setContentsMargins(0, 0, 0, 0);
+	gridLayout2->setColumnStretch(0, 0);
+	gridLayout2->setColumnStretch(1, 1);
 
 	TextLabel1 = new QLabel(this);
-	gridLayout2->addWidget(TextLabel1, 2, 0, 1, 1);
+	gridLayout2->addWidget(TextLabel1, 0, 0, 1, 1);
 
 	XSpin = new ScrSpinBox( 0, 16777215, this, 2 );
 	XSpin->setEnabled(false);
-	gridLayout2->addWidget(XSpin, 2, 1, 1, 1);
+	gridLayout2->addWidget(XSpin, 0, 1, 1, 1);
 
 	TextLabel2 = new QLabel(this);
-	gridLayout2->addWidget(TextLabel2, 3, 0, 1, 1);
+	gridLayout2->addWidget(TextLabel2, 1, 0, 1, 1);
 
 	YSpin = new ScrSpinBox( 0, 16777215, this, 2 );
 	YSpin->setEnabled(false);
-	gridLayout2->addWidget(YSpin, 3, 1, 1, 1);
+	gridLayout2->addWidget(YSpin, 1, 1, 1, 1);
+	vboxLayout->addLayout(gridLayout2);
+
 	TextLabel1->setBuddy(XSpin);
 	TextLabel2->setBuddy(YSpin);
 
 	EditCont = new QCheckBox(this);
 	EditCont->setChecked(false);
-	gridLayout2->addWidget(EditCont, 4, 0, 1, 2);
+	vboxLayout->addWidget(EditCont);
 
 	PreviewMode = new QCheckBox(this);
 	PreviewMode->setChecked(false);
-	gridLayout2->addWidget(PreviewMode, 5, 0, 1, 2);
+	vboxLayout->addWidget(PreviewMode);
 
 	ResetCont = new QPushButton(this);
 	ResetCont->setEnabled(false);
-	gridLayout2->addWidget(ResetCont, 6, 0, 1, 2);
+	vboxLayout->addWidget(ResetCont);
 
 	ResetContClip = new QPushButton(this);
 	ResetContClip->setEnabled(true);
-	ResetContClip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
 	ResetContClip->hide();
-	gridLayout2->addWidget(ResetContClip, 7, 0, 1, 2);
+	vboxLayout->addWidget(ResetContClip);
 
 	ResetShape2Clip = new QPushButton(this);
 	ResetShape2Clip->setEnabled(true);
-	ResetShape2Clip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(6), static_cast<QSizePolicy::Policy>(6)));
 	ResetShape2Clip->hide();
-	gridLayout2->addWidget(ResetShape2Clip, 8, 0, 1, 2);
+	vboxLayout->addWidget(ResetShape2Clip);
 
 	resetDefaultButton = new QPushButton(this);
 	resetDefaultButton->setEnabled(true);
-	gridLayout2->addWidget(resetDefaultButton, 9, 0, 1, 2);
+	vboxLayout->addWidget(resetDefaultButton);
 
+	hboxLayout = new QHBoxLayout(this);
+	hboxLayout->setSpacing(6);
+	hboxLayout->setContentsMargins(0, 0, 0, 0);
 	editEditButton = new QPushButton(IconManager::instance().loadIcon("22/exit.png"), tr("OK"), this);
 	editEditButton->setEnabled(true);
 	editEditButton->setDefault(true);
-	gridLayout2->addWidget(editEditButton, 10, 0, 1, 1);
-
+	hboxLayout->addWidget(editEditButton);
 	cancelEditButton = new QPushButton( tr("Cancel"), this);
 	cancelEditButton->setEnabled(true);
-	gridLayout2->addWidget(cancelEditButton, 10, 1, 1, 1);
+	hboxLayout->addWidget(cancelEditButton);
+	vboxLayout->addLayout(hboxLayout);
 
-	vboxLayout->addLayout(gridLayout2);
 	resize(QSize(170, 380).expandedTo(minimumSizeHint()));
 
 	languageChange();
diff --git a/scribus/ui/nodeeditpalette.h b/scribus/ui/nodeeditpalette.h
index 74446f63a..d33463bf8 100644
--- a/scribus/ui/nodeeditpalette.h
+++ b/scribus/ui/nodeeditpalette.h
@@ -17,6 +17,7 @@ for which a new license (GPL+exception) is in place.
 #include <QRadioButton>
 #include <QGridLayout>
 #include <QVBoxLayout>
+#include <QHBoxLayout>
 #include <QCloseEvent>
 
 class QEvent;
@@ -138,8 +139,8 @@ protected:
 
 	QVBoxLayout *vboxLayout { nullptr };
 	QVBoxLayout *vboxLayout1 { nullptr };
+	QHBoxLayout *hboxLayout { nullptr };
 	QGridLayout *gridLayout { nullptr };
-	QGridLayout *gridLayout1 { nullptr };
 	QGridLayout *gridLayout2 { nullptr };
 
 	ScribusDoc *m_doc { nullptr };
-- 
2.27.0

node_editor-B.gif (38,318 bytes)
node_editor-B.gif (38,318 bytes)

bubu

2021-02-19 18:28

reporter   ~0048863

@jghali, please explain your opinion about this patches. What can I do to take this issue forward ? Should I create an another proposal?

Issue History

Date Modified Username Field Change
2021-02-07 18:55 bubu New Issue
2021-02-07 18:55 bubu File Added: 0001-Update-Layout-for-Node-Editor-A.patch
2021-02-07 18:55 bubu File Added: node_editor-A.gif
2021-02-07 18:55 bubu File Added: 0001-Update-Layout-for-Node-Editor-B.patch
2021-02-07 18:55 bubu File Added: node_editor-B.gif
2021-02-09 04:30 PeterBenedek Relationship added child of 0013906
2021-02-19 18:28 bubu Note Added: 0048863