skineable distances between item in servicelist, skineable margins for nonplayable...
authorims <ims21@users.sourceforge.net>
Fri, 6 Feb 2015 11:12:53 +0000 (12:12 +0100)
committerlittlesat <littlesat99@yahoo.com>
Fri, 6 Feb 2015 14:33:25 +0000 (15:33 +0100)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/python/Components/ServiceList.py
lib/service/listboxservice.cpp
lib/service/listboxservice.h

index 65c29ce..8639f2e 100644 (file)
@@ -118,6 +118,10 @@ class ServiceList(HTMLComponent, GUIComponent):
                        self.progressBarWidth = int(value)
                def fieldMargins(value):
                        self.fieldMargins = int(value)
+               def nonplayableMargins(value):
+                       self.l.setNonplayableMargins(int(value))
+               def itemsDistances(value):
+                       self.l.setItemsDistances(int(value))
                for (attrib, value) in list(self.skinAttributes):
                        try:
                                locals().get(attrib)(value)
index d82867f..c72fd1e 100644 (file)
@@ -281,7 +281,7 @@ void eListboxServiceContent::sort()
 DEFINE_REF(eListboxServiceContent);
 
 eListboxServiceContent::eListboxServiceContent()
-       :m_visual_mode(visModeSimple), m_size(0), m_current_marked(false), m_itemheight(25), m_hide_number_marker(false), m_servicetype_icon_mode(0), m_crypto_icon_mode(0), m_column_width(0), m_progressbar_height(6), m_progressbar_border_width(2), m_record_indicator_mode(0)
+       :m_visual_mode(visModeSimple), m_size(0), m_current_marked(false), m_itemheight(25), m_hide_number_marker(false), m_servicetype_icon_mode(0), m_crypto_icon_mode(0), m_column_width(0), m_progressbar_height(6), m_progressbar_border_width(2), m_record_indicator_mode(0), m_nonplayable_margins(10), m_items_distances(8)
 {
        memset(m_color_set, 0, sizeof(m_color_set));
        cursorHome();
@@ -725,11 +725,11 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                service_info->getName(*m_cursor, text);
                                        if (!isPlayable)
                                        {
-                                               area.setWidth(area.width() + m_element_position[celServiceEventProgressbar].width() + 10);
+                                               area.setWidth(area.width() + m_element_position[celServiceEventProgressbar].width() +  m_nonplayable_margins);
                                                if (m_element_position[celServiceEventProgressbar].left() == 0)
                                                        area.setLeft(0);
-                                               if (m_element_position[celServiceNumber].width() && m_element_position[celServiceEventProgressbar].left() == m_element_position[celServiceNumber].width() + 10)
-                                                       area.setLeft(m_element_position[celServiceNumber].width() + 10);
+                                               if (m_element_position[celServiceNumber].width() && m_element_position[celServiceEventProgressbar].left() == m_element_position[celServiceNumber].width() +  m_nonplayable_margins)
+                                                       area.setLeft(m_element_position[celServiceNumber].width() +  m_nonplayable_margins);
                                        }
                                        if (!(m_record_indicator_mode == 3 && isRecorded) && isPlayable && serviceFallback && selected && m_color_set[serviceSelectedFallback])
                                                painter.setForegroundColor(m_color[serviceSelectedFallback]);
@@ -813,9 +813,9 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                        eRect bbox = para->getBoundBox();
 
                                        int servicenameWidth = ((!isPlayable || m_column_width == -1 || (!piconPixmap && !m_column_width)) ? bbox.width() : m_column_width);
-                                       m_element_position[celServiceInfo].setLeft(area.left() + servicenameWidth + 8 + xoffs);
+                                       m_element_position[celServiceInfo].setLeft(area.left() + servicenameWidth + m_items_distances + xoffs);
                                        m_element_position[celServiceInfo].setTop(area.top());
-                                       m_element_position[celServiceInfo].setWidth(area.width() - (servicenameWidth + 8 + xoffs));
+                                       m_element_position[celServiceInfo].setWidth(area.width() - (servicenameWidth + m_items_distances + xoffs));
                                        m_element_position[celServiceInfo].setHeight(area.height());
 
                                        if (isPlayable)
@@ -859,17 +859,17 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                        {
                                                                eSize pixmap_size = pixmap->size();
                                                                eRect area = m_element_position[celServiceInfo];
-                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + m_items_distances);
+                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - m_items_distances);
                                                                int offs = 0;
                                                                if (m_servicetype_icon_mode == 1)
                                                                {
                                                                        area = m_element_position[celServiceName];
                                                                        offs = xoffs;
-                                                                       xoffs += pixmap_size.width() + 8;
+                                                                       xoffs += pixmap_size.width() + m_items_distances;
                                                                }
                                                                else if (m_crypto_icon_mode == 1 && m_pixmaps[picCrypto])
