Skip to content

UXIcon

UXIcon names icons in a way every platform understands. A toolbar item is given a name with UXToolbar.setItemIcon, and each backend shows the platform’s own picture for it:

BackendPicture
macOS, iOSthe SF Symbol
Androidthe system drawable
Windows, GTK, GEM, the webUXKit’s 16-pixel glyph

A name with no picture on a platform shows the item’s label alone. From 0.73.

#use <UXKit> // or #import "UXIcon.xc"
NameSF SymbolAndroid drawable
newdoc.badge.plusic_menu_add
openfolderic_menu_upload
savesquare.and.arrow.downic_menu_save
deletetrashic_menu_delete
cutscissorsnone
copydoc.on.docnone
pastedoc.on.clipboardnone
undoarrow.uturn.backwardic_menu_revert
redoarrow.uturn.forwardnone
addplusic_input_add
removeminusic_input_delete
playplay.fillic_media_play
pausepause.fillic_media_pause
stopstop.fillnone
backchevron.backwardic_media_previous
forwardchevron.forwardic_media_next
searchmagnifyingglassic_menu_search
settingsgearshapeic_menu_preferences
infoinfo.circleic_menu_info_details
sharesquare.and.arrow.upic_menu_share
printprinternone
refresharrow.clockwiseic_menu_rotate
editpencilic_menu_edit
closexmarkic_menu_close_clear_cancel
folderfolderic_menu_upload

UXKit draws a glyph for every name.

isKnown · indexOf · nameAt · sfSymbol · androidDrawable · win32Std · draw

static bool isKnown(u8* name)

Whether name is one of the names above.

static i32 indexOf(u8* name)

The name’s place in the table, or -1.

static u8* nameAt(i32 k)

The kth name, for k from 0 to 24.

static u8* sfSymbol(u8* name)

The SF Symbol for a name, or "".

static u8* androidDrawable(u8* name)

The field of android.R.drawable for a name, or "".

static i32 win32Std(u8* name)

The Windows common-control standard bitmap (STD_*) for a name, or -1.

static bool draw(UXGraphics* g, u8* name, i32 x, i32 y, i32 pen)

Draws UXKit’s 16-pixel glyph for a name at (x, y) in pen. false, and nothing drawn, for a name not in the table.