From e110febc8624694cb122631a469b59504cfa03c8 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 2 Jun 2010 19:19:30 +0000 Subject: [PATCH] Add a background to the pretty OSD --- data/data.qrc | 1 + data/osd_background.png | Bin 0 -> 8885 bytes src/widgets/osdpretty.cpp | 11 ++++++++++- src/widgets/osdpretty.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 data/osd_background.png diff --git a/data/data.qrc b/data/data.qrc index 688081952..678ca3f57 100644 --- a/data/data.qrc +++ b/data/data.qrc @@ -177,5 +177,6 @@ icons/48x48/document-new.png schema-10.sql schema-11.sql + osd_background.png diff --git a/data/osd_background.png b/data/osd_background.png new file mode 100644 index 0000000000000000000000000000000000000000..f11404b968cfa4a0901e58a9eed8f41039f74658 GIT binary patch literal 8885 zcmV;mB1+wfP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L03EXc03EXdt0YG$00007bV*G`2igV# z6A>c9;nyDk03ZNKL_t(|+UHn z6}|T`fN%5n2Jo8Xzq|2FAq1EiLI^_u-Y2O_I|k(QXL9Hvp`Fegg0_ z$(L*SOdE6{h7bVYd;vj05|U1b5a|D|YG9mq#!>G3qag$<`B~C;vKzp^0PI}`gz@Vn zfd6M^zX6yo@ppWQ6Rak z%x58q5W*12?*M#4QY6{x(Iq{R^gkre`~OAjf4*VQ{20I;rIN(4O0ps8pqbTRT&s2@ zIRoHU3rROFY5Q6T+ehbq5lH}ym8=<$0r)3?VUjBNdjV(wn2_|7Yr>EU)v|@SWAJ)` z(4ar^v05{>Nm!D%08HlvoomNW)@pY2$+;(qx%&#h)-udeNu!d!0dOd>O8B-C;xvG> zB!4xt>23h9NSm9PB%RHf&+!ffaH0ld8-#U0{z}sFgq75kw699q(Jg{`lCuSpeal7& zpZIx_An720GXOTZX~(yfA?77rB6$|TRFCq`3jojaLWCqpj@Mvp6ObflBwZ^C=m0no zLTFS)J4V4GX(sP019)d6w2%AV2H+b>$KBM-N3kWTLGrGo|24Bm-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ZFp0X}e3Vb07RRNZdRouf$Fk6M{Y zF13f9X0v6PQ|`;}0I~+%%AhQ91(u1Xx>g)>2YLa(k1P316${)z z(g7D(_g7(7jR2S^OM)k6+sDX)OEV-N^s@`$C2vCjwv)VHwc%xLX~v}L;TW>=qvvKe zKPW*PzyFYH#Yr=pUB!PJ2XL=UzY5tjx+b#F|BdAP{p>HEaV2qeQ21?GFuJ6F2f#LD zk;L;=c+qPNAdGsFf3-b{yUH3?90xH0_|)^C&!Q>a=R$Co7lL2x_YoQ$1EbsSaUkr2 zDi-Cg;v8^OeZ{GE{`W&=3JZ_i(x)q2sfaKC5y@Fej|MC@v1|Zm2wCTWk-R>DKzzgO zBv)(_Cb)gWrcLNL0`zRzFw-9dArBN*K@U$K(K z%s_G*N~(JCeC9#_(layout()); @@ -178,12 +179,20 @@ void OSDPretty::paintEvent(QPaintEvent *) { p.setOpacity(background_opacity_); p.drawRoundedRect(box, kBorderRadius, kBorderRadius); + // Background pattern + QPainterPath background_path; + background_path.addRoundedRect(box, kBorderRadius, kBorderRadius); + p.setClipPath(background_path); + p.setOpacity(1.0); + p.drawPixmap(box.right() - background_.width(), + box.bottom() - background_.height(), background_); + p.setClipping(false); + // Gradient overlay QLinearGradient gradient(0, 0, 0, height()); gradient.setColorAt(0, QColor(255, 255, 255, 130)); gradient.setColorAt(1, QColor(255, 255, 255, 50)); p.setBrush(gradient); - p.setOpacity(1.0); p.drawRoundedRect(box, kBorderRadius, kBorderRadius); // Box border diff --git a/src/widgets/osdpretty.h b/src/widgets/osdpretty.h index 23d508397..df37307d4 100644 --- a/src/widgets/osdpretty.h +++ b/src/widgets/osdpretty.h @@ -113,6 +113,7 @@ class OSDPretty : public QWidget { // Cached pixmaps QPixmap shadow_edge_[4]; QPixmap shadow_corner_[4]; + QPixmap background_; // For dragging the OSD QPoint original_window_pos_;