Small toolbar icons?

I am in the process of revamping my apps to conform to the new macOS style. How do I make small toolbar buttons, as in the Xojo IDE ?

I looked at previous threads, but besides a declare I could not use, there are no effective solutions.

I have the MBS plugins, but the examples are so cryptic, I don’t see how to do it.

Any help will be deeply appreciated.

1 Like

This keeps cropping up.
After you succeed (assuming you succeed), what does any Windows version look like?
Do you use a completely different look, a different window class, or make the Windows people suffer some simulation of the tiny monochrome Mac offerings?

What Xojo did was download the Sketch template and create the 27 different sizes in SVG format and then put them into an asset catalog for loading at runtime.

It’s a real pain in the ■■■■ to accomplish.

1 Like

I have completely different sources for Mac and Windows.

Since the most recent versions of Windows do not support true transparency, I stayed with 2016R3.

I see. I shall explore other ways, then.

Thank you Greg.

To be clear, the only icon that required that work are the ones that are not already an SFSymbol

Great. But if I uses SFSymbol, how do I get them into the toolbar icon ?

Here’s an example project…

Download

2 Likes

Superb. Thank you Greg :slight_smile:

Keep in mind that if you make any changes to the toolbar in Xojo code, you may need to refresh the icons again because Xojo recreates the whole bar from scratch periodically.

Alright. Thank you.

Xojo also removes the icon if you change the enabled state of the toolbar button. feedback://showreport?report_id=34926

Personally, I’ve been using “pushbuttons” in the toolbar for a while now, this allows you to control the enabled state of the pushbutton and leave the toolbarbutton well alone.

Edit: You can also control the icon size by using the following declares (if you have the Ohanaware App Kit).

Screen Shot 2022-04-10 at 8.50.58 AM

NSToolbar_setSizeMode( NSWindow_toolbar( self.handle ) ) = NStoolbarSizeModeValue.small

I’m sure you can find the appropriate MBS if you use MBS.

@Greg_O : what are the 27 icons supposed to accomplish? The icons in Xojo are neither fish nor fowl because they should be buttons. The plus button is still so thin that I can’t see if it’s enabled or not.

@Michel_Bujardet : the example you want is “Toolbar buttons”. Yes, the example is bad. Each toolbar item is single button class.

I ripped most of the classes out yesterday to understand the example:

2 Likes

Nine weights of three sizes.

https://developer.apple.com/documentation/uikit/uiimage/creating_custom_symbol_images_for_your_app

The icons in Xojo are so simple that 27 variations are total overkill IMO. But what do I know?

Thank you Beatrix :slight_smile:

I will probably use that control.

If you want to use Apple’s system of scalable icons, you don’t have much choice. We tried making less and the icon was rejected by the system.

Using 3.0 format you can define only 3 icons

Version 3 was not yet available when Xojo did this work.

I know