r17271 by fschmid - Fixed Bug 10564: "An Option to delete a single Tabulator on the Style Manager.", by improving the visusal feedback when dragging with the mouse and added a Button to delete a single Tabulator.

scribus-commit scribus-commit at lists.scribus.net
Thu Feb 2 22:39:58 UTC 2012


Author: fschmid
Date: Thu Feb  2 22:39:57 2012
New Revision: 17271

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17271
Log:
Fixed Bug 10564: "An Option to delete a single Tabulator on the Style Manager.", by improving the visusal feedback when dragging with the mouse and added a Button to delete a single Tabulator.

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

Modified: trunk/Scribus/scribus/ui/tabruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17271&path=/trunk/Scribus/scribus/ui/tabruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabruler.cpp (original)
+++ trunk/Scribus/scribus/ui/tabruler.cpp Thu Feb  2 22:39:57 2012
@@ -343,6 +343,10 @@
 			}
 		}
 	}
+	if ((mousePressed) && ((m->y() > height()) || (m->y() < 0) || (m->x() < 0) || (m->x() > width())))
+	{
+		qApp->changeOverrideCursor(QCursor(loadIcon("DelPoint.png"), 1, 1));
+	}
 }
 
 void RulerT::leaveEvent(QEvent*)
@@ -428,6 +432,24 @@
 		return;
 	tabValues[actTab].tabPosition = t;
 	updateTabList();
+	repaint();
+}
+
+void RulerT::removeActTab()
+{
+	if (actTab > -1)
+	{
+		tabValues.removeAt(actTab);
+		actTab = 0;
+		if (tabValues.count() != 0)
+		{
+			emit typeChanged(tabValues[actTab].tabType);
+			emit tabMoved(tabValues[actTab].tabPosition);
+			emit fillCharChanged(tabValues[actTab].tabFillChar);
+		}
+		else
+			emit noTabs();
+	}
 	repaint();
 }
 
@@ -552,6 +574,9 @@
 	clearButton->setText( tr( "Delete All" ) );
 	indentLayout->addSpacing(20);
 	indentLayout->addWidget( clearButton);
+	clearOneButton = new QPushButton( this );
+	clearOneButton->setText( tr( "Delete Selected" ) );
+	indentLayout->addWidget( clearOneButton);
 	indentLayout->addStretch(10);
 	if (!haveFirst)
 	{
@@ -571,6 +596,7 @@
 	typeCombo->setEnabled(false);
 	if (Tabs.count() == 0)
 		clearButton->setEnabled(false);
+	clearOneButton->setEnabled(false);
 	resize( minimumSizeHint() );
 	connect(rulerScrollL, SIGNAL(clicked()), ruler, SLOT(decreaseOffset()));
 	connect(rulerScrollR, SIGNAL(clicked()), ruler, SLOT(increaseOffset()));
@@ -587,6 +613,7 @@
 	connect(ruler, SIGNAL(noTabs()), this, SLOT(lastTabRemoved()));
 	connect(tabData, SIGNAL(valueChanged(double)), this, SLOT(setTab()));
 	connect(clearButton, SIGNAL(clicked()), this, SLOT(clearAll()));
+	connect(clearOneButton, SIGNAL(clicked()), this, SLOT(clearOne()));
 
 	tabFillCombo->setToolTip( tr( "Fill Character of Tab" ) );
 	typeCombo->setToolTip( tr( "Type/Orientation of Tab" ) );
@@ -609,6 +636,7 @@
 		rightIndentLabel->setToolTip(rightIndentData->toolTip());
 	}
 	clearButton->setToolTip( tr( "Delete all Tabulators" ) );
+	clearOneButton->setToolTip( tr("Delete selected Tabulator"));
 	QString ein = unitGetSuffixFromIndex(dEin);
 	if (dEin == 2)
 	{
@@ -643,6 +671,7 @@
 	ruler->setTabs(Tabs, dEin);
 	if (Tabs.count() == 0)
 		clearButton->setEnabled(false);
+	clearOneButton->setEnabled(false);
 	tabData->setEnabled(false);
 	tabFillCombo->setEnabled(false);
 	typeCombo->setEnabled(false);
@@ -672,11 +701,19 @@
 	emit tabsChanged();
 }
 
+void Tabruler::clearOne()
+{
+	ruler->removeActTab();
+	emit tabrulerChanged();
+	emit tabsChanged();
+}
+
 void Tabruler::tabAdded()
 {
 	typeCombo->setEnabled(true);
 	tabData->setEnabled(true);
 	clearButton->setEnabled(true);
+	clearOneButton->setEnabled(true);
 	tabFillCombo->setEnabled(true);
 	emit tabrulerChanged();
 	emit tabsChanged();
@@ -687,6 +724,7 @@
 	typeCombo->setEnabled(false);
 	tabData->setEnabled(false);
 	clearButton->setEnabled(false);
+	clearOneButton->setEnabled(false);
 	tabFillCombo->setEnabled(false);
 	emit tabrulerChanged();
 	emit tabsChanged();

Modified: trunk/Scribus/scribus/ui/tabruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17271&path=/trunk/Scribus/scribus/ui/tabruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/tabruler.h (original)
+++ trunk/Scribus/scribus/ui/tabruler.h Thu Feb  2 22:39:57 2012
@@ -54,6 +54,7 @@
 	void changeTab(int t);
 	void changeTabChar(QChar t);
 	void moveTab(double t);
+	void removeActTab();
 	void moveFirstLine(double t);
 	void moveLeftIndent(double t);
 
@@ -103,6 +104,7 @@
 	void resetOFfL();
 	void resetOFfR();
 	void clearAll();
+	void clearOne();
 	void tabAdded();
 	void lastTabRemoved();
 	void setTabType(int t);
@@ -156,6 +158,7 @@
 	ScrSpinBox* leftIndentData;
 	ScrSpinBox* rightIndentData;
 	QPushButton* clearButton;
+	QPushButton* clearOneButton;
 
 	double docUnitRatio;
 protected slots:




More information about the scribus-commit mailing list