From 9097993973437ecc582578657257bc117d0ff703 Mon Sep 17 00:00:00 2001 From: Vesa Date: Fri, 17 Jan 2014 13:16:54 +0200 Subject: [PATCH] Trackoperations widgets, stylesheet changes, fix of the bug where palette goes all white if stylesheet has no palette --- data/themes/default/style.css | 108 +++++++++++++++--------------- data/themes/default/trackop.png | Bin 0 -> 746 bytes data/themes/default/trackop_c.png | Bin 0 -> 787 bytes data/themes/default/trackop_h.png | Bin 0 -> 746 bytes src/gui/LmmsStyle.cpp | 29 ++++---- 5 files changed, 71 insertions(+), 66 deletions(-) create mode 100644 data/themes/default/trackop.png create mode 100644 data/themes/default/trackop_c.png create mode 100644 data/themes/default/trackop_h.png diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 8a811f09f..19b5ca898 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -91,11 +91,10 @@ trackOperationsWidget > QPushButton { max-width: 26px; min-height: 26px; min-width: 26px; - background-color: #c9c9c9; - border-radius: 2px; - border: 1px solid rgba(0,0,0,64); + background: none; + border:none; } - +/* trackOperationsWidget > QPushButton:hover { background: qlineargradient(spread:reflect, x1:0.5, y1:0.5, x2:0.5, y2:0, stop:0 rgba(224, 224, 224, 255), stop:1 rgba(201, 201, 201, 255)); border: 1px solid rgba(0,0,0,255); @@ -113,23 +112,27 @@ trackOperationsWidget > QPushButton:flat { border-radius: 2px; border: none; } - -trackOperationsWidget#automationDisabled > QPushButton::menu-indicator { - image: url(resources:track_op_menu_disabled.png); -} - -trackOperationsWidget#automationEnabled > QPushButton::menu-indicator { - image: url(resources:track_op_menu.png); -} +*/ trackOperationsWidget > QPushButton::menu-indicator { - subcontrol-origin: padding; - subcontrol-position: center; + image: url(resources:trackop.png); + subcontrol-origin: padding; + subcontrol-position: center; + position: relative; + top: 2px; } -trackOperationsWidget > QPushButton::menu-indicator:pressed { - position: relative; - top: 1px; +trackOperationsWidget > QPushButton::menu-indicator:hover { + image: url(resources:trackop_h.png); +} + + +trackOperationsWidget > QPushButton::menu-indicator:pressed, +trackOperationsWidget > QPushButton::menu-indicator:checked + { + image: url(resources:trackop_c.png); + position: relative; + top: 3px; } trackWidget { @@ -150,81 +153,78 @@ QToolBar { } QToolButton, toolButton { - padding: 2px 1px 1px 2px; + padding: 1px 1px 1px 1px; border-radius: 2px; - border: 1px solid rgba(0,0,0,64); - background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:0.5 #c0c0c0, stop:1 #747474 ); + border: 1px solid rgba(0,0,0,32); + background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:1 #969696 ); font-size:10px; color: black; } QToolButton:hover, toolButton:hover { - background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.5 #c9c9c9, stop:1 #747474 ); - border: 1px solid rgba(0,0,0,255); + background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.5 #c9c9c9, stop:1 #969696 ); + border: 1px solid rgba(0,0,0,128); color: white; } QToolButton:pressed, ToolButton:pressed { - background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:0.5 #c0c0c0, stop:1 #747474 ); - padding: 3px 1px 0px 2px; - border: 1px solid rgba(0,0,0,255); + background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #969696, stop:0.5 #c9c9c9, stop:1 #969696 ); + padding: 2px 1px 0px 1px; + border: 1px solid rgba(0,0,0,128); color: white; } QToolButton:checked, ToolButton:checked { background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.8 #c9c9c9, stop:1 #c0c0c0 ); border-radius: 3px; - padding: 3px 1px 0px 2px; + padding: 2px 1px 0px 1px; border: 1px solid rgba(0,0,0,255); color: black; } trackLabelButton { - background-color: #5b6571; - color: #c9c9c9; - font-size: 10px; - font-weight: normal; - border-radius: 1px; - border: 1px solid rgba(0,0,0,64); + background-color: #5b6571; + color: #c9c9c9; + font-size: 10px; + font-weight: normal; + border-radius: 1px; + border: none; + padding: 2px 1px; } trackLabelButton:hover { - background-color: #7b838d; - color: white; - border: 1px solid black; + background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d ); + color: white; + border: 1px solid rgba(0,0,0,64); + padding: 1px 0px; } trackLabelButton:pressed { - background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 ); + background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); color: white; - border: 1px solid black; + border: 1px solid rgba(0,0,0,64); + padding: 2px 0px 0px; font-weight: bold; } trackLabelButton:checked { - background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 ); - color: #c9c9c9; - border: 1px solid rgba(0,0,0,64); + background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); + color: white; + border: 1px solid rgba(0,0,0,128); + padding: 2px 0px 0px; font-weight: bold; } trackLabelButton:checked:hover { - background-color: #7b838d; - color: white; - border: 1px solid black; - font-weight: bold; + background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d ); } trackLabelButton:checked:pressed { - background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.5 #5b6571, stop:1 #6b7581 ); - color: white; - border: 1px solid black; - font-weight: bold; + background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); } - SideBar { background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop: 0 #98a2a7, stop: 1.0 #5b646f); } @@ -311,11 +311,11 @@ sf2InstrumentView knob { } opl2instrumentView knob { - color: rgb(128,128,128); - qproperty-outerColor: rgb(255,255,255); - qproperty-innerRadius: 2; - qproperty-outerRadius: 9; - qproperty-lineWidth: 2; + color: rgb(128,128,128); + qproperty-outerColor: rgb(255,255,255); + qproperty-innerRadius: 2; + qproperty-outerRadius: 9; + qproperty-lineWidth: 2; } /* palette information - each colour definition must be on a single line, and the line must begin with "palette:", with no leading whitespace diff --git a/data/themes/default/trackop.png b/data/themes/default/trackop.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb8036e2ba698f510e4463cf7470842eb2c4ce3 GIT binary patch literal 746 zcmV_a#qb$TltnHm+>25&Q=dI}5c+71`7_ z7D*x42p0Z<6d{GxcEYYo>?BA?m*77LY$I9x0zsP%^Co$3?%86KU{?3Qg&8h0+;h)4 zAc@y?adD9zpX>E{t6s0S-s_Fa!z)}~UKVC%W_pcAV+8;biNx~U+}tt%G#ZVSR4UbL zHk*alZ-nIJ(rh*}@p$|ez=MdiMPz%_Is>p4i^Vb`vY5-|9;QCHzP>J~Y9|cCr$i!g z1K=|N!88cq&RVbZ0}oixcFfLW6FBtHU3;vGa$WB@#?>Vk+2qA1D= zNwiw673bWQh%As4094gJfR_=)dC&7wA|lQ?I_K`4a~t`5zUu+N`ucj;TH7|ph%pAn zn0^ohJDZ!E*{!XuthIKh-|zR0F$jV{j4|zeKHmiZIXyjX0a#YmPb9~x{3;fU+1KNr zoSgJL&-*f>q9h+l{)`)AAR-_MReg^-0Ki%c5gG4d;)98d$H&LtRrM=Lh{$h}JEcx5)n~VI_K_1 zWaHrApesj5M`_>pd#XAM;9gb#E2DGHkbEY&Kyu*w{$Cjn4-X4r7sK@dC!LGW0s)rw&lZbVTu7!HTIDPI4^b9Z-l64_Fz)GC+DlQ{41 c@4t!jA2M#lGb+*=0000007*qoM6N<$f~9;!{r~^~ literal 0 HcmV?d00001 diff --git a/data/themes/default/trackop_c.png b/data/themes/default/trackop_c.png new file mode 100644 index 0000000000000000000000000000000000000000..fbd6343ddfe8d665072824ec928705cbb8c6b9b0 GIT binary patch literal 787 zcmV+u1MK{XP)^g#L z?nzF)#8?tL7s@(21z@)TvPLZc2oS)x29s_rVm@V@?YQY(7?vx1oH9-dBpX1TA#{-;{guIX=j08+3`qe%Dgz3CvdXm081V%nRvk$yN;wEZ8=(}JB(Txwkl!}} z0FwK0YXqWg1a>Latj_%PMbq_c{kBgn+$b0^EfApMVuf;!BA+*eaRg970i0?TFZeG4 zTY@J72w+_dkWkjicy#*eQ!39Agb*t*=zh27&M*KR{&G1-$Rp2~Mx`Q#J{!;8&DUf+ zG}+%Ci@s54hODYaBEaerNp3SzU1Cf}s?NZ3ouBp&O~}5a$G{kI(h!Jr$2VAW?6sy_(b;!;@Tf RPj&zR002ovPDHLkV1n$USQ-ET literal 0 HcmV?d00001 diff --git a/data/themes/default/trackop_h.png b/data/themes/default/trackop_h.png new file mode 100644 index 0000000000000000000000000000000000000000..df1ad5642bb93fc343b8d98509188c85e66dd8fa GIT binary patch literal 746 zcmVqF^f`v5K9ALI^B8B>Un&L}L-nz0vpPY+(|NI52RBxp%lTzcV0-_kMnU zp6;J(wOXZCt5y23@B8VG_YK~e@B5`hBGK@De+~fR@%U^!9-jq(APDASu~;Jrg3|jp zLUIr^o6QN&^O^vz0aT4K%K#uEyCSjxV8R%aNu^TPLj_u`R!LP)QmNG4b>6j#z79t$niA zmUFpWHkZp~opa^q=jSJDExO&VIOnSQe7+6FH_1 z81n-F!Z1{lH>&zK=A1*HgsOhlIsm{q2a&hAhG96+!2sj&@$qkxKS@GF+NxS!TwL4( zfTN?M63Jhl=Y3OEL{ao-X=!O?fbrnqV2styleSheet().split( '\n' ).filter( QRegExp( "^palette:*" ) ); foreach( QString s, paletteData ) { - if (s.contains("background")) { pal.setColor( QPalette::Background, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("windowtext")) { pal.setColor( QPalette::WindowText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("base")) { pal.setColor( QPalette::Base, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("buttontext")) { pal.setColor( QPalette::ButtonText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("brighttext")) { pal.setColor( QPalette::BrightText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("text")) { pal.setColor( QPalette::Text, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("button")) { pal.setColor( QPalette::Button, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("shadow")) { pal.setColor( QPalette::Shadow, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("highlightedtext")) { pal.setColor( QPalette::HighlightedText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } - else if (s.contains("highlight")) { pal.setColor( QPalette::Highlight, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }; + if (s.contains(":background")) { pal.setColor( QPalette::Background, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":windowtext")) { pal.setColor( QPalette::WindowText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":base")) { pal.setColor( QPalette::Base, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":buttontext")) { pal.setColor( QPalette::ButtonText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":brighttext")) { pal.setColor( QPalette::BrightText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":text")) { pal.setColor( QPalette::Text, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":button")) { pal.setColor( QPalette::Button, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":shadow")) { pal.setColor( QPalette::Shadow, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":highlightedtext")) { pal.setColor( QPalette::HighlightedText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); } + else if (s.contains(":highlight")) { pal.setColor( QPalette::Highlight, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }; } return( pal );