r21212 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Apr 18 20:42:05 UTC 2016
Author: jghali
Date: Mon Apr 18 20:42:05 2016
New Revision: 21212
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21212
Log:
when starting measurement mode, initialize if possible measurement widget using doc unit
Modified:
trunk/Scribus/scribus/ui/measurements.cpp
Modified: trunk/Scribus/scribus/ui/measurements.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21212&path=/trunk/Scribus/scribus/ui/measurements.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/measurements.cpp (original)
+++ trunk/Scribus/scribus/ui/measurements.cpp Mon Apr 18 20:42:05 2016
@@ -4,8 +4,12 @@
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
+
+#include <cmath>
+
#include "measurements.h"
-#include <cmath>
+#include "scribusdoc.h"
+#include "scribusview.h"
#include "units.h"
using namespace std;
@@ -37,6 +41,20 @@
int minHeight = unitSwitch->minimumSizeHint().height();
unitSwitch->setMinimumSize(textWidth, minHeight);
resize(minimumSizeHint());
+
+ // Try to start with doc unit if possible
+ ScribusView* view = qobject_cast<ScribusView*>(parent);
+ if (view)
+ {
+ ScribusDoc* doc = view->Doc;
+ if (doc)
+ {
+ int unitIndex = doc->unitIndex();
+ unitSwitch->setCurrentIndex(unitIndex);
+ }
+ }
+ setValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+
connect(unitSwitch, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged()));
}
More information about the scribus-commit
mailing list