Questions tagged [nstoolbar]

NSToolbar and NSToolbarItem provide the mechanism for a titled window to display a toolbar just below its title bar.

207 questions
5
votes
2 answers

Use combined titlebar + toolbar while preserving title visibility

The System Preferences app feature a combined title bar and toolbar with vertically centered buttons and the title. I am trying to mimic this exactly in my app. I have been able to combine the title bar and toolbar using Interface Builder (on the…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
5
votes
3 answers

How can I get a two-row toolbar like in Mail.app and Xcode?

I'm trying to add a "second row" after my NSToolbar in my app, that remains part of the title bar. As an example, Mail has a thin gray divider line below the NSToolbar with some extras items below that. Very specifically, when the window is put into…
Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
4
votes
3 answers

How do you vertically centering an image on an NSButton

I'm build a Mac application in the style of the Lion Mail.app. As part of this I'm attempting to create a simular toolbar to the one in the Mail.app but I can't seem to get the image in my toolbar button centered vertically. Looking at the Mail.app…
Ayal
  • 440
  • 1
  • 5
  • 15
4
votes
0 answers

NSSegmentedControl as NSToolbarItems on Big Sur

When using NSSegmentedControl in toolbars (native NSToolbar) with templated NSImage instances the usability has significantly deteriorated on macOS Big Sur. The selected item has an extremely low contrast in the new style used by macOS 11: Before…
ATV
  • 4,116
  • 3
  • 23
  • 42
4
votes
1 answer

Why does NSToolbarItem get disabled automatically?

I have a bit of an issue with buttons in the toolbar of my slideshow application for Mac. I want those buttons to be disabled when there is no active slideshow and enabled when there is an active slideshow. In order to achieve this, I set the…
Jan Kaiser
  • 830
  • 1
  • 8
  • 22
4
votes
1 answer

Implementing NSSegmentedControl in NSToolbar to control NSTabViewController

In my macOS application, I'm trying to replicate the Photos.app implementation of NSSegmentedControl in NSToolbar to control an NSTabViewController. For reference, here's what that looks like: So, my approach was as follows: Hide the default…
Sam Fischer
  • 1,442
  • 19
  • 35
4
votes
1 answer

NSToolbar created programmatically starts empty and won't save

I'm currently trying to write a Mac application. In doing so, I'm having some peculiar problems when trying to setup an NSToolbar. Although I have setup all the components as per the API documentation, when the application loads, the toolbar always…
Ben Wainwright
  • 4,224
  • 1
  • 18
  • 36
4
votes
3 answers

Add NSTitlebarAccessoryViewController to the left of the titlebar/toolbar

I have implemented a unified titlebar/toolbar and now would like to add two buttons to the bar. They need to be located at the far left, just right of the stoplight buttons. I'm creating a toolbar that's very similar to System Preferences. I have…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
4
votes
0 answers

Xcode OS X use NSToolbar to change views (swift)

I have a storyboard with a window controller. That window controller has a NSToolbar with 2 NSToolbarItems, view1 and view2. This is the code for the WindowController: import Cocoa class MainWindow: NSWindowController { override func…
Carl
  • 43
  • 6
4
votes
2 answers

Automatic Styling/Tinting of NSToolbarItem

Is there a way to tell OS X to automatically style/tint a NSToolbarItem? I've added an "Image Toolbar Item" via IB/Xcode and set the icon to a black PDF as described in the documentation. However, my result does not resemble that of, for instance,…
Lasse
  • 1,414
  • 11
  • 19
4
votes
0 answers

How do I use an NSProgressIndicator as the view of an NSToolbarItem and have it show in the customisation sheet?

I have an NSToolbar set up in my app. It was created in IB. One of the toolbar items uses a spinner-style NSProgressIndicator as its view, the rest are images. When the toolbar's customization sheet is showing, the spinner does not show in the…
Fraser Speirs
  • 4,642
  • 3
  • 21
  • 15
4
votes
1 answer

Assigning key-equivalent to NSToolbarItem?

How can I set a key equivalent for a NSToolbarItem?
user151660
  • 103
  • 3
4
votes
1 answer

Cocoa: How to prevent NSSearchField in a toolbar to get first responder?

When having a NSSearchField in a toolbar, it automatically becomes first responder when pressing TAB key in the window. How can I prevent that? I.e. to get the search field to refuse first responder?
Pavel Lobodinský
  • 1,028
  • 1
  • 12
  • 25
3
votes
3 answers

How to change the color of a NSToolbarItem's label

I'd like to change the color of all of my NSToolbarItem's labels. I need to set it to white because it suits better to the background color of my NSWindow, but it defaults to black and I haven't found a way to change it neither in Interface Builder…
msoler
  • 2,930
  • 2
  • 18
  • 30
3
votes
1 answer

Sidebar tracking toolbar items in SwiftUI

Is there an official way to achieve an equivalent of an NSTrackingSeparatorToolbarItem consistently in SwiftUI yet? I'm making an app that has 2 possible toolbar states, both have a "toggle sidebar" button I'd like to be in the actual sidebar, kinda…
max
  • 366
  • 3
  • 9
1 2
3
13 14