r15592 by craig - Add image scaling link button functionality back
scribus-commit
scribus-commit at lists.scribus.net
Wed Oct 20 21:22:58 CEST 2010
Author: craig
Date: Wed Oct 20 19:22:58 2010
New Revision: 15592
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15592
Log:
Add image scaling link button functionality back
Modified:
trunk/Scribus/scribus/ui/prefs_itemtools.cpp
trunk/Scribus/scribus/ui/prefs_itemtools.h
trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
Modified: trunk/Scribus/scribus/ui/prefs_itemtools.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15592&path=/trunk/Scribus/scribus/ui/prefs_itemtools.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtools.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtools.cpp Wed Oct 20 19:22:58 2010
@@ -7,6 +7,7 @@
#include "ui/prefs_itemtools.h"
#include "ui/arrowchooser.h"
+#include "ui/linkbutton.h"
#include "prefsstructs.h"
#include "scrspinbox.h"
#include "scribusdoc.h"
@@ -14,6 +15,7 @@
#include "commonstrings.h"
#include "prefsmanager.h"
#include "sampleitem.h"
+
Prefs_ItemTools::Prefs_ItemTools(QWidget* parent, ScribusDoc* doc)
: Prefs_Pane(parent),
@@ -44,6 +46,7 @@
void Prefs_ItemTools::languageChange()
{
textPreviewWidget->setText( tr( "Woven silk pyjamas exchanged for blue quartz" ));
+ scalingLockToolButton->setToolTip( tr( "Keep horizontal and vertical scaling the same" ) );
}
void Prefs_ItemTools::unitChange(int newIndex)
@@ -290,9 +293,9 @@
connect(textColorShadingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFontPreview()));
// connect(buttonGroup3, SIGNAL(toggled(bool)), this, SLOT(changeImageScalingFree(bool)));
// connect(buttonGroup5, SIGNAL(toggled(bool)), this, SLOT(changeImageScalingRatio(bool)));
-// connect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
-// connect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
-// connect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
+ connect(scalingLockToolButton, SIGNAL(clicked()), this, SLOT(toggleImagesScalingChain()));
+ connect(imageHorizontalScalingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(imageHorizontalScalingChange()));
+ connect(imageVerticalScalingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(imageVerticalScalingChange()));
// connect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
}
else
@@ -305,9 +308,9 @@
disconnect(textColorShadingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateFontPreview()));
// disconnect(buttonGroup3, SIGNAL(toggled(bool)), this, SLOT(changeImageScalingFree(bool)));
// disconnect(buttonGroup5, SIGNAL(toggled(bool)), this, SLOT(changeImageScalingRatio(bool)));
-// disconnect(chainButton, SIGNAL(clicked()), this, SLOT(toggleChain()));
-// disconnect(scalingHorizontal, SIGNAL(valueChanged(int)), this, SLOT(hChange()));
-// disconnect(scalingVertical, SIGNAL(valueChanged(int)), this, SLOT(vChange()));
+ disconnect(scalingLockToolButton, SIGNAL(clicked()), this, SLOT(toggleImagesScalingChain()));
+ disconnect(imageHorizontalScalingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(imageHorizontalScalingChange()));
+ disconnect(imageVerticalScalingSpinBox, SIGNAL(valueChanged(int)), this, SLOT(imageVerticalScalingChange()));
// disconnect(tabFillCombo, SIGNAL(activated(int)), this, SLOT(setFillChar(int)));
}
}
@@ -363,3 +366,21 @@
textPreviewWidget->setPixmap(si.getSample(textPreviewWidget->width(), textPreviewWidget->height()));
}
+void Prefs_ItemTools::toggleImagesScalingChain()
+{
+ imageHorizontalScalingChange();
+}
+
+void Prefs_ItemTools::imageHorizontalScalingChange()
+{
+ if (scalingLockToolButton->isChecked())
+ imageVerticalScalingSpinBox->setValue(imageHorizontalScalingSpinBox->value());
+}
+
+void Prefs_ItemTools::imageVerticalScalingChange()
+{
+ if (scalingLockToolButton->isChecked())
+ imageHorizontalScalingSpinBox->setValue(imageVerticalScalingSpinBox->value());
+}
+
+
Modified: trunk/Scribus/scribus/ui/prefs_itemtools.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15592&path=/trunk/Scribus/scribus/ui/prefs_itemtools.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtools.h (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtools.h Wed Oct 20 19:22:58 2010
@@ -32,6 +32,9 @@
protected slots:
void enableSignals(bool on);
void updateFontPreview();
+ void toggleImagesScalingChain();
+ void imageHorizontalScalingChange();
+ void imageVerticalScalingChange();
protected:
ScribusDoc* m_doc;
Modified: trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15592&path=/trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_itemtoolsbase.ui Wed Oct 20 19:22:58 2010
@@ -851,9 +851,15 @@
</layout>
</item>
<item>
- <widget class="QToolButton" name="scalingLockToolButton">
+ <widget class="LinkButton" name="scalingLockToolButton">
<property name="text">
<string>...</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
</property>
</widget>
</item>
@@ -1335,6 +1341,11 @@
<header>ui/polygonwidget.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>LinkButton</class>
+ <extends>QToolButton</extends>
+ <header>ui/linkbutton.h</header>
+ </customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
More information about the scribus-commit
mailing list