r19405 by craig - Remove hard coded button height in master page palette and do it dynamically

scribus-commit scribus-commit at lists.scribus.net
Mon Aug 4 20:04:30 UTC 2014


Author: craig
Date: Mon Aug  4 20:04:30 2014
New Revision: 19405

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19405
Log:
Remove hard coded button height in master page palette and do it dynamically

Added:
    trunk/Scribus/scribus/util_os.cpp   (with props)
    trunk/Scribus/scribus/util_os.h   (with props)
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
    trunk/Scribus/scribus/ui/pagepalette_masterpages.h
    trunk/Scribus/scribus/ui/pagepalette_masterpagesbase.ui

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19405&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Mon Aug  4 20:04:30 2014
@@ -737,6 +737,7 @@
 	util_icon.cpp
 	util_layer.cpp
 	util_math.cpp
+	util_os.cpp
 	util_printer.cpp
 	util_text.cpp
 	vgradient.cpp

Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19405&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp Mon Aug  4 20:04:30 2014
@@ -33,6 +33,7 @@
 #include "scribusXml.h"
 #include "selection.h"
 #include "util_icon.h"
+#include "util_os.h"
 
 PagePalette_MasterPages::PagePalette_MasterPages( QWidget* parent, ScribusView *pCurrentView, QString masterPageName) : QWidget(parent)
 {
@@ -47,7 +48,7 @@
 	deleteButton->setIcon(QIcon(loadIcon("16/edit-delete.png")));
 
 	masterPageListBox->setSelectionMode(QAbstractItemView::ExtendedSelection);
-
+	styleChange();
 	languageChange();
 
 	if (masterPageName.isEmpty())
@@ -128,6 +129,15 @@
 	deleteButton->setToolTip( tr( "Delete the selected master page" ) );
 	newButton->setToolTip( tr( "Add a new master page" ) );
 	importButton->setToolTip( tr( "Import master pages from another document" ) );
+}
+
+void PagePalette_MasterPages::styleChange()
+{
+	PrefsManager* prefsManager = PrefsManager::instance();
+	if (prefsManager->appPrefs.uiPrefs.style=="Macintosh" || (os_is_osx() && prefsManager->appPrefs.uiPrefs.style==""))
+		finishButton->setMinimumHeight(32);
+	else
+		finishButton->setMinimumHeight(0);
 }
 
 void PagePalette_MasterPages::deleteMasterPage()
@@ -550,6 +560,11 @@
 		languageChange();
 		return;
 	}
+	else if (e->type() == QEvent::StyleChange)
+	{
+		styleChange();
+		return;
+	}
 
 	QWidget::changeEvent(e);
 }

Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19405&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.h
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.h (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.h Mon Aug  4 20:04:30 2014
@@ -39,6 +39,7 @@
 
 public slots:
 	void languageChange();
+	void styleChange();
 	void selectMasterPage(QString name);
 
 private:

Modified: trunk/Scribus/scribus/ui/pagepalette_masterpagesbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19405&path=/trunk/Scribus/scribus/ui/pagepalette_masterpagesbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpagesbase.ui (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpagesbase.ui Mon Aug  4 20:04:30 2014
@@ -104,12 +104,6 @@
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>32</height>
-      </size>
-     </property>
      <property name="text">
       <string><<< Return to Normal Page Mode</string>
      </property>




More information about the scribus-commit mailing list