From d05d270f7f4a69eac3382f611be949c0cbd783e5 Mon Sep 17 00:00:00 2001 From: Orcan Ogetbil Date: Fri, 31 Dec 2010 19:08:41 +0000 Subject: shadow behind wallpaper titles --- muse2/ChangeLog | 1 + muse2/muse/appearance.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index c12fd56a..f764331e 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -2,6 +2,7 @@ - Possible fix for arranger focussing problems. (Tim) Added parent->setFocusProxy(canvas) just after canvas created. Also added to pianoroll. + - Added shadow behind the wallpaper titles for easier read. (Orcan) 30.12.2010: - Suggestion by OOM team: Add default velocity controllers to pianoroll and drum edit. (Tim) *Feature: Appearance part color names now can now be edited. (Tim) diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 997da343..7b0383b5 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -46,14 +46,21 @@ class BgPreviewWidget : public QWidget { int w = t_widget->width() - 65; p.drawTiledPixmap(1,1,w,BG_ITEM_HEIGHT-2, pixmap); + const QPalette& pal = palette(); + QColor dark = pal.dark().color(); // We can also draw a rectangle behind the text: - //const QPalette& pal = palette(); - //QColor dark = pal.dark().color(); //p.fillRect(QRect(w/2 - text_w/2,6,text_w + 20,text_h+4), dark); QFontMetrics fm = p.fontMetrics(); text_w = fm.width(imagefile); text_h = fm.height(); + + // Do the text shadow first + p.save(); + p.setPen(dark); + p.drawText(w/2 - text_w/2 + 1, 7, text_w + 20, text_h+4, Qt::AlignCenter, imagefile); + p.restore(); + p.drawText(w/2 - text_w/2,6, text_w + 20, text_h+4, Qt::AlignCenter, imagefile); QWidget::paintEvent(event); } -- cgit v1.2.3