From d791a189bc31df19025ccbbeff170dfa79f3a1b1 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Tue, 22 Dec 2009 14:51:53 -0600 Subject: [PATCH] added support for HUD scroll bars --- .../HUD/scroller-down-arrow-disabled.png | Bin 0 -> 524 bytes .../HUD/scroller-down-arrow-highlighted.png | Bin 0 -> 548 bytes .../Resources/HUD/scroller-down-arrow.png | Bin 0 -> 555 bytes .../HUD/scroller-horizontal-knob-center.png | Bin 0 -> 141 bytes .../HUD/scroller-horizontal-knob-left.png | Bin 0 -> 367 bytes .../HUD/scroller-horizontal-knob-right.png | Bin 0 -> 387 bytes .../scroller-horizontal-track-disabled.png | Bin 0 -> 155 bytes .../HUD/scroller-horizontal-track.png | Bin 0 -> 161 bytes .../HUD/scroller-left-arrow-disabled.png | Bin 0 -> 534 bytes .../HUD/scroller-left-arrow-highlighted.png | Bin 0 -> 549 bytes .../Resources/HUD/scroller-left-arrow.png | Bin 0 -> 556 bytes .../HUD/scroller-right-arrow-disabled.png | Bin 0 -> 546 bytes .../HUD/scroller-right-arrow-highlighted.png | Bin 0 -> 555 bytes .../Resources/HUD/scroller-right-arrow.png | Bin 0 -> 567 bytes .../HUD/scroller-up-arrow-disabled.png | Bin 0 -> 496 bytes .../HUD/scroller-up-arrow-highlighted.png | Bin 0 -> 498 bytes .../Resources/HUD/scroller-up-arrow.png | Bin 0 -> 516 bytes .../HUD/scroller-vertical-knob-bottom.png | Bin 0 -> 349 bytes .../HUD/scroller-vertical-knob-center.png | Bin 0 -> 136 bytes .../HUD/scroller-vertical-knob-top.png | Bin 0 -> 366 bytes .../HUD/scroller-vertical-track-disabled.png | Bin 0 -> 151 bytes .../Resources/HUD/scroller-vertical-track.png | Bin 0 -> 154 bytes AppKit/Themes/Aristo/ThemeDescriptors.j | 112 ++++++++++++++++++ 23 files changed, 112 insertions(+) create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-down-arrow-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-down-arrow-highlighted.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-down-arrow.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-knob-center.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-knob-left.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-knob-right.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow-highlighted.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-right-arrow-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-right-arrow-highlighted.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-right-arrow.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-up-arrow-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-up-arrow-highlighted.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-up-arrow.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-bottom.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-center.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-top.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track-disabled.png create mode 100644 AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track.png diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-down-arrow-disabled.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-down-arrow-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..b7edfb041d381634b1ab6d2cc0bc228f0f33880d GIT binary patch literal 524 z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&6R(!1~(lG?ospT|CcFOe=i6#Orlu|UFrF-EGz{t;0e5ejg(y*`42hJG&!@ zXrF##h9*dH9)=;WDT<Fedx{BlY2lhN~0}CO@wry74 zw(WV6B=^|<(l^mcDMdzbB|ucy^`T{1cfRkRg4ttk3pN^tfx50EDdn~6y2s!wzIerM zyQB{sIF56s-GyYQzk(0I{RFAaOUW)vfkz*izW)Q0e&BK&9DUzEn|#rkT>(Gpsm_be zsC{6XH)b$9VT_%ns;atZn&y>%Vhh#~JHBIzmqk%LV7rFKbsPMb8qA?=9LJ}!EN{_k hj_psVGd+I`FaRS()-a7ml#>7e002ovPDHLkV1lh*qY(fA literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track-disabled.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..d4d2e0fc1e505520a8502f6c8a8914c35108e9e2 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrK!3HE%<(K{hQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jiflby978H@*>vv|WKiHa+~a)fjv>eI_ih~i8U+g{b1^$C zpJ{r}x2r>)E%fWtKih<6e`j=a@tp83?(!?a1O~>9A~SbB71|3lh{4m<&t;ucLK6Tb C;4=gO literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-horizontal-track.png new file mode 100644 index 0000000000000000000000000000000000000000..eec906cccbadc0c460516b81b1ebfe723186b259 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrK!3HE%<(K{hQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jikv-N978H@iJU&jdq9E5Iq=8Rr%d;=o`?;4S#*NYao0F7htboFyt I=akR{0B#vH!2kdN literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow-disabled.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..3b5d68032074f286e28e77a37ec9003abb16a6b1 GIT binary patch literal 534 zcmV+x0_pvUP)6h*$KX)%ZeYeGn#C4dj9 zTCJ9)<$Ar&$wQFF0F$P~zY5@FEka)7 zK{MEQCWgofDxa(f%jJ^B<1x)u$f3|Q@`JT`sQ4ogbEDKb`aBJWV zXb6?h0F~_q8eV|cfak#02T%)QVPa>r*I3YO;<7~ce)k{T*tjQ>xSr(Cz+w32wzGnW zH2TLQhQnc21}Mw2!)~|R?DzXuMNvW_LYUDs~_HvqQ)b)g9N2^Xet0GSxNXn5` z5QZT&n@w6Q7Bm`-Xg;48`q{Sq2B62l9PGo!Xj1~Eg#q|(GMUhHI;CE(_nmFg@qPaT zzyR`*v7djA^B}2;-u?K~Y&IiJ)2P$wP@~bH!{IPK%p%|_PTm8c$at_!N zs&OEX`_EP6+bzo2WCe4&2!h}ek9L%O9iA;$5s7ZMo0arl`#`&{V4u+@8*tu@P_*0a ntjxD3vcH452mFQS@F~CmFwbEVI)Ky#00000NkvXXu0mjfn9lqr literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-left-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..4182c266accaece580c9f54b75119b26d9903fff GIT binary patch literal 556 zcmV+{0@MA8P)Jqgq!Ve>d!8GjWT>S61Q3{DVNKV&*w=ZQE}U1*67sXmqVZfp8W3t(Gm>? z1L^nsvREv_;UX|rBKXrBCWlSkSvisr4xzh=1Mi&iKU!fv9>vaD+?*9ByHOsCTZ&R5LBVi&*O1AHm5J`f&eGMQV< z;uT%KQGZrWUl0V!J~mk`7K=x^uAd@_6MPtFYlU+tl}aagAb$ZYpUr0LICUg>MhCmQ uPN`O_!9H(K$aLj6&d_z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WVb}*>WJLrh)(IUxbQv0A&EI zBP{6dLYh}dl;d-JFagWLS<|$0RQ-(VU$&Rz7~@NT0RTYfk!qoRIz<2g002ovPDHLk FV1h!i^qv3! literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-up-arrow-disabled.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-up-arrow-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..1eaeff830c1510e2e0a667a27c2b6da07db99aa8 GIT binary patch literal 496 zcmVUO)dTCKi4{RocZm==o#bvm7V6U(w_G#cgK^+&kh@6%u~pnAPdnx;{s(V*pWNv3HY z!RldPy&o( z`j2b1nx+hL`5-yulHBoHBCMu2P+!)n+B`nGWo>xFo m7?&#n%(xnO39lM{3NQdgwEVv7v*ptO0000oU=XZK~ zZZCp}j!e@$Ns@$CC8d1lt5WC(pFaqvX-Z)jeh)4b3N#oDvSDom^CT_HqJFbBQ()8tpb@?@2-WB7`U!`<~Yu^5W-g!Wsb1K zI>A;w_`ZKrEEe}r&r>H)K&)_T{YwjdOUWg*BJFE{f7(Xhw=&_LOAvu80;jA!MgzIu~=n@aU zleLX1b5>qGhI3-X0E?e{ktQS`5O|9A&zCU&Wn|CyRwxkXN?zxh@*ox5{eB6{JR#+~ ou((BzYPDKa zE|)ihbGaO~+ifb9O4RH1KE3-I?E5}-Ivpw$3X3MDX;QsjU;M6L!j(#es?{oGG8xh| zjk4J+b-P_E7K`h9`FGea!s=>52ytau)}?LRWB6M~%1)=#2DC5B^6rN)3ccZQcs3Xe zuHkDJg>!Z)t|QO$9!8_ljbRvjx~?B0zx4tGeC+r8rzjdLiedwtK_0*W3fT{+(I%70 zh2uE4`F#Euxg7;xCKTXc3}6Cys;cS~afZlpam|wmG!ih3fI;ryzJmn};~O}1SSWT- z>>!#ZS`5 z@M~o0*0s-&H^`E)(6M{**e-=k24Sc}24fRr%fyz|J7Iw+g*t+dJ4xSnci#bHEK1Y# zT-S9hrDXFwYnYs(otyu09EF2o%;&;!C|!S0^R2~L@y+-B)k38do2Kbqi>s>Ig<;rv zp0`#knx@&4SY=su5<+Z)AYlI$pss!2KX+ZnUGtdd`7ue7&nSu>kZ@-fLuAWm*|zOd zS(dMOy%;eu6z4og!Xb`hzy)qx*S!Y-5`7KB@KO}TBU=1GZi^7`Ybvrq1!;T15={e% v7!lVcO8CPTEO0F7sV(S9!S;0P`4M0MQ)8bBSsMkK00000NkvXXu0mjf2tbzy literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-center.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-center.png new file mode 100644 index 0000000000000000000000000000000000000000..3076a5c7f60a6e26dc3eec28e2bf1f685f054d49 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^{6Nge!3HAle6a#jk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xv^-rLLn>}1r6eRg;Nar=_3zzX>$dv;{| literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-top.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-knob-top.png new file mode 100644 index 0000000000000000000000000000000000000000..6d2e0f78a869be24c8248301de991980f5241614 GIT binary patch literal 366 zcmV-!0g?WRP)~F~8SjawCV7BPBqBT($b0C1UIQE^EddmnVS`$SSMSEcw-YTWe=6OCI$B}hi_trGc zYnEjXRaJeWt^zHsh>Iji&OOh&Z`<||0@LC&O$<#8*nbp7ahK=$3+lhP{U(v7>6Poc zj}UkJzBk2~Zdh6GNGUH-mz8Dtu4N~V<9*-vpX<7o!!Z0x|DnS`7+8yTH0^u$dAnF%3IjEo%Vi`gbR M07*qoM6N<$g5KGg=Kufz literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track-disabled.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..6c4aec1e9957ac78fab39aba5a6486fbb6dd503c GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^{6Nge!3HAle6a#jk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XEInNuLn?0RoZ8LHpuppNu;#W0&!K<2C$bm_9eugeK=@)$ xhoaKbRh*~q-d}g0m)-tV9@|MD=eJx23=5u%)Ls6QKM80EgQu&X%Q~loCIFiEGJgO7 literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track.png b/AppKit/Themes/Aristo/Resources/HUD/scroller-vertical-track.png new file mode 100644 index 0000000000000000000000000000000000000000..6c287198d6a8fc643a9cb7548dd465a4c7704ad3 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^{6Nge!3HAle6a#jk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XY&=~YLn?0ZoZ86CpuoWz$kG|c^Dyk4eRG$iP<>(LSy81~ zX=XESx~42%x{BRu&xeIa+-GX8aC2$?%Wc50N>pUU)c5^sfaWlGy85}Sb4q9e0HbR$ AHUIzs literal 0 HcmV?d00001 diff --git a/AppKit/Themes/Aristo/ThemeDescriptors.j b/AppKit/Themes/Aristo/ThemeDescriptors.j index dc75cf4a5..40cf7c279 100644 --- a/AppKit/Themes/Aristo/ThemeDescriptors.j +++ b/AppKit/Themes/Aristo/ThemeDescriptors.j @@ -787,6 +787,118 @@ return button; } ++ (CPScroller)themedVerticalScroller +{ + var scroller = [[CPScroller alloc] initWithFrame:CGRectMake(0.0, 0.0, 15.0, 170.0)], + trackColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-track.png" size:CGSizeMake(15.0, 1.0)]), + disabledTrackColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-track-disabled.png" size:CGSizeMake(15.0, 1.0)]); + + [scroller setValue:21.0 forThemeAttribute:@"minimum-knob-length" inState:CPThemeStateVertical]; + [scroller setValue:CGInsetMake(0.0, 0.0, 0.0, 0.0) forThemeAttribute:@"knob-inset" inState:CPThemeStateVertical]; + [scroller setValue:CGInsetMake(-9.0, 0.0, -9.0, 0.0) forThemeAttribute:@"track-inset" inState:CPThemeStateVertical]; + + [scroller setValue:trackColor forThemeAttribute:@"knob-slot-color" inState:CPThemeStateVertical]; + [scroller setValue:disabledTrackColor forThemeAttribute:@"knob-slot-color" inState:CPThemeStateVertical | CPThemeStateDisabled]; + + var arrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-up-arrow.png" size:CGSizeMake(15.0, 24.0)]), + highlightedArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-up-arrow-highlighted.png" size:CGSizeMake(15.0, 24.0)]), + disabledArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-up-arrow-disabled.png" size:CGSizeMake(15.0, 24.0)]); + + [scroller setValue:CGSizeMake(15.0, 24.0) forThemeAttribute:@"decrement-line-size" inState:CPThemeStateVertical]; + [scroller setValue:arrowColor forThemeAttribute:@"decrement-line-color" inState:CPThemeStateVertical]; + [scroller setValue:highlightedArrowColor forThemeAttribute:@"decrement-line-color" inState:CPThemeStateVertical | CPThemeStateHighlighted], + [scroller setValue:disabledArrowColor forThemeAttribute:@"decrement-line-color" inState:CPThemeStateVertical | CPThemeStateDisabled]; + + var arrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-down-arrow.png" size:CGSizeMake(15.0, 24.0)]), + highlightedArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-down-arrow-highlighted.png" size:CGSizeMake(15.0, 24.0)]), + disabledArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-down-arrow-disabled.png" size:CGSizeMake(15.0, 24.0)]); + + [scroller setValue:CGSizeMake(15.0, 24.0) forThemeAttribute:@"increment-line-size" inState:CPThemeStateVertical]; + [scroller setValue:arrowColor forThemeAttribute:@"increment-line-color" inState:CPThemeStateVertical]; + [scroller setValue:highlightedArrowColor forThemeAttribute:@"increment-line-color" inState:CPThemeStateVertical | CPThemeStateHighlighted]; + [scroller setValue:disabledArrowColor forThemeAttribute:@"increment-line-color" inState:CPThemeStateVertical | CPThemeStateDisabled]; + + var knobColor = PatternColor([[CPThreePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-top.png" size:CGSizeMake(15.0, 10.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-center.png" size:CGSizeMake(15.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-bottom.png" size:CGSizeMake(15.0, 10.0)] + ] + isVertical:YES]); + + var knobDisabledColor = PatternColor([[CPThreePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-disabled-top.png" size:CGSizeMake(15.0, 10.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-disabled-center.png" size:CGSizeMake(15.0, 1.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-vertical-knob-disabled-bottom.png" size:CGSizeMake(15.0, 10.0)] + ] + isVertical:YES]); + + [scroller setValue:knobColor forThemeAttribute:@"knob-color" inState:CPThemeStateVertical]; + [scroller setValue:knobDisabledColor forThemeAttribute:@"knob-color" inState:CPThemeStateVertical|CPThemeStateDisabled]; + + [scroller setFloatValue:0.1]; + [scroller setKnobProportion:0.5]; + + return scroller; +} + ++ (CPScroller)themedHorizontalScroller +{ + var scroller = [[CPScroller alloc] initWithFrame:CGRectMake(0.0, 0.0, 170.0, 15.0)], + trackColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-track.png" size:CGSizeMake(1.0, 15.0)]), + disabledTrackColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-track-disabled.png" size:CGSizeMake(1.0, 15.0)]); + + [scroller setValue:21.0 forThemeAttribute:@"minimum-knob-length"]; + [scroller setValue:CGInsetMake(0.0, 0.0, 0.0, 0.0) forThemeAttribute:@"knob-inset"]; + [scroller setValue:CGInsetMake(0.0, -7.0, 0.0, -9.0) forThemeAttribute:@"track-inset"]; + + [scroller setValue:trackColor forThemeAttribute:@"knob-slot-color"]; + [scroller setValue:disabledTrackColor forThemeAttribute:@"knob-slot-color" inState:CPThemeStateDisabled]; + + var arrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-left-arrow.png" size:CGSizeMake(24.0, 15.0)]), + highlightedArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-left-arrow-highlighted.png" size:CGSizeMake(24.0, 15.0)]), + disabledArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-left-arrow-disabled.png" size:CGSizeMake(24.0, 15.0)]); + + [scroller setValue:CGSizeMake(24.0, 15.0) forThemeAttribute:@"decrement-line-size"]; + [scroller setValue:arrowColor forThemeAttribute:@"decrement-line-color"]; + [scroller setValue:highlightedArrowColor forThemeAttribute:@"decrement-line-color" inState:CPThemeStateHighlighted], + [scroller setValue:disabledArrowColor forThemeAttribute:@"decrement-line-color" inState:CPThemeStateDisabled]; + + var arrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-right-arrow.png" size:CGSizeMake(24.0, 15.0)]), + highlightedArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-right-arrow-highlighted.png" size:CGSizeMake(24.0, 15.0)]), + disabledArrowColor = PatternColor([_CPCibCustomResource imageResourceWithName:"HUD/scroller-right-arrow-disabled.png" size:CGSizeMake(24.0, 15.0)]); + + [scroller setValue:CGSizeMake(24.0, 15.0) forThemeAttribute:@"increment-line-size"]; + [scroller setValue:arrowColor forThemeAttribute:@"increment-line-color"]; + [scroller setValue:highlightedArrowColor forThemeAttribute:@"increment-line-color" inState:CPThemeStateHighlighted]; + [scroller setValue:disabledArrowColor forThemeAttribute:@"increment-line-color" inState:CPThemeStateDisabled]; + + var knobColor = PatternColor([[CPThreePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-left.png" size:CGSizeMake(10.0, 15.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-center.png" size:CGSizeMake(1.0, 15.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-right.png" size:CGSizeMake(10.0, 15.0)] + ] + isVertical:NO]); + + var knobDisabledColor = PatternColor([[CPThreePartImage alloc] initWithImageSlices: + [ + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-disabled-left.png" size:CGSizeMake(10.0, 15.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-disabled-center.png" size:CGSizeMake(1.0, 15.0)], + [_CPCibCustomResource imageResourceWithName:"HUD/scroller-horizontal-knob-disabled-right.png" size:CGSizeMake(10.0, 15.0)] + ] + isVertical:NO]); + + [scroller setValue:knobColor forThemeAttribute:@"knob-color"]; + [scroller setValue:knobDisabledColor forThemeAttribute:@"knob-color" inState:CPThemeStateDisabled]; + + [scroller setFloatValue:0.1]; + [scroller setKnobProportion:0.5]; + + return scroller; +} + @end function PatternColor(anImage)