r20196 by craig - #11351: Add stylesheet for ScToolBar for drop down menu arrows. Arrow image is customisable per icon set.

scribus-commit scribus-commit at lists.scribus.net
Tue Jun 23 09:54:42 UTC 2015


Author: craig
Date: Tue Jun 23 09:54:41 2015
New Revision: 20196

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20196
Log:
#11351: Add stylesheet for ScToolBar for drop down menu arrows. Arrow image is customisable per icon set.

Added:
    trunk/Scribus/resources/iconsets/1_5_0/stylesheet/
    trunk/Scribus/resources/iconsets/1_5_0/stylesheet/down_arrow.png   (with props)
Modified:
    trunk/Scribus/resources/iconsets/CMakeLists.txt
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.css
    trunk/Scribus/scribus/scribus.h

Modified: trunk/Scribus/resources/iconsets/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20196&path=/trunk/Scribus/resources/iconsets/CMakeLists.txt
==============================================================================
--- trunk/Scribus/resources/iconsets/CMakeLists.txt (original)
+++ trunk/Scribus/resources/iconsets/CMakeLists.txt Tue Jun 23 09:54:41 2015
@@ -27,6 +27,10 @@
 FILE( GLOB SCRIBUS_ICONS_1_5_0_32 1_5_0/32/*.jpg 1_5_0/32/*.png 1_5_0/32/*.xpm )
 INSTALL(FILES ${SCRIBUS_ICONS_1_5_0_32} DESTINATION ${ICONDIR}/1_5_0/32)
 
+#Install our stylesheet icons
+FILE( GLOB SCRIBUS_ICONS_1_5_0_STYLE 1_5_0/stylesheet/*.png )
+INSTALL(FILES ${SCRIBUS_ICONS_1_5_0_STYLE} DESTINATION ${ICONDIR}/1_5_0/stylesheet)
+
 #Install our XML
 FILE( GLOB SCRIBUS_XML_1_5_0 1_5_0/*.xml )
 INSTALL(FILES ${SCRIBUS_XML_1_5_0} DESTINATION ${ICONDIR})
@@ -55,6 +59,10 @@
 FILE( GLOB SCRIBUS_ICONS_1_5_1_32 1_5_1/32/*.jpg 1_5_1/32/*.png 1_5_1/32/*.xpm )
 INSTALL(FILES ${SCRIBUS_ICONS_1_5_1_32} DESTINATION ${ICONDIR}/1_5_1/32)
 
+#Install our stylesheet icons
+FILE( GLOB SCRIBUS_ICONS_1_5_1_STYLE 1_5_1/stylesheet/*.png )
+INSTALL(FILES ${SCRIBUS_ICONS_1_5_1_STYLE} DESTINATION ${ICONDIR}/1_5_1/stylesheet)
+
 #Install our XML
 FILE( GLOB SCRIBUS_XML_1_5_1 1_5_1/*.xml )
 INSTALL(FILES ${SCRIBUS_XML_1_5_1} DESTINATION ${ICONDIR})

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20196&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Jun 23 09:54:41 2015
@@ -473,6 +473,8 @@
 	}
 	appModeHelper->setStartupActionsEnabled(false);
 
+	setStyleSheet();
+
 	return retVal;
 }
 
@@ -514,6 +516,35 @@
 	connect(scrActions["toolsToolbarTools"], SIGNAL(toggled(bool)), modeToolBar, SLOT(setVisible(bool)) );
 	connect(viewToolBar, SIGNAL(visibilityChanged(bool)), scrActions["toolsToolbarView"], SLOT(setChecked(bool)));
 	connect(scrActions["toolsToolbarView"], SIGNAL(toggled(bool)), viewToolBar, SLOT(setVisible(bool)) );
+}
+
+void ScribusMainWindow::setStyleSheet()
+{
+	QByteArray stylesheet;
+	if (loadRawText(ScPaths::instance().libDir() + "scribus.css", stylesheet))
+	{
+		QString downArrow(IconManager::instance()->pathForIcon("16/go-down.png"));
+		QByteArray da;
+		da.append(downArrow);
+		stylesheet.replace("___downArrow___", da);
+		QString toolbararrow(IconManager::instance()->pathForIcon("stylesheet/down_arrow.png"));
+		QByteArray tba;
+		tba.append(toolbararrow);
+		stylesheet.replace("___tb_menu_arrow___", tba);
+	}
+
+	layerMenu->setStyleSheet(stylesheet);
+	unitSwitcher->setStyleSheet(stylesheet);
+	zoomDefaultToolbarButton->setStyleSheet(stylesheet);
+	zoomInToolbarButton->setStyleSheet(stylesheet);
+	zoomOutToolbarButton->setStyleSheet(stylesheet);
+	zoomSpinBox->setStyleSheet(stylesheet);
+
+	fileToolBar->setStyleSheet(stylesheet);
+	editToolBar->setStyleSheet(stylesheet);
+	modeToolBar->setStyleSheet(stylesheet);
+	pdfToolBar->setStyleSheet(stylesheet);
+	viewToolBar->setStyleSheet(stylesheet);
 }
 
 
@@ -1247,9 +1278,9 @@
 	zoomInToolbarButton->setDefault( false );
 	zoomInToolbarButton->setAutoDefault( false );
 
-	zoomDefaultToolbarButton->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-original.png")));
-	zoomOutToolbarButton->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-out.png")));
-	zoomInToolbarButton->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-in.png")));
+	zoomDefaultToolbarButton->setIcon(IconManager::instance()->loadIcon("16/zoom-original.png"));
+	zoomOutToolbarButton->setIcon(IconManager::instance()->loadIcon("16/zoom-out.png"));
+	zoomInToolbarButton->setIcon(IconManager::instance()->loadIcon("16/zoom-in.png"));
 
 
 	zoomLayout->addWidget( zoomSpinBox );
@@ -1275,6 +1306,7 @@
 	mainWindowYPosDataLabel->setMinimumWidth(mainWindowYPosDataLabel->fontMetrics().width("99999.999"));
 	statusBarLanguageChange();
 
+	/*
 	QByteArray stylesheet;
 	if (loadRawText(ScPaths::instance().libDir() + "scribus.css", stylesheet))
 	{
@@ -1283,6 +1315,7 @@
 		da.append(downArrow);
 		stylesheet.replace("___downArrow___", da);
 	}
+	*/
 
 	layerMenu->setObjectName("layerMenu");
 	unitSwitcher->setObjectName("unitSwitcher");
@@ -1291,12 +1324,14 @@
 	zoomOutToolbarButton->setObjectName("zoomOutToolbarButton");
 	zoomSpinBox->setObjectName("zoomSpinBox");
 
+	/*
 	layerMenu->setStyleSheet(stylesheet);
 	unitSwitcher->setStyleSheet(stylesheet);
 	zoomDefaultToolbarButton->setStyleSheet(stylesheet);
 	zoomInToolbarButton->setStyleSheet(stylesheet);
 	zoomOutToolbarButton->setStyleSheet(stylesheet);
 	zoomSpinBox->setStyleSheet(stylesheet);
+	*/
 
 	statusBar()->setFont(fo);
 	statusBar()->addPermanentWidget(mainWindowStatusLabel, 5);

Modified: trunk/Scribus/scribus/scribus.css
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20196&path=/trunk/Scribus/scribus/scribus.css
==============================================================================
--- trunk/Scribus/scribus/scribus.css (original)
+++ trunk/Scribus/scribus/scribus.css Tue Jun 23 09:54:41 2015
@@ -53,3 +53,11 @@
 QComboBox#unitSwitcher:on { padding-top: 3px; padding-left: 4px; }
 QComboBox#unitSwitcher::drop-down { subcontrol-origin: padding; subcontrol-position: top right; width: 15px; border-left-width: 1px; border-left-color: darkgray; border-left-style: solid; border-top-right-radius: 3px; border-bottom-right-radius: 3px; }
 
+/*
+FileToolBar QToolButton::menu-indicator { background:red }
+EditToolBar QToolButton::menu-indicator { color:red }
+*/
+ScToolBar QToolButton::menu-indicator { image: url(___tb_menu_arrow___); }
+/*
+PDFToolBar QToolButton::menu-indicator { color:red }
+*/

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20196&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Tue Jun 23 09:54:41 2015
@@ -599,6 +599,7 @@
 	void addDefaultWindowMenuItems(); // addDefaultWindowMenuItems adds the basic Windows menu items, excluding the actual list of windows
 	void initStatusBar(); // setup the statusbar
 	void initToolBars(); // setup the toolbars
+	void setStyleSheet(); //set stylesheet for app
 	//Returns false when there are no fonts
 	void initHyphenator();
 	void initDefaultValues();




More information about the scribus-commit mailing list