IPB

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> NSScroller comme celui d' itunes [Résolu], subclass nscroller
Options
fcoull
posté 27 Feb 2011, 10:34
Message #1


Macbidouilleur de bronze !
**

Groupe : Membres
Messages : 289
Inscrit : 27 Oct 2010
Membre no 160 569



Bonjour,

Pour mes besoins, j'ai besoin de customizer le nscroller par défaut car je le trouve particulièrement moche et pas du tout adapté au reste de mon interface.

Idealement, je voudrais bien avoir celui d' Itunes, y'a t'il une piste à explorer ? Je pense qu'il faut toucher du coté de drawknob, mais l'image du knob doit être comment ? bref je patauge…

Merci


--------------------
Hackintosh i7-6850K OC 4.3ghz, 32go ram, gtx 1080 8go, Samsung SSD 850 EVO 1 To, Sierra 10.12.6
Go to the top of the page
 
+Quote Post
fcoull
posté 27 Feb 2011, 11:02
Message #2


Macbidouilleur de bronze !
**

Groupe : Membres
Messages : 289
Inscrit : 27 Oct 2010
Membre no 160 569



Bon, apres avoir cherché pendant 2h hier… ce matin, a la fraiche, j'ai trouvé rapidement:

Code
    NSRect knobRect = [self rectForPart:NSScrollerKnob];
    NSRect newRect = NSMakeRect(knobRect.origin.x+1, knobRect.origin.y, knobRect.size.width -2, knobRect.size.height);
    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:newRect xRadius:5 yRadius:5];
    NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations:[NSColor colorWithDeviceRed:(float)173/255 green:(float)185/255 blue:(float)203/255 alpha:1.0],0.0,  [NSColor colorWithDeviceRed:(float)117/255 green:(float)135/255 blue:(float)164/255 alpha:1.0], 1.0, nil];
    [gradient drawInBezierPath:path angle:0];


Si cela peut servir à qq'un…


--------------------
Hackintosh i7-6850K OC 4.3ghz, 32go ram, gtx 1080 8go, Samsung SSD 850 EVO 1 To, Sierra 10.12.6
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



Nous sommes le : 16th April 2024 - 14:35