diff --git a/data/images/widget-border.png b/data/images/widget-border.png deleted file mode 100644 index 227e0f70a..000000000 Binary files a/data/images/widget-border.png and /dev/null differ diff --git a/src/libtomahawk/utils/TomahawkStyle.cpp b/src/libtomahawk/utils/TomahawkStyle.cpp index 0ac01b0a2..8c304a96e 100644 --- a/src/libtomahawk/utils/TomahawkStyle.cpp +++ b/src/libtomahawk/utils/TomahawkStyle.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include void @@ -157,3 +159,36 @@ TomahawkStyle::drawArrow( QStyle::PrimitiveElement element, QPainter* p, const Q int yOffset = r.y() + ( r.height() - size ) / 2; p->drawPixmap( xOffset, yOffset, pixmap ); } + + +void +TomahawkStyle::stylePageFrame( QFrame* frame ) +{ + frame->setStyleSheet( QString( "QFrame#%1 { background-color: %2; border: 1px solid white; border-radius: 3px; }" ) + .arg( frame->objectName() ) + .arg( TomahawkStyle::PAGE_ITEM_BACKGROUND.name() ) ); +} + + +void +TomahawkStyle::styleScrollBar( QScrollBar* scrollBar ) +{ + scrollBar->setStyleSheet( + "QScrollBar:horizontal { background-color: transparent; }" + "QScrollBar::handle:horizontal { border-height: 9px; margin-bottom: 6px;" + "border-image: url(" RESPATH "images/scrollbar-horizontal-handle.png) 3 3 3 3 stretch stretch;" + "border-top: 3px transparent; border-bottom: 3px transparent; border-right: 3px transparent; border-left: 3px transparent; }" + "QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { width: 0px; height: 0px; background: none; }" + "QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { width: 0px; height: 0px; background: none; }" + "QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {" + "border: 0px; width: 0px; height: 0px; background: none; background-color: transparent; }" + + "QScrollBar:vertical { background-color: transparent; }" + "QScrollBar::handle:vertical { border-width: 9px; margin-right: 6px;" + "border-image: url(" RESPATH "images/scrollbar-vertical-handle.png) 3 3 3 3 stretch stretch;" + "border-top: 3px transparent; border-bottom: 3px transparent; border-right: 3px transparent; border-left: 3px transparent; }" + "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { width: 0px; height: 0px; background: none; }" + "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { width: 0px; height: 0px; background: none; }" + "QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical {" + "border: 0px; width: 0px; height: 0px; background: none; background-color: transparent; }" ); +} diff --git a/src/libtomahawk/utils/TomahawkStyle.h b/src/libtomahawk/utils/TomahawkStyle.h index f159d5365..6016a6e97 100644 --- a/src/libtomahawk/utils/TomahawkStyle.h +++ b/src/libtomahawk/utils/TomahawkStyle.h @@ -26,6 +26,9 @@ #include #include +class QFrame; +class QScrollBar; + namespace TomahawkStyle { /** @@ -41,6 +44,9 @@ namespace TomahawkStyle */ DLLEXPORT void drawArrow( QStyle::PrimitiveElement, QPainter* painter, const QStyleOption* opt ); + DLLEXPORT void stylePageFrame( QFrame* frame ); + DLLEXPORT void styleScrollBar( QScrollBar* scrollBar ); + static const QColor BORDER_LINE = QColor( "#8c8c8c" ); static const QColor POPUP_BACKGROUND = QColor( "#ffffff" ); static const QColor POPUP_OSX_BACKGROUND = QColor( "#D6E3F1" ); @@ -58,6 +64,9 @@ namespace TomahawkStyle static const QColor HEADER_TEXT = QColor( "#eaeaea" ); static const QColor HEADER_HIGHLIGHT = QColor( "#333" ); + static const QColor PAGE_TEXT = Qt::gray; + static const QColor PAGE_ITEM_BACKGROUND = QColor( "#1e1e1e" ).lighter( 290 ); + static const QColor PAGE_FOREGROUND = QColor( "#ffffff" ); static const QColor PAGE_BACKGROUND = QColor( "#1e1e1e" ).lighter(); static const QColor FOOTNOTES_BACKGROUND = QColor( "#272b2e" ); static const QColor DASHBOARD_ROUNDFIGURE_BACKGROUND = QColor( "#454e59" ); diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.cpp b/src/libtomahawk/utils/TomahawkUtilsGui.cpp index f09970ad2..708479940 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.cpp +++ b/src/libtomahawk/utils/TomahawkUtilsGui.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -818,30 +817,6 @@ drawRoundedButton( QPainter* painter, const QRect& btnRect, const QColor& color, } -void -styleScrollBar( QScrollBar* scrollBar ) -{ - scrollBar->setStyleSheet( - "QScrollBar:horizontal { background-color: transparent; }" - "QScrollBar::handle:horizontal { border-height: 9px; margin-bottom: 6px;" - "border-image: url(" RESPATH "images/scrollbar-horizontal-handle.png) 3 3 3 3 stretch stretch;" - "border-top: 3px transparent; border-bottom: 3px transparent; border-right: 3px transparent; border-left: 3px transparent; }" - "QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { width: 0px; height: 0px; background: none; }" - "QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal { width: 0px; height: 0px; background: none; }" - "QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal {" - "border: 0px; width: 0px; height: 0px; background: none; background-color: transparent; }" - - "QScrollBar:vertical { background-color: transparent; }" - "QScrollBar::handle:vertical { border-width: 9px; margin-right: 6px;" - "border-image: url(" RESPATH "images/scrollbar-vertical-handle.png) 3 3 3 3 stretch stretch;" - "border-top: 3px transparent; border-bottom: 3px transparent; border-right: 3px transparent; border-left: 3px transparent; }" - "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { width: 0px; height: 0px; background: none; }" - "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { width: 0px; height: 0px; background: none; }" - "QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical {" - "border: 0px; width: 0px; height: 0px; background: none; background-color: transparent; }" ); -} - - QPixmap createTiledPixmap( int width, int height, const QImage& inputTile ) { diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.h b/src/libtomahawk/utils/TomahawkUtilsGui.h index 1c3d872da..109edc67d 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.h +++ b/src/libtomahawk/utils/TomahawkUtilsGui.h @@ -39,7 +39,6 @@ class QPixmap; class QLayout; class QPalette; class QRect; -class QScrollBar; namespace TomahawkUtils { @@ -68,7 +67,6 @@ namespace TomahawkUtils DLLEXPORT void prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, PlayableItem* item ); DLLEXPORT void drawRoundedButton( QPainter* painter, const QRect& btnRect, const QColor& color, const QColor &gradient1bottom = QColor(), const QColor& gradient2top = QColor(), const QColor& gradient2bottom = QColor() ); - DLLEXPORT void styleScrollBar( QScrollBar* scrollBar ); DLLEXPORT QPixmap defaultPixmap( ImageType type, ImageMode mode = TomahawkUtils::Original, const QSize& size = QSize( 0, 0 ) ); DLLEXPORT QPixmap createTiledPixmap( int width, int height, const QImage& src );