-                                                                       offs = offs + m_pixmaps[picCrypto]->size().width() + 8;
+                                                                       offs = offs + m_pixmaps[picCrypto]->size().width() + m_items_distances;
                                                                int correction = (area.height() - pixmap_size.height()) / 2;
                                                                area.moveBy(offset);
                                                                painter.clip(area);
@@ -886,11 +886,11 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                        int offs = 0;
                                                        if (m_crypto_icon_mode == 1)
                                                        {
-                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + m_items_distances);
+                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - m_items_distances);
                                                                area = m_element_position[celServiceName];
                                                                offs = xoffs;
-                                                               xoffs += pixmap_size.width() + 8;
+                                                               xoffs += pixmap_size.width() + m_items_distances;
                                                        }
                                                        int correction = (area.height() - pixmap_size.height()) / 2;
                                                        area.moveBy(offset);
@@ -898,8 +898,8 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                        {
                                                                if (m_crypto_icon_mode == 2)
                                                                {
-                                                                       m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                                                       m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                                                       m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + m_items_distances);
+                                                                       m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - m_items_distances);
                                                                }
                                                                painter.clip(area);
                                                                painter.blit(m_pixmaps[picCrypto], ePoint(area.left() + offs, offset.y() + correction), area, gPainter::BT_ALPHATEST);
@@ -915,18 +915,18 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                                        int offs = 0;
                                                        if (m_record_indicator_mode == 1)
                                                        {
-                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + m_items_distances);
+                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - m_items_distances);
                                                                area = m_element_position[celServiceName];
                                                                offs = xoffs;
-                                                               xoffs += pixmap_size.width() + 8;
+                                                               xoffs += pixmap_size.width() + m_items_distances;
                                                        }
                                                        int correction = (area.height() - pixmap_size.height()) / 2;
                                                        area.moveBy(offset);
                                                        if (m_record_indicator_mode == 2)
                                                        {
-                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + 8);
-                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - 8);
+                                                               m_element_position[celServiceInfo].setLeft(area.left() + pixmap_size.width() + m_items_distances);
+                                                               m_element_position[celServiceInfo].setWidth(area.width() - pixmap_size.width() - m_items_distances);
                                                        }
                                                        painter.clip(area);
                                                        painter.blit(m_pixmaps[picRecord], ePoint(area.left() + offs, offset.y() + correction), area, gPainter::BT_ALPHATEST);
@@ -964,7 +964,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                        if (e == celFolderPixmap)
                                                if (m_element_position[celServiceEventProgressbar].left() == 0)
                                                        area.setLeft(0);
-                                               xoffset = pixmap_size.width() + 8;
+                                               xoffset = pixmap_size.width() + m_items_distances;
                                        area.moveBy(offset);
                                        painter.clip(area);
                                        painter.blit(pixmap, ePoint(area.left(), offset.y() + correction), area, gPainter::BT_ALPHATEST);
index 2e6b831..5dba2df 100644 (file)
@@ -89,6 +89,8 @@ public:
        void setColumnWidth(int value) { m_column_width = value; }
        void setProgressbarHeight(int value) {  m_progressbar_height = value; }
        void setProgressbarBorderWidth(int value) { m_progressbar_border_width = value; }
+       void setNonplayableMargins(int value) { m_nonplayable_margins = value; }
+       void setItemsDistances(int value) { m_items_distances = value; }
 
        static void setGetPiconNameFunc(SWIG_PYOBJECT(ePyObject) func);
 
@@ -176,6 +178,8 @@ private:
        int m_column_width;
        int m_progressbar_height;
        int m_progressbar_border_width;
+       int m_nonplayable_margins;
+       int m_items_distances;
 };
 
 #endif