View Issue Details

IDProjectCategoryView StatusLast Update
0017957ScribusGeneralpublic2026-08-30 10:15
Reporterqirat Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
PlatformLinuxOSFedora WorkstationOS Version44
Product Version1.7.4.svn 
Summary0017957: [patch] Gradient stop selection signal cleanup
Description- Separates gradient-stop selection from gradient modification semantics.
- Removes `GradientEditor::slotDisplayStop()` emitting `gradientChanged()` when a stop is only selected.
- Adds a dedicated `GradientPreview::gradientChanged()` signal for real preview edits.
- Tracks preview modifications so dragging emits a change only when a stop position actually changes.
- Keeps add/remove/move and other real gradient edits propagating `gradientChanged()`.
- Reduces unnecessary downstream update traffic and makes the signal contract easier to reason about.
- No intended user-facing behaviour change.
- Independent of GP1; can be applied and reviewed separately.
- Files touched: `gradienteditor.cpp`, `gradientpreview.cpp`, `gradientpreview.h`.
Tags#please_test
Attached Files
gp2-gradient-stop-selection-r27797-v1.0.patch (2,656 bytes)   
Index: scribus/ui/gradienteditor.cpp
===================================================================
--- scribus/ui/gradienteditor.cpp	(revision 27797)
+++ scribus/ui/gradienteditor.cpp	(working copy)
@@ -48,6 +48,7 @@
 	connect(stopOpacity, SIGNAL(valueChanged(double)), this, SLOT(setStopColor()));
 	connect(stopShade  , SIGNAL(valueChanged(double)), this, SLOT(setStopColor()));
 	connect(Preview, SIGNAL(selectedStop(VColorStop*)), this, SLOT(slotDisplayStop(VColorStop*)));
+	connect(Preview, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
 	connect(Preview, SIGNAL(selectedPosition(double)), this, SLOT(setPos(double)));
 	connect(colorListBox, SIGNAL(itemSelectionChanged()), this, SLOT(setStopColor()));
 	connect(this, SIGNAL(gradientChanged()), this, SLOT(updateColorButton()));
@@ -89,7 +90,6 @@
 	slotColor(stop->name, stop->shade);
 	setGradTrans(stop->opacity);
 	updateColorButton();
-	emit gradientChanged();
 }
 
 void GradientEditor::slotColor(const QString& name, int shade)
Index: scribus/ui/gradientpreview.cpp
===================================================================
--- scribus/ui/gradientpreview.cpp	(revision 27797)
+++ scribus/ui/gradientpreview.cpp	(working copy)
@@ -165,6 +165,7 @@
 	fill_gradient.setStop(colorL, t, mid, opacityL, nameL, shadeL);
 
 	// Update UI
+	m_gradientModified = true;
 	repaint();
 
 	if (m_activeStop > -1)
@@ -186,6 +187,8 @@
 
 		repaint();
 		emitStop();
+		emit gradientChanged();
+		m_gradientModified = false;
 	}
 }
 
@@ -329,6 +332,7 @@
 
 	if (m->button() == Qt::LeftButton)
 	{
+		m_gradientModified = false;
 		m_activeStop = stopAtPosition(m->pos());
 		m_tmpStop = m_activeStop;
 
@@ -359,6 +363,9 @@
 			m_activeStop = m_tmpStop;
 			repaint();
 			emitStop();
+			if (m_gradientModified)
+				emit gradientChanged();
+			m_gradientModified = false;
 		}
 	}
 }
@@ -385,6 +392,8 @@
 	if (m->buttons() & Qt::LeftButton)
 	{
 		double newPos = percentFromPosition(m_mousePos);
+		if (m_activeStop != -1 && activeStop()->rampPoint != newPos)
+			m_gradientModified = true;
 		updateTmpStop(newPos);
 		emitStopPosition();
 
Index: scribus/ui/gradientpreview.h
===================================================================
--- scribus/ui/gradientpreview.h	(revision 27797)
+++ scribus/ui/gradientpreview.h	(working copy)
@@ -124,6 +124,7 @@
 	bool m_isEditable { true };
 	int m_activeStop { 0 };
 	int m_tmpStop { 0 };
+	bool m_gradientModified { false };
 
 	QRect saveAreaRect() const;
 	QRect canvasRect() const;
@@ -149,6 +150,7 @@
 signals:
 	void selectedStop(VColorStop*);
 	void selectedPosition(double);
+	void gradientChanged();
 
 };
 #endif
PatchYes

Activities

Issue History

Date Modified Username Field Change
2026-08-30 10:15 qirat New Issue
2026-08-30 10:15 qirat Tag Attached: #please_test
2026-08-30 10:15 qirat File Added: gp2-gradient-stop-selection-r27797-v1.0.patch