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

Jérôme Sonrier jsid at emor3j.fr.eu.org
Tue Jan 13 22:26:08 CET 2009


SVN commit 910640 by jsonrier:

Add zooming buttons in Solar System tool

BUG: 100873
CCMAIL: kstars-devel at kde.org



 M  +12 -0     planetviewer.cpp  
 M  +2 -0      planetviewer.h  
 M  +57 -21    planetviewer.ui  


--- trunk/KDE/kdeedu/kstars/kstars/tools/planetviewer.cpp #910639:910640
@@ -66,6 +66,8 @@
     pw->TimeStep->tsbox()->setValue( 1 ); //start with 1-day timestep
 
     pw->RunButton->setIcon( KIcon("arrow-right") );
+    pw->ZoomInButton->setIcon( KIcon("zoom-in") );
+    pw->ZoomOutButton->setIcon( KIcon("zoom-out") );
     pw->DateBox->setDate( ((KStars*)parent)->data()->lt().date() );
 
     resize( 500, 500 );
@@ -108,6 +110,8 @@
     connect( &tmr, SIGNAL( timeout() ), SLOT( tick() ) );
     connect( pw->TimeStep, SIGNAL( scaleChanged(float) ), SLOT( setTimeScale(float) ) );
     connect( pw->RunButton, SIGNAL( clicked() ), SLOT( slotRunClock() ) );
+    connect( pw->ZoomInButton, SIGNAL( clicked() ), SLOT( slotMapZoomIn() ) );
+    connect( pw->ZoomOutButton, SIGNAL( clicked() ), SLOT( slotMapZoomOut() ) );
     connect( pw->DateBox, SIGNAL( valueChanged( const QDate & ) ), SLOT( slotChangeDate( const QDate & ) ) );
     connect( pw->TodayButton, SIGNAL( clicked() ), SLOT( slotToday() ) );
     connect( this, SIGNAL( closeClicked() ), SLOT( slotCloseWindow() ) );
@@ -260,4 +264,12 @@
     }
 }
 
+void PlanetViewer::slotMapZoomIn() {
+    pw->map->slotZoomIn();
+}
+
+void PlanetViewer::slotMapZoomOut() {
+    pw->map->slotZoomOut();
+}
+
 #include "planetviewer.moc"
--- trunk/KDE/kdeedu/kstars/kstars/tools/planetviewer.h #910639:910640
@@ -70,6 +70,8 @@
     void slotRunClock();
     void slotToday();
     void slotCloseWindow();
+    void slotMapZoomIn();
+    void slotMapZoomOut();
 
 private:
     void updatePlanets();
--- trunk/KDE/kdeedu/kstars/kstars/tools/planetviewer.ui #910639:910640
@@ -13,18 +13,9 @@
    <property name="spacing" >
     <number>6</number>
    </property>
-   <property name="leftMargin" >
+   <property name="margin" >
     <number>9</number>
    </property>
-   <property name="topMargin" >
-    <number>9</number>
-   </property>
-   <property name="rightMargin" >
-    <number>9</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>9</number>
-   </property>
    <item>
     <widget class="PVPlotWidget" name="map" >
      <property name="sizePolicy" >
@@ -46,18 +37,9 @@
      <property name="spacing" >
       <number>6</number>
      </property>
-     <property name="leftMargin" >
+     <property name="margin" >
       <number>0</number>
      </property>
-     <property name="topMargin" >
-      <number>0</number>
-     </property>
-     <property name="rightMargin" >
-      <number>0</number>
-     </property>
-     <property name="bottomMargin" >
-      <number>0</number>
-     </property>
      <item>
       <widget class="KPushButton" name="RunButton" >
        <property name="sizePolicy" >
@@ -88,7 +70,7 @@
        <property name="sizeType" >
         <enum>QSizePolicy::Expanding</enum>
        </property>
-       <property name="sizeHint" >
+       <property name="sizeHint" stdset="0" >
         <size>
          <width>140</width>
          <height>34</height>
@@ -106,6 +88,60 @@
        </property>
       </widget>
      </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeType" >
+        <enum>QSizePolicy::Expanding</enum>
+       </property>
+       <property name="sizeHint" stdset="0" >
+        <size>
+         <width>140</width>
+         <height>34</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="KPushButton" name="ZoomInButton" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="maximumSize" >
+        <size>
+         <width>34</width>
+         <height>34</height>
+        </size>
+       </property>
+       <property name="text" >
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="KPushButton" name="ZoomOutButton" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="maximumSize" >
+        <size>
+         <width>34</width>
+         <height>34</height>
+        </size>
+       </property>
+       <property name="text" >
+        <string/>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
   </layout>


More information about the Kstars-devel mailing list