[Digikam-devel] [Fwd: extragear/graphics/digikam/imageplugins/freerotation] - Qt 4.5 required
Michael G. Hansen
mike at mghansen.de
Fri Oct 2 19:32:38 BST 2009
With this patch, compilation with Qt 4.4.3 breaks because
QString::repeated was added in Qt 4.5. (used in next two commits as well).
Michael
-------- Original Message --------
Subject: extragear/graphics/digikam/imageplugins/freerotation
Date: Fri, 02 Oct 2009 15:46:16 +0000
From: Andi Clemens <andi.clemens at gmx.net>
Reply-To: kde-commits at kde.org
To: kde-commits at kde.org
SVN commit 1030575 by aclemens:
Center the text and try to avoid icon movement. It still moves a little bit
though. Isn't there a method to avoid icon re-positioning in QPushButtons?
M +11 -1 freerotationtool.cpp
---
trunk/extragear/graphics/digikam/imageplugins/freerotation/freerotationtool.cpp
#1030574:1030575
@@ -470,13 +470,23 @@
QString FreeRotationTool::generateButtonLabel(const QPoint& p)
{
QString label = i18n("Click to set");
+ int length = label.count();
if (pointIsValid(p))
{
// label = QString("(%1, %2)")
// .arg(p.x())
// .arg(p.y());
- label = i18nc("point has been set and is valid", "Ok");
+ label = i18nc("point has been set and is valid", "Ok!");
+
+ // fill with additional whitespace, to match the original label
length and center
+ // the text, without moving the button icon
+ int diff = qAbs<int>(length - label.count());
+
+ QString delimiter(" ");
+ int repeat = (diff / 2) + 1;
+ label.prepend(delimiter.repeated(repeat));
+ label.append(delimiter.repeated(repeat));
}
return label;
}
--
Michael Hansen - mike at mghansen.de
http://www.pfna.de/
More information about the Digikam-devel
mailing list