3

Please take a look at this picture:enter image description here

I know how to change the text color:

  NSPathComponentCell *cell = [_pathControl pathComponentCells].firstObject;
  cell setTextColor:[NSColor redColor];

But i'd also like to change the color of the arrows, anyone know how to implement this?

jimwan
  • 1,086
  • 2
  • 24
  • 39

2 Answers2

0

Not supported out of the box - you need to roll your own.

Or have a look at the various 3rd party implementations out there like ITPathbar: https://www.cocoacontrols.com/controls/itpathbar

ATV
  • 4,116
  • 3
  • 23
  • 42
  • 2
    i have already reviewed the ITPathbar, but could you tell me what should i do in order to change the color of the arrow? – jimwan Nov 21 '15 at 11:56
0

Have you tried to modify NSPathControlItem/attributedTitle:

(Limitation: macOS 10.10+)

    for pathControlItem in pathControl.pathItems {
        let range =  NSMakeRange(0, pathControlItem.attributedTitle.length)
        let attributedTitle = NSMutableAttributedString(attributedString: pathControlItem.attributedTitle)
        attributedTitle.addAttribute(.foregroundColor, value: yourColor, range: range)
        pathControlItem.attributedTitle = attributedTitle
    }

Or try to create subclass.(I didn't test it)

Nuzhdin Vladimir
  • 1,714
  • 18
  • 36