Revert "add orBottomToTop, orRightToLeft, orLeftToRight(orHorizontal), orTopToBottom...
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 19 Jan 2009 12:40:51 +0000 (13:40 +0100)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 19 Jan 2009 12:40:51 +0000 (13:40 +0100)
This reverts commit 2e02d72e10207215592e4aeda8b1c5cf18f7115a.

lib/gui/eslider.cpp
lib/gui/eslider.h
skin.py

index 00aaeb74057d6a26d9a825e60b3b6f6bb4511314..dd2aac9e73c329b9f3eb64ad73ae30c84263719b 100644 (file)
@@ -1,8 +1,7 @@
 #include <lib/gui/eslider.h>
 
 eSlider::eSlider(eWidget *parent)
-       :eWidget(parent), m_have_border_color(false), m_start(0)
-       ,m_orientation(orHorizontal), m_direction(dirNormal), m_border_width(0)
+       :eWidget(parent), m_have_border_color(false), m_start(0), m_orientation(orHorizontal), m_border_width(0)
 {
 }
 
@@ -71,16 +70,8 @@ int eSlider::event(int event, void *data, void *data2)
 
                if (m_min < m_max)
                {
-                       if (m_direction == dirSwapped)
-                       {
-                               start_pix = pixsize * (m_start + (m_max - m_min) - m_value) / (m_max - m_min);
-                               num_pix = pixsize * (m_start + (m_max - m_min)) / (m_max - m_min);
-                       }
-                       else // dirNormal
-                       {
-                               num_pix = pixsize * (m_value - m_start) / (m_max - m_min);
-                               start_pix = pixsize * m_start / (m_max - m_min);
-                       }
+                       num_pix = pixsize * (m_value - m_start) / (m_max - m_min);
+                       start_pix = pixsize * m_start / (m_max - m_min);
                }
                
                if  (start_pix < 0)
@@ -128,12 +119,6 @@ void eSlider::setOrientation(int orientation)
        event(evtChangedSlider);
 }
 
-void eSlider::setDirection(int direction)
-{
-       m_direction = direction;
-       event(evtChangedSlider);
-}
-
 void eSlider::setRange(int min, int max)
 {
        m_min = min;
index 47941eda696809aa7c8fd26385728f050b62d37a..c544072650a1ad2b1ce3ccb300536133a193f120 100644 (file)
@@ -11,11 +11,9 @@ public:
        void setStartEnd(int start, int end);
        void setRange(int min, int max);
        enum { orHorizontal, orVertical };
-       enum { dirNormal, dirSwapped };
        void setOrientation(int orientation);
        void setBorderWidth(int pixel);
        void setBorderColor(const gRGB &color);
-       void setDirection(int direction);
        void setPixmap(gPixmap *pixmap);
        void setPixmap(ePtr<gPixmap> &pixmap);
 protected:
@@ -26,7 +24,7 @@ private:
                evtChangedSlider = evtUserWidget
        };
        bool m_have_border_color;
-       int m_min, m_max, m_value, m_start, m_orientation, m_direction, m_border_width;
+       int m_min, m_max, m_value, m_start, m_orientation, m_border_width;
        ePtr<gPixmap> m_pixmap;
        
        gRegion m_currently_filled;
diff --git a/skin.py b/skin.py
index 0c5f336836c886866c4b7c46539c9d25dd13d4cd..97954715c4d94f6a1f765cfb4ec708f8aa88f8d0 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -144,23 +144,13 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1)
                                  "blend": 2,
                                }[value])
                elif attrib == "orientation": # used by eSlider
-                       if value in ("orHorizontal", "orLeftToRight"):
-                               orientation = guiObject.orHorizontal
-                               direction = guiObject.dirNormal
-                       elif value in ("orVertical", "orTopToBottom"):
-                               orientation = guiObject.orVertical
-                               direction = guiObject.dirNormal
-                       elif value == "orRightToLeft":
-                               orientation = guiObject.orHorizontal
-                               direction = guiObject.dirSwapped
-                       elif value == "orBottomToTop":
-                               orientation = guiObject.orVertical
-                               direction = guiObject.dirSwapped
-                       else:
-                               print "orientation must be one of: orTopToBottom,orBottomToTop,orLeftToRight,orRightToLeft"
-                               return
-                       guiObject.setOrientation(orientation)
-                       guiObject.setDirection(direction)
+                       try:
+                               guiObject.setOrientation(
+                                       { "orVertical": guiObject.orVertical,
+                                               "orHorizontal": guiObject.orHorizontal
+                                       }[value])
+                       except KeyError:
+                               print "oprientation must be either orVertical or orHorizontal!"
                elif attrib == "valign":
                        try:
                                guiObject.setVAlign(