summaryrefslogtreecommitdiffstats
path: root/kstyles/asteroid/asteroid.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-13 13:38:13 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-13 13:38:13 -0500
commit2b586b805722f55f80155cd1df5ece2e79747964 (patch)
treec0beb8eb4a43997b659ddc4351db8f1295c9fcc5 /kstyles/asteroid/asteroid.cpp
parent3c83d427acfdb89355b76e95c048fa27e586301c (diff)
downloadtdelibs-2b586b805722f55f80155cd1df5ece2e79747964.tar.gz
tdelibs-2b586b805722f55f80155cd1df5ece2e79747964.zip
Fix Asteroid spinbox hints
Diffstat (limited to 'kstyles/asteroid/asteroid.cpp')
-rw-r--r--kstyles/asteroid/asteroid.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/kstyles/asteroid/asteroid.cpp b/kstyles/asteroid/asteroid.cpp
index 34e3f6064..ca93f0b37 100644
--- a/kstyles/asteroid/asteroid.cpp
+++ b/kstyles/asteroid/asteroid.cpp
@@ -54,6 +54,8 @@
#define ETCH_X_OFFSET 1
#define ETCH_Y_OFFSET 1
+#define SPINBOX_BUTTON_WIDTH 12
+
//#define POPUPMENUITEM_TEXT_ETCH_CONDITIONS ( etchtext && !enabled && !active )
#define POPUPMENUITEM_TEXT_ETCH_CONDITIONS ( etchtext && !enabled )
@@ -2112,7 +2114,7 @@ void AsteroidStyle::drawComplexControl(TQ_ComplexControl cc,
case CC_SpinWidget: {
int x, y, x2, y2, w, h;
- int aw = 12; // arrow button width
+ int aw = SPINBOX_BUTTON_WIDTH; // arrow button width
r.coords(&x, &y, &x2, &y2);
r.rect(&x, &y, &w, &h);
@@ -2434,6 +2436,39 @@ TQRect AsteroidStyle::querySubControlMetrics(TQ_ComplexControl cc,
break;
}
+ case CC_SpinWidget: {
+ int fw = pixelMetric(PM_SpinBoxFrameWidth, ceData, elementFlags, w);
+ TQSize bs;
+ bs.setHeight(ceData.rect.height()/2 - fw);
+ if (bs.height() < 8) {
+ bs.setHeight(8);
+ }
+ bs.setWidth(SPINBOX_BUTTON_WIDTH);
+ bs = bs.expandedTo(TQApplication::globalStrut());
+ int y = fw;
+ int x, lx, rx;
+ x = ceData.rect.width() - y - bs.width();
+ lx = fw;
+ rx = x - fw;
+ switch ( sc ) {
+ case SC_SpinWidgetUp:
+ return TQRect(x, y, bs.width(), bs.height());
+ case SC_SpinWidgetDown:
+ return TQRect(x, y + bs.height(), bs.width(), bs.height());
+ case SC_SpinWidgetButtonField:
+ return TQRect(x, y, bs.width(), ceData.rect.height() - (2*fw));
+ case SC_SpinWidgetEditField:
+ return TQRect(lx, fw, rx, ceData.rect.height() - (2*fw));
+ case SC_SpinWidgetFrame:
+ return ceData.rect;
+ default:
+ return KStyle::querySubControlMetrics(cc, ceData, elementFlags, sc, o, w);
+ break;
+ }
+
+ break;
+ }
+
default: {
return KStyle::querySubControlMetrics(cc, ceData, elementFlags, sc, o, w);
}