From 5d54d517ab06b2285d19adabf81b18607f8bdcf7 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sat, 2 Oct 2010 12:09:06 +0000 Subject: [PATCH] Add a background to the sidebar --- 3rdparty/fancytabwidget/fancytabwidget.cpp | 23 ++++++++++++++------- 3rdparty/fancytabwidget/fancytabwidget.h | 3 ++- data/data.qrc | 1 + data/sidebar_background.png | Bin 0 -> 10514 bytes src/ui/mainwindow.cpp | 1 + 5 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 data/sidebar_background.png diff --git a/3rdparty/fancytabwidget/fancytabwidget.cpp b/3rdparty/fancytabwidget/fancytabwidget.cpp index 2c8fff5ff..7bc31c124 100644 --- a/3rdparty/fancytabwidget/fancytabwidget.cpp +++ b/3rdparty/fancytabwidget/fancytabwidget.cpp @@ -477,14 +477,10 @@ void FancyTabWidget::removeTab(int index) m_tabBar->removeTab(index); } -void FancyTabWidget::setBackgroundBrush(const QBrush &brush) +void FancyTabWidget::setBackgroundPixmap(const QPixmap& pixmap) { - QPalette pal = m_tabBar->palette(); - pal.setBrush(QPalette::Mid, brush); - m_tabBar->setPalette(pal); - pal = m_cornerWidgetContainer->palette(); - pal.setBrush(QPalette::Mid, brush); - m_cornerWidgetContainer->setPalette(pal); + m_backgroundPixmap = pixmap; + update(); } void FancyTabWidget::paintEvent(QPaintEvent *event) @@ -495,6 +491,19 @@ void FancyTabWidget::paintEvent(QPaintEvent *event) QRect rect = m_selectionWidget->rect().adjusted(0, 0, 1, 0); rect = style()->visualRect(layoutDirection(), geometry(), rect); Utils::StyleHelper::verticalGradient(&painter, rect, rect); + + if (!m_backgroundPixmap.isNull()) { + QRect pixmap_rect(m_backgroundPixmap.rect()); + pixmap_rect.moveTo(rect.topLeft()); + + while (pixmap_rect.top() < rect.bottom()) { + QRect source_rect(pixmap_rect.intersected(rect)); + source_rect.moveTo(0, 0); + painter.drawPixmap(pixmap_rect.topLeft(), m_backgroundPixmap, source_rect); + pixmap_rect.moveTop(pixmap_rect.bottom() - 10); + } + } + painter.setPen(Utils::StyleHelper::borderColor()); painter.drawLine(rect.topRight(), rect.bottomRight()); diff --git a/3rdparty/fancytabwidget/fancytabwidget.h b/3rdparty/fancytabwidget/fancytabwidget.h index da647fb4e..7db8a462b 100644 --- a/3rdparty/fancytabwidget/fancytabwidget.h +++ b/3rdparty/fancytabwidget/fancytabwidget.h @@ -140,7 +140,7 @@ public: void addTab(QWidget *tab, const QIcon &icon, const QString &label); void addSpacer(int size = 40); void removeTab(int index); - void setBackgroundBrush(const QBrush &brush); + void setBackgroundPixmap(const QPixmap& pixmap); void addCornerWidget(QWidget *widget); void insertCornerWidget(int pos, QWidget *widget); int cornerWidgetCount() const; @@ -171,6 +171,7 @@ private: QStackedLayout *m_modesStack; QWidget *m_selectionWidget; QStatusBar *m_statusBar; + QPixmap m_backgroundPixmap; }; } // namespace Internal diff --git a/data/data.qrc b/data/data.qrc index a5747d1b7..fbb5ec854 100644 --- a/data/data.qrc +++ b/data/data.qrc @@ -264,5 +264,6 @@ icons/32x32/wiimotedev.png schema-17.sql lyrics/ultimate_providers.xml + sidebar_background.png diff --git a/data/sidebar_background.png b/data/sidebar_background.png new file mode 100644 index 0000000000000000000000000000000000000000..9f34525ecd50a1b5b1ae35ce9ac823daf273c382 GIT binary patch literal 10514 zcmW-nby!qS7soFhQcJlsEZyCR#L`{TNQZ#5bV)5;ODriZs5D4PHwzL1B1ngXAPo|} z`+M&`bLYA9$2@1}&YW|;pL64NwN(i5sqp~-AXHO@>Z5vPRLjT3M%~v^e*2+1G#`Bx z1)z3{b|3YCZL6UI1^)f_d-tU(6E%Y8scPy207P1-R)Ds8RbY%7#PLd&Pt7PJ<=;7|}@Y)wp^mefEb+Bjjcky**R8iB?HI5{D3IL3N8dTme;K%RK zB_EoR({TTG_cS!Mm}?_ z3@84DO*4RntLxp(-}A{x3?0B1~WS$Ea%gvUgIBCUt4WB8UX zPRt;jr>0^;ii58cMU5L*8%&LHfVrY5^sd;pBqjQ+A53$2G~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HRUGXZk*_F$&&yR ztiJDzFn_Jk@+dLz@{G|d6Sw_D^mg01IKJ4dgmRbl8ZE5E$@QtB&vDbFYBg`c@2g0&gb7L;T0$yOtYLun6@( zme(|xkHw_JkZV-Q!P>XCpDD8@8V+)qJ0J LNgGtabs->statusBar()->hide(); + ui_->tabs->setBackgroundPixmap(QPixmap(":/sidebar_background.png")); StyleHelper::setBaseColor(palette().color(QPalette::Highlight).darker()); track_position_timer_->setInterval(1000);