r23646 by jghali - Stop using hardcoded icon size in ScToolBar

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 24 01:02:45 UTC 2020


Author: jghali
Date: Fri Apr 24 01:02:45 2020
New Revision: 23646

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23646
Log:
Stop using hardcoded icon size in ScToolBar

Modified:
    trunk/Scribus/scribus/ui/sctoolbar.cpp

Modified: trunk/Scribus/scribus/ui/sctoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23646&path=/trunk/Scribus/scribus/ui/sctoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sctoolbar.cpp	(original)
+++ trunk/Scribus/scribus/ui/sctoolbar.cpp	Fri Apr 24 01:02:45 2020
@@ -29,6 +29,7 @@
 #include <QMenu>
 #include <QPixmap>
 #include <QString>
+#include <QStyle>
 #include <QToolButton>
 
 #include "sctoolbar.h"
@@ -41,10 +42,12 @@
 	m_name(QString("ToolBar-%1").arg(prefName)),
 	parentMW(parent)
 {
-	m_prefs=PrefsManager::instance().prefsFile->getContext(m_name);
+	m_prefs = PrefsManager::instance().prefsFile->getContext(m_name);
 	setObjectName(prefName);
 	setAllowedAreas(Qt::AllToolBarAreas);
-	this->setIconSize(QSize(16,16));
+
+	int smallIconSize = this->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, this);
+	this->setIconSize(QSize(smallIconSize, smallIconSize));
 	/*
 	setCloseMode(Q3DockWindow::Undocked);
 




More information about the scribus-commit mailing list