don't display track when no foreground is set in position gauge
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 20 Jul 2006 14:48:33 +0000 (14:48 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 20 Jul 2006 14:48:33 +0000 (14:48 +0000)
data/skin.xml
lib/gui/epositiongauge.cpp
lib/gui/epositiongauge.h

index af37dbdf3472ddefb0399801b2c1766a9e3d5f28..6f727af585fbe9a860c7c9974cadb6970b124aa4 100644 (file)
                        <widget source="CurrentService" render="Label" position="475,60" size="75,20" halign="left" backgroundColor="dark" font="Regular;18">
                                <convert type="ServicePosition">Remaining</convert>
                        </widget>
-                       <widget source="CurrentService" render="PositionGauge" position="247,60" size="225,20" zPosition="2" pointer="position_pointer.png:3,5" >
+                       <widget source="CurrentService" render="PositionGauge" position="247,60" size="225,20" zPosition="2" pointer="position_pointer.png:3,5" foregroundColor="#225b7395">
                                <convert type="ServicePosition">Gauge</convert>
                        </widget>
                </screen>
index 012fd87b235bd5d74b5c673b45ba26966a769a25..712bf4a64c7b40ab10acd8850f37e6b6c2e4f05c 100644 (file)
@@ -8,6 +8,7 @@ ePositionGauge::ePositionGauge(eWidget *parent)
        m_point_widget->setAlphatest(1);
        m_position = 0;
        m_length = 0;
+       m_have_foreground_color = 0;
 }
 
 ePositionGauge::~ePositionGauge()
@@ -117,18 +118,26 @@ int ePositionGauge::event(int event, void *data, void *data2)
                                }
                        }
                        
-                       painter.setForegroundColor(gRGB(0x225b7395));
-                       int xi = scale(in), xo = scale(out);
-                       painter.fill(eRect(xi, 10, xo-xi, s.height()-14));
+                       if (m_have_foreground_color)
+                       {
+                               painter.setForegroundColor(gRGB(m_foreground_color));
+                               int xi = scale(in), xo = scale(out);
+                               painter.fill(eRect(xi, 10, xo-xi, s.height()-14));
+                       }
+                       
                        in = m_length;
                        
                        if (i == m_cue_entries.end())
                                break;
                }
 //             painter.setForegroundColor(gRGB(0x00000000));
-               painter.setForegroundColor(gRGB(0x225b7395));
-               painter.fill(eRect(s.width() - 2, 2, s.width() - 1, s.height() - 4));
-               painter.fill(eRect(0, 2, 2, s.height() - 4));
+
+               if (m_have_foreground_color)
+               {
+                       painter.setForegroundColor(gRGB(0x225b7395));
+                       painter.fill(eRect(s.width() - 2, 2, s.width() - 1, s.height() - 4));
+                       painter.fill(eRect(0, 2, 2, s.height() - 4));
+               }
                
 #if 0
 // border
@@ -166,3 +175,13 @@ int ePositionGauge::scale(const pts_t &val)
 
        return width * val / m_length;
 }
+
+void ePositionGauge::setForegroundColor(const gRGB &col)
+{
+       if ((!m_have_foreground_color) || !(m_foreground_color == col))
+       {
+               m_foreground_color = col;
+               m_have_foreground_color = 1;
+               invalidate();
+       }
+}
index 49ea3b3caa68684d7b4930212f7068b63689b19e..74e972c37e04ce52177416342b75ed7a415f74b6 100644 (file)
@@ -20,6 +20,7 @@ public:
        void setPointer(gPixmap *pixmap, const ePoint &center);
        
        void setInOutList(PyObject *list);
+       void setForegroundColor(const gRGB &col);
 #ifndef SWIG
 protected:
        int event(int event, void *data=0, void *data2=0);
@@ -53,6 +54,9 @@ private:
        
        std::multiset<cueEntry> m_cue_entries;
        int scale(const pts_t &val);
+       
+       int m_have_foreground_color;
+       gRGB m_foreground_color;
 #endif
 };