[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_3_BRANCH: kdepim/kalarm
From:       David Jarvie <software () astrojar ! org ! uk>
Date:       2004-11-30 19:54:51
Message-ID: 20041130195451.033DD1B903 () office ! kde ! org
[Download RAW message or body]

CVS commit by djarvie: 

Fix time spin box layout for right-to-left languages


  M +1 -0      Changelog   1.73.2.14
  M +8 -10     widgets/spinbox2.cpp   1.6.6.2
  M +3 -2      widgets/spinbox2.h   1.4.6.1


--- kdepim/kalarm/Changelog  #1.73.2.13:1.73.2.14
@@ -3,4 +3,5 @@
 === Version 1.1.8 --- 30 November 2004 ===
 Fix random limit on expired alarm discard time if stepping with spinbox buttons.
+Fix time spin box layout for right-to-left languages.
 
 === Version 1.1.7 (KDE 3.3.2) --- 27 November 2004 ===

--- kdepim/kalarm/widgets/spinbox2.cpp  #1.6.6.1:1.6.6.2
@@ -1,6 +1,6 @@
 /*
- *  spinbox2.cpp  -  spin box with extra pair of spin buttons (for QT3)
+ *  spinbox2.cpp  -  spin box with extra pair of spin buttons (for Qt 3)
  *  Program:  kalarm
- *  (C) 2001, 2002 by David Jarvie  software@astrojar.org.uk
+ *  (C) 2001, 2002, 2004 by David Jarvie <software@astrojar.org.uk>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,9 @@
 #include <qstyle.h>
 #include <qobjectlist.h>
+#include <qapplication.h>
 
 #include "spinbox2.moc"
 
+int SpinBox2::mReverseLayout = -1;
 
 SpinBox2::SpinBox2(QWidget* parent, const char* name)
@@ -56,4 +57,6 @@ SpinBox2::SpinBox2(int minValue, int max
 void SpinBox2::init()
 {
+        if (mReverseLayout < 0)
+                mReverseLayout = QApplication::reverseLayout() ? 1 : 0;
         spinbox->setSelectOnStep(false);    // default
         updown2->setSelectOnStep(false);    // always false
@@ -113,7 +116,4 @@ void SpinBox2::valueChange()
 void SpinBox2::stepPage(int step)
 {
-//      bool focus = spinbox->selectOnStep() && updown2->hasFocus();
-//      if (focus)
-//              spinbox->setFocus();    // make displayed text be selected, as for \
stepping with the spinbox buttons  if (abs(step) == updown2->lineStep())
                 spinbox->setValue(updown2->value());
@@ -130,6 +130,4 @@ void SpinBox2::stepPage(int step)
         if (focus)
                 spinbox->selectAll();
-//      if (focus)
-//              updown2->setFocus();
 }
 
@@ -170,6 +168,6 @@ void SpinBox2::getMetrics() const
 {
         QRect rect = updown2->style().querySubControlMetrics(QStyle::CC_SpinWidget, \
                updown2, QStyle::SC_SpinWidgetButtonField);
-        xUpdown2 = rect.left();
-        wUpdown2 = updown2->width() - xUpdown2;
+        xUpdown2 = mReverseLayout ? 0 : rect.left();
+        wUpdown2 = updown2->width() - rect.left();
         xSpinbox = spinbox->style().querySubControlMetrics(QStyle::CC_SpinWidget, \
spinbox, QStyle::SC_SpinWidgetEditField).left();  wGap = 0;

--- kdepim/kalarm/widgets/spinbox2.h  #1.4:1.4.6.1
@@ -145,8 +145,9 @@ class SpinBox2 : public QFrame
                 enum { NO_BUTTON = -1, UP, DOWN, UP2, DOWN2 };
 
+                static int       mReverseLayout;  // widgets are mirrored right to \
left  QFrame*          updown2Frame;
                 QFrame*          spinboxFrame;
-                SpinBox*         updown2;
-                SB2_SpinBox*     spinbox;
+                SpinBox*         updown2;         // the extra pair of spin buttons
+                SB2_SpinBox*     spinbox;         // the visible spin box
                 int              mMinValue;
                 int              mMaxValue;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic