r19524 by craig - #12662: Enable the delete key in the colours and fills list window

scribus-commit scribus-commit at lists.scribus.net
Mon Sep 22 20:12:45 UTC 2014


Author: craig
Date: Mon Sep 22 20:12:44 2014
New Revision: 19524

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19524
Log:
#12662: Enable the delete key in the colours and fills list window

Modified:
    trunk/Scribus/scribus/ui/paintmanager.cpp
    trunk/Scribus/scribus/ui/paintmanager.h

Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19524&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Mon Sep 22 20:12:44 2014
@@ -713,6 +713,8 @@
 				continue;
 			if (it == colorItems)
 				continue;
+			if (it == patternItems)
+				continue;
 			if (it->text(0) == "Black")
 				continue;
 			if (it->text(0) == "White")
@@ -1919,3 +1921,16 @@
 	}
 	return CommonStrings::None;
 }
+
+void PaintManagerDialog::keyPressEvent(QKeyEvent* k)
+{
+	QList<QTreeWidgetItem *> selItems = dataTree->selectedItems();
+	QString belowText = dataTree->itemBelow(selItems[selItems.count()-1])->text(0);
+
+	if (k->modifiers()==Qt::NoModifier && (k->key()==Qt::Key_Delete || k->key()==Qt::Key_Backspace))
+		removeColorItem();
+
+	QList<QTreeWidgetItem *> belowItems=dataTree->findItems(belowText, Qt::MatchFixedString|Qt::MatchCaseSensitive|Qt::MatchRecursive);
+	if(belowItems.count()>0)
+		belowItems[0]->setSelected(true);
+}

Modified: trunk/Scribus/scribus/ui/paintmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19524&path=/trunk/Scribus/scribus/ui/paintmanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.h (original)
+++ trunk/Scribus/scribus/ui/paintmanager.h Mon Sep 22 20:12:44 2014
@@ -52,6 +52,10 @@
 		It's used e.g. in BarcodeGenerator plugin.
 		*/
 		QString selectedColorName();
+
+		void keyPressEvent(QKeyEvent *k);
+
+
 		ScribusDoc *m_doc;
 		ScribusMainWindow *mainWin;
 		QHash<QString, VGradient> dialogGradients;




More information about the scribus-commit mailing list