Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply applies the current theme to the given object, according to the given role. This may register event listeners with the given object; closing the returned cookie will remove them.
Types ¶
type Color ¶ added in v0.21.0
type Color int
Color represents a color ID.
type Icon ¶ added in v0.24.0
type Icon int
Icon represents an icon ID.
const ( // files IconFile Icon = iota IconDirectory IconDirectoryFull // places IconDownloads IconPhotos IconBooks IconDocuments IconRepositories IconMusic IconArchives IconFonts IconBinaries IconVideos Icon3DObjects IconHistory IconPreferences // storage IconStorage // generic IconMagneticTape IconFloppyDisk IconHardDisk IconSolidStateDrive IconFlashDrive IconMemoryCard IconROMDisk IconRAMDisk IconCD IconDVD // network IconNetwork // generic IconLocalNetwork IconInternet IconEthernet IconWireless IconCell IconBluetooth IconRadio // devices IconDevice // generic IconRouter IconSwitch IconServer IconDesktop IconLaptop IconTablet IconPhone IconWatch IconCamera // peripherals IconPeripheral // generic IconKeyboard IconMouse IconMonitor IconWebcam IconMicrophone IconSpeaker IconPenTablet IconTrackpad IconController // i/o IconPort // generic IconEthernetPort IconUSBPort IconParallelPort IconSerialPort IconPS2Port IconDisplayConnector IconCGAPort IconVGAPort IconHDMIPort IconDisplayPort IconInfrared // files IconOpen IconOpenIn IconSave IconSaveAs IconPrint IconNew IconNewDirectory IconDelete IconRename IconGetInformation IconChangePermissions IconRevert // list management IconAdd IconRemove IconAddBookmark IconRemoveBookmark IconAddFavorite IconRemoveFavorite // media IconPlay IconPause IconStop IconFastForward IconRewind IconToBeginning IconToEnd IconRecord IconVolumeUp IconVolumeDown IconMute // editing IconUndo IconRedo IconCut IconCopy IconPaste IconFind IconReplace IconSelectAll IconSelectNone IconIncrement IconDecrement // window management IconClose IconQuit IconIconify IconShade IconMaximize IconFullScreen IconRestore // view controls IconExpand IconContract IconBack IconForward IconUp IconDown IconReload IconZoomIn IconZoomOut IconZoomReset IconMove IconResize IconGoTo // tools IconTransform IconTranslate IconRotate IconScale IconWarp IconCornerPin IconSelectRectangle IconSelectEllipse IconSelectLasso IconSelectGeometric IconSelectAuto IconCrop IconFill IconGradient IconPencil IconBrush IconEraser IconText IconEyedropper // dialogs IconInformation IconQuestion IconWarning IconError IconCancel IconOkay // network IconCellSignal0 IconCellSignal1 IconCellSignal2 IconCellSignal3 IconWirelessSignal0 IconWirelessSignal1 IconWirelessSignal2 IconWirelessSignal3 // power IconBattery0 IconBattery1 IconBattery2 IconBattery3 IconBrightness0 IconBrightness1 IconBrightness2 IconBrightness3 // media IconVolume0 IconVolume1 IconVolume2 IconVolume3 )
type Role ¶
type Role struct { // Package is an optional namespace field. If specified, it should be // the package name or module name the object is from. Package string // Object specifies what type of object it is. For example: // - TextInput // - Table // - Label // - Dial // This should correspond directly to the type name of the object. Object string // Variant is an optional field to be used when an object has one or // more soft variants under one type. For example, an object "Slider" // may have variations "horizontal" and "vertical". Variant string }
Role describes the role of an object.
type Theme ¶
type Theme interface { // Apply applies the theme to the given object, according to the given // role. This may register event listeners with the given object; // closing the returned cookie must remove them. Apply(tomo.Object, Role) event.Cookie // RGBA returns the RGBA values of the corresponding color ID. RGBA(Color) (r, g, b, a uint32) // Icon returns a texture of the corresponding icon ID. Icon(Icon, IconSize) canvas.Texture // MimeIcon returns an icon corresponding to a MIME type. MimeIcon(data.Mime, IconSize) canvas.Texture // ApplicationIcon returns an icon corresponding to an application's // name. This may return nil if there is no icon for that application. ApplicationIcon(string, IconSize) canvas.Texture }
Theme is an object that can apply a visual style to different objects.
Click to show internal directories.
Click to hide internal directories.