Hello community, here is the log from the commit of package libyui-qt for openSUSE:Factory checked in at 2014-04-05 14:42:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-qt (Old) and /work/SRC/openSUSE:Factory/.libyui-qt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt" Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-qt/libyui-qt.changes 2014-03-23 22:30:18.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libyui-qt.new/libyui-qt.changes 2014-04-05 14:42:57.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Mar 31 14:31:28 CEST 2014 - tgoettlic...@suse.de + +- Made BarGraph segment colors stylable (bnc#868268) +- 2.46.4 + +------------------------------------------------------------------- Old: ---- libyui-qt-2.46.3.tar.bz2 New: ---- libyui-qt-2.46.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-qt-doc.spec ++++++ --- /var/tmp/diff_new_pack.P3yxM1/_old 2014-04-05 14:42:58.000000000 +0200 +++ /var/tmp/diff_new_pack.P3yxM1/_new 2014-04-05 14:42:58.000000000 +0200 @@ -17,7 +17,7 @@ Name: libyui-qt-doc -Version: 2.46.3 +Version: 2.46.4 Release: 0 Source: libyui-qt-%{version}.tar.bz2 ++++++ libyui-qt.spec ++++++ --- /var/tmp/diff_new_pack.P3yxM1/_old 2014-04-05 14:42:58.000000000 +0200 +++ /var/tmp/diff_new_pack.P3yxM1/_new 2014-04-05 14:42:58.000000000 +0200 @@ -17,7 +17,7 @@ Name: libyui-qt -Version: 2.46.3 +Version: 2.46.4 Release: 0 Source: libyui-qt-%{version}.tar.bz2 ++++++ libyui-qt-2.46.3.tar.bz2 -> libyui-qt-2.46.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.3/ChangeLog new/libyui-qt-2.46.4/ChangeLog --- old/libyui-qt-2.46.3/ChangeLog 2014-03-21 17:30:02.000000000 +0100 +++ new/libyui-qt-2.46.4/ChangeLog 2014-03-31 14:39:50.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Mar 31 14:31:28 CEST 2014 - tgoettlic...@suse.de + +- Made BarGraph segment colors stylable (bnc#868268) +- 2.46.4 + +------------------------------------------------------------------- Fri Mar 21 11:41:10 UTC 2014 - mvid...@suse.com - Fixed "QObject::connect: signal not found in YQCheckBox", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.3/VERSION.cmake new/libyui-qt-2.46.4/VERSION.cmake --- old/libyui-qt-2.46.3/VERSION.cmake 2014-03-21 17:30:02.000000000 +0100 +++ new/libyui-qt-2.46.4/VERSION.cmake 2014-03-31 14:39:50.000000000 +0200 @@ -1,6 +1,6 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "46") -SET(VERSION_PATCH "3") +SET(VERSION_PATCH "4") SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) ##### This is need for the libyui core, ONLY. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.3/src/YQBarGraph.cc new/libyui-qt-2.46.4/src/YQBarGraph.cc --- old/libyui-qt-2.46.3/src/YQBarGraph.cc 2014-02-21 15:05:58.000000000 +0100 +++ new/libyui-qt-2.46.4/src/YQBarGraph.cc 2014-03-31 14:39:50.000000000 +0200 @@ -189,6 +189,18 @@ YColor YQBarGraph::defaultSegmentColor( unsigned index ) { + // use color from qproperty defined in qss + QColor color; + QStringList colors = _backgroundColors.split(","); + + if ( colors.size() > 0 ) + { + color = colors[index % colors.size()]; + if ( color.isValid() ) + return YColor( color.red(), color.green(), color.blue() ); + } + + // use default color if color is not defined in qss switch( index % 8 ) { case 0: return YColor( 0, 0, 128 ); // dark blue @@ -208,6 +220,19 @@ YColor YQBarGraph::defaultTextColor( unsigned index ) { + // use color from qproperty defined in qss + + QColor color; + QStringList colors = _foregroundColors.split(","); + + if ( colors.size() > 0 ) + { + color = colors[index % colors.size()]; + if (color.isValid() ) + return YColor( color.red(), color.green(), color.blue() ); + } + + // use default color if color is not defined in qss YColor black = YColor( 0, 0, 0 ); YColor white = YColor( 255, 255, 255 ); @@ -293,6 +318,26 @@ resize( newWidth, newHeight ); } +QString YQBarGraph::getBackgroundColors() +{ + return _backgroundColors; +} + +void YQBarGraph::setBackgroundColors( QString colors ) +{ + _backgroundColors = colors; +} + +QString YQBarGraph::getForegroundColors() +{ + return _foregroundColors; +} + +void YQBarGraph::setForegroundColors( QString colors ) +{ + _foregroundColors = colors; +} + #include "YQBarGraph.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.3/src/YQBarGraph.h new/libyui-qt-2.46.4/src/YQBarGraph.h --- old/libyui-qt-2.46.3/src/YQBarGraph.h 2014-02-21 15:05:58.000000000 +0100 +++ new/libyui-qt-2.46.4/src/YQBarGraph.h 2014-03-31 14:39:50.000000000 +0200 @@ -36,10 +36,11 @@ class QPainter; - class YQBarGraph : public QFrame, public YBarGraph { Q_OBJECT + Q_PROPERTY(QString BackgroundColors READ getBackgroundColors WRITE setBackgroundColors DESIGNABLE true) + Q_PROPERTY(QString ForegroundColors READ getForegroundColors WRITE setForegroundColors DESIGNABLE true) public: @@ -113,6 +114,21 @@ private: map <int, QString> toolTips ; + // QSS doesn't allow to store a list of QColors, that's the reason + // why we use QString and store the colors in following format: + // + // YQBarGraph + // { + // qproperty-BackgroundColors: "#aabbcc,#bbccdd,#eeff00""; + // qproperty-ForegroundColors: "black,yellow,white"; + // } + + QString _backgroundColors; + QString getBackgroundColors(); + void setBackgroundColors( QString colors ); + QString _foregroundColors; + QString getForegroundColors(); + void setForegroundColors( QString colors ); }; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org