r23300 by jghali - #15883: The color picker should suggest the RGB color code as the default name (ale)

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 29 12:36:22 UTC 2019


Author: jghali
Date: Tue Oct 29 12:36:21 2019
New Revision: 23300

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23300
Log:
#15883: The color picker should suggest the RGB color code as the default name (ale)

Modified:
    trunk/Scribus/scribus/canvasmode_eyedropper.cpp

Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23300&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp	Tue Oct 29 12:36:21 2019
@@ -149,7 +149,7 @@
 	QColor selectedColor=i.pixel(0, 0);
 
 	bool found=false;
-    ColorList::Iterator it;
+	ColorList::Iterator it;
 	for (it = m_doc->PageColors.begin(); it != m_doc->PageColors.end(); ++it)
 	{
 		if (selectedColor== ScColorEngine::getRGBColor(it.value(), m_doc))
@@ -158,6 +158,7 @@
 			break;
 		}
 	}
+
 	QString colorName;
 	if (found)
 		colorName=it.key();
@@ -168,7 +169,7 @@
 		QString questionString="<qt>" + tr("The selected color does not exist in the document's color set. Please enter a name for this new color.") + "</qt>";
 		do
 		{
-			colorName = QInputDialog::getText(m_ScMW, tr("Color Not Found"), questionString, QLineEdit::Normal, QString(), &ok);
+			colorName = QInputDialog::getText(m_ScMW, tr("Color Not Found"), questionString, QLineEdit::Normal, tr("RGB %1").arg(selectedColor.name()), &ok);
 			if (ok)
 			{
 				if (m_doc->PageColors.contains(colorName))
@@ -187,6 +188,7 @@
 		else
 			colorName.clear();
 	}
+
 	uint docSelectionCount=m_doc->m_Selection->count();
 	if (!colorName.isNull() && docSelectionCount > 0)
 	{




More information about the scribus-commit mailing list