[Kstars-devel] KDE/kdeedu/kstars/kstars/widgets

Jason Harris kstars at 30doradus.org
Tue Nov 27 00:47:36 CET 2007


SVN commit 742037 by harris:

Add up and down arrow icons to the unit-changing buttons of the timestep 
widget.

CCMAIL: kstars-devel at kde.org



 M  +8 -8      timestepbox.h  
 M  +42 -6     timeunitbox.cpp  
 M  +15 -15    timeunitbox.h  


--- trunk/KDE/kdeedu/kstars/kstars/widgets/timestepbox.h #742036:742037
@@ -23,14 +23,14 @@
 #include "timeunitbox.h"
 
 /**@class TimeStepBox
-	*This composite widget consists of a TimeSpinBox (a QSpinBox), coupled with a 
-	*TimeUnitBox (a second pair of up/down buttons).
-	*The second set of buttons makes larger steps through the 82 possible 
-	*time-step values, skipping to the next even unit of time.
-	*@short Composite spinbox for specifying a time step.
-	*@author Jason Harris
-	*@version 1.0
-	*/
+ *This composite widget consists of a TimeSpinBox (a QSpinBox), coupled with a 
+ *TimeUnitBox (a second pair of up/down buttons).
+ *The second set of buttons makes larger steps through the 82 possible 
+ *time-step values, skipping to the next even unit of time.
+ *@short Composite spinbox for specifying a time step.
+ *@author Jason Harris
+ *@version 1.0
+ */
 class TimeStepBox : public QWidget  {
     Q_OBJECT
 public:
--- trunk/KDE/kdeedu/kstars/kstars/widgets/timeunitbox.cpp #742036:742037
@@ -25,6 +25,42 @@
 
 #include <kdebug.h>
 
+static char * const up_arrow[] = {
+"22 11 4 1",
+"       c None",
+".      c #000000",
+"+      c #808080",
+"@      c #BFBFBF",
+"                      ",
+"                      ",
+"          ..          ",
+"         .++.         ",
+"        .+  @.        ",
+"       .+    @.       ",
+"      .+      @.      ",
+"     .+        @.     ",
+"    .+          @.    ",
+"    +            @    ",
+"                      "};
+
+static char * const down_arrow[] = {
+"22 11 4 1",
+"       c None",
+".      c #808080",
+"+      c #BFBFBF",
+"@      c #000000",
+"                      ",
+"    .            +    ",
+"    @.          +@    ",
+"     @.        +@     ",
+"      @.      +@      ",
+"       @.    +@       ",
+"        @.  +@        ",
+"         @..@         ",
+"          @@          ",
+"                      ",
+"                      "};
+
 TimeUnitBox::TimeUnitBox(QWidget *parent, bool daysonly )
         : QWidget( parent ) {
 
@@ -32,12 +68,12 @@
     vlay->setMargin(0);
     vlay->setSpacing(0);
 
-    UpButton = new QPushButton( "+", this );
-    UpButton->setMaximumWidth( 22 );
-    UpButton->setMaximumHeight( 10 );
-    DownButton = new QPushButton( "-", this );
-    DownButton->setMaximumWidth( 22 );
-    DownButton->setMaximumHeight( 10 );
+    UpButton = new QPushButton( QPixmap(up_arrow), "", this );
+    UpButton->setMaximumWidth( 26 );
+    UpButton->setMaximumHeight( 13 );
+    DownButton = new QPushButton( QPixmap(down_arrow), "", this );
+    DownButton->setMaximumWidth( 26 );
+    DownButton->setMaximumHeight( 13 );
 
     vlay->addWidget( UpButton );
     vlay->addWidget( DownButton );
--- trunk/KDE/kdeedu/kstars/kstars/widgets/timeunitbox.h #742036:742037
@@ -24,21 +24,21 @@
 #define DAYUNITS 5
 
 /**@class TimeUnitBox
-	*A pair of buttons, arranged one above the other, labeled "+"/"-".  These buttons 
-	*are to be paired with the TimeSpinBox widget.  Their function is to provide 
-	*a way to cycle through the possible time steps using larger intervals than the up/down
-	*buttons of the TimeSpinBox.  For example, say the Spinbox currently shows a timestep of 
-	*"1 sec".  Increasing the timestep with the spinbox up-button will change it to
-	*"2 sec", while using the "+" button of this widget will change it to "1 min".
-	*
-	*The idea is that these "outer" buttons always change to the next even unit of time.
-	*
-	*@note this widget is not to be used on its own; it is combined with the TimeSpinBox 
-	*widget to form the TimeStepBox composite widget. 
-	*@short provides a second set of up/down buttons for TimeStepBox.
-	*@author Jason Harris
-	*@version 1.0
-	*/
+ *A pair of buttons, arranged one above the other, labeled "+"/"-".  These buttons 
+ *are to be paired with the TimeSpinBox widget.  Their function is to provide 
+ *a way to cycle through the possible time steps using larger intervals than the up/down
+ *buttons of the TimeSpinBox.  For example, say the Spinbox currently shows a timestep of 
+ *"1 sec".  Increasing the timestep with the spinbox up-button will change it to
+ *"2 sec", while using the "+" button of this widget will change it to "1 min".
+ *
+ *The idea is that these "outer" buttons always change to the next even unit of time.
+ *
+ *@note this widget is not to be used on its own; it is combined with the TimeSpinBox 
+ *widget to form the TimeStepBox composite widget. 
+ *@short provides a second set of up/down buttons for TimeStepBox.
+ *@author Jason Harris
+ *@version 1.0
+ */
 
 class QPushButton;
 


More information about the Kstars-devel mailing list