Fix package name errors in theme
This commit is contained in:
parent
fdea479ee7
commit
7510047ef3
|
@ -1,7 +1,7 @@
|
||||||
package theme
|
package theme
|
||||||
|
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
|
||||||
import "git.tebibyte.media/tomo/tomo/data"
|
import "git.tebibyte.media/tomo/tomo/data"
|
||||||
|
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
|
|
||||||
// IconSize represents the size of an icon.
|
// IconSize represents the size of an icon.
|
||||||
type IconSize int; const (
|
type IconSize int; const (
|
||||||
|
@ -18,7 +18,7 @@ type Icon int; const (
|
||||||
IconFile Icon = iota
|
IconFile Icon = iota
|
||||||
IconDirectory
|
IconDirectory
|
||||||
IconDirectoryFull
|
IconDirectoryFull
|
||||||
|
|
||||||
// places
|
// places
|
||||||
IconDownloads
|
IconDownloads
|
||||||
IconPhotos
|
IconPhotos
|
||||||
|
@ -33,7 +33,7 @@ type Icon int; const (
|
||||||
Icon3DObjects
|
Icon3DObjects
|
||||||
IconHistory
|
IconHistory
|
||||||
IconPreferences
|
IconPreferences
|
||||||
|
|
||||||
// storage
|
// storage
|
||||||
IconStorage // generic
|
IconStorage // generic
|
||||||
IconMagneticTape
|
IconMagneticTape
|
||||||
|
@ -46,7 +46,7 @@ type Icon int; const (
|
||||||
IconRAMDisk
|
IconRAMDisk
|
||||||
IconCD
|
IconCD
|
||||||
IconDVD
|
IconDVD
|
||||||
|
|
||||||
// network
|
// network
|
||||||
IconNetwork // generic
|
IconNetwork // generic
|
||||||
IconLocalNetwork
|
IconLocalNetwork
|
||||||
|
@ -56,7 +56,7 @@ type Icon int; const (
|
||||||
IconCell
|
IconCell
|
||||||
IconBluetooth
|
IconBluetooth
|
||||||
IconRadio
|
IconRadio
|
||||||
|
|
||||||
// devices
|
// devices
|
||||||
IconDevice // generic
|
IconDevice // generic
|
||||||
IconRouter
|
IconRouter
|
||||||
|
@ -67,7 +67,7 @@ type Icon int; const (
|
||||||
IconPhone
|
IconPhone
|
||||||
IconWatch
|
IconWatch
|
||||||
IconCamera
|
IconCamera
|
||||||
|
|
||||||
// peripherals
|
// peripherals
|
||||||
IconPeripheral // generic
|
IconPeripheral // generic
|
||||||
IconKeyboard
|
IconKeyboard
|
||||||
|
@ -79,7 +79,7 @@ type Icon int; const (
|
||||||
IconPenTablet
|
IconPenTablet
|
||||||
IconTrackpad
|
IconTrackpad
|
||||||
IconController
|
IconController
|
||||||
|
|
||||||
// i/o
|
// i/o
|
||||||
IconPort // generic
|
IconPort // generic
|
||||||
IconEthernetPort
|
IconEthernetPort
|
||||||
|
@ -93,9 +93,9 @@ type Icon int; const (
|
||||||
IconHDMIPort
|
IconHDMIPort
|
||||||
IconDisplayPort
|
IconDisplayPort
|
||||||
IconInfrared
|
IconInfrared
|
||||||
|
|
||||||
// --- Actions --- //
|
// --- Actions --- //
|
||||||
|
|
||||||
// files
|
// files
|
||||||
IconOpen
|
IconOpen
|
||||||
IconOpenIn
|
IconOpenIn
|
||||||
|
@ -109,7 +109,7 @@ type Icon int; const (
|
||||||
IconGetInformation
|
IconGetInformation
|
||||||
IconChangePermissions
|
IconChangePermissions
|
||||||
IconRevert
|
IconRevert
|
||||||
|
|
||||||
// list management
|
// list management
|
||||||
IconAdd
|
IconAdd
|
||||||
IconRemove
|
IconRemove
|
||||||
|
@ -117,7 +117,7 @@ type Icon int; const (
|
||||||
IconRemoveBookmark
|
IconRemoveBookmark
|
||||||
IconAddFavorite
|
IconAddFavorite
|
||||||
IconRemoveFavorite
|
IconRemoveFavorite
|
||||||
|
|
||||||
// media
|
// media
|
||||||
IconPlay
|
IconPlay
|
||||||
IconPause
|
IconPause
|
||||||
|
@ -130,7 +130,7 @@ type Icon int; const (
|
||||||
IconVolumeUp
|
IconVolumeUp
|
||||||
IconVolumeDown
|
IconVolumeDown
|
||||||
IconMute
|
IconMute
|
||||||
|
|
||||||
// editing
|
// editing
|
||||||
IconUndo
|
IconUndo
|
||||||
IconRedo
|
IconRedo
|
||||||
|
@ -143,8 +143,8 @@ type Icon int; const (
|
||||||
IconSelectNone
|
IconSelectNone
|
||||||
IconIncrement
|
IconIncrement
|
||||||
IconDecrement
|
IconDecrement
|
||||||
|
|
||||||
// window management
|
// window management
|
||||||
IconClose
|
IconClose
|
||||||
IconQuit
|
IconQuit
|
||||||
IconIconify
|
IconIconify
|
||||||
|
@ -167,7 +167,7 @@ type Icon int; const (
|
||||||
IconMove
|
IconMove
|
||||||
IconResize
|
IconResize
|
||||||
IconGoTo
|
IconGoTo
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
IconTransform
|
IconTransform
|
||||||
IconTranslate
|
IconTranslate
|
||||||
|
@ -188,9 +188,9 @@ type Icon int; const (
|
||||||
IconEraser
|
IconEraser
|
||||||
IconText
|
IconText
|
||||||
IconEyedropper
|
IconEyedropper
|
||||||
|
|
||||||
// --- Status --- //
|
// --- Status --- //
|
||||||
|
|
||||||
// dialogs
|
// dialogs
|
||||||
IconInformation
|
IconInformation
|
||||||
IconQuestion
|
IconQuestion
|
||||||
|
@ -198,7 +198,7 @@ type Icon int; const (
|
||||||
IconError
|
IconError
|
||||||
IconCancel
|
IconCancel
|
||||||
IconOkay
|
IconOkay
|
||||||
|
|
||||||
// network
|
// network
|
||||||
IconCellSignal0
|
IconCellSignal0
|
||||||
IconCellSignal1
|
IconCellSignal1
|
||||||
|
@ -208,7 +208,7 @@ type Icon int; const (
|
||||||
IconWirelessSignal1
|
IconWirelessSignal1
|
||||||
IconWirelessSignal2
|
IconWirelessSignal2
|
||||||
IconWirelessSignal3
|
IconWirelessSignal3
|
||||||
|
|
||||||
// power
|
// power
|
||||||
IconBattery0
|
IconBattery0
|
||||||
IconBattery1
|
IconBattery1
|
||||||
|
@ -218,7 +218,7 @@ type Icon int; const (
|
||||||
IconBrightness1
|
IconBrightness1
|
||||||
IconBrightness2
|
IconBrightness2
|
||||||
IconBrightness3
|
IconBrightness3
|
||||||
|
|
||||||
// media
|
// media
|
||||||
IconVolume0
|
IconVolume0
|
||||||
IconVolume1
|
IconVolume1
|
||||||
|
@ -227,13 +227,13 @@ type Icon int; const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Texture returns a texture of the corresponding icon ID.
|
// Texture returns a texture of the corresponding icon ID.
|
||||||
func (id Icon) Texture (size IconSize) tomo.Texture {
|
func (id Icon) Texture (size IconSize) canvas.Texture {
|
||||||
if current == nil { return nil }
|
if current == nil { return nil }
|
||||||
return current.Icon(id, size)
|
return current.Icon(id, size)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MimeIcon returns an icon corresponding to a MIME type.
|
// MimeIcon returns an icon corresponding to a MIME type.
|
||||||
func MimeIcon (mime data.Mime, size IconSize) tomo.Texture {
|
func MimeIcon (mime data.Mime, size IconSize) canvas.Texture {
|
||||||
if current == nil { return nil }
|
if current == nil { return nil }
|
||||||
return current.MimeIcon(mime, size)
|
return current.MimeIcon(mime, size)
|
||||||
}
|
}
|
||||||
|
@ -244,14 +244,14 @@ type ApplicationIcon struct {
|
||||||
// correspond to the file name (without the path or extension) of the
|
// correspond to the file name (without the path or extension) of the
|
||||||
// icon on the system. This field is optional.
|
// icon on the system. This field is optional.
|
||||||
Name string
|
Name string
|
||||||
|
|
||||||
// Role describes what the application does. If a specific icon file
|
// Role describes what the application does. If a specific icon file
|
||||||
// cannot be found, a generic one is picked using this field.
|
// cannot be found, a generic one is picked using this field.
|
||||||
Role ApplicationRole
|
Role ApplicationRole
|
||||||
}
|
}
|
||||||
|
|
||||||
// Texture returns a texture of the corresponding icon ID.
|
// Texture returns a texture of the corresponding icon ID.
|
||||||
func (icon ApplicationIcon) Texture (size IconSize) tomo.Texture {
|
func (icon ApplicationIcon) Texture (size IconSize) canvas.Texture {
|
||||||
if current == nil { return nil }
|
if current == nil { return nil }
|
||||||
return current.ApplicationIcon(icon, size)
|
return current.ApplicationIcon(icon, size)
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ type ApplicationRole int; const (
|
||||||
RoleProcessManager
|
RoleProcessManager
|
||||||
RoleSystemInformation
|
RoleSystemInformation
|
||||||
RoleManual
|
RoleManual
|
||||||
|
|
||||||
RoleCamera
|
RoleCamera
|
||||||
RoleImageViewer
|
RoleImageViewer
|
||||||
RoleMediaPlayer
|
RoleMediaPlayer
|
||||||
|
|
|
@ -3,13 +3,14 @@ package theme
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
import "git.tebibyte.media/tomo/tomo"
|
||||||
import "git.tebibyte.media/tomo/tomo/data"
|
import "git.tebibyte.media/tomo/tomo/data"
|
||||||
import "git.tebibyte.media/tomo/tomo/event"
|
import "git.tebibyte.media/tomo/tomo/event"
|
||||||
|
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
|
|
||||||
// Role describes the role of an object.
|
// Role describes the role of an object.
|
||||||
type Role struct {
|
type Role struct {
|
||||||
// Package is an optional namespace field. If specified, it should be
|
// Package is an optional namespace field. If specified, it should be
|
||||||
// the package name or module name the object is from.
|
// the package name or module name the object is from.
|
||||||
Package string
|
Package string
|
||||||
|
|
||||||
// Object specifies what type of object it is. For example:
|
// Object specifies what type of object it is. For example:
|
||||||
// - TextInput
|
// - TextInput
|
||||||
// - Table
|
// - Table
|
||||||
|
@ -17,7 +18,7 @@ type Role struct {
|
||||||
// - Dial
|
// - Dial
|
||||||
// This should correspond directly to the type name of the object.
|
// This should correspond directly to the type name of the object.
|
||||||
Object string
|
Object string
|
||||||
|
|
||||||
// Variant is an optional field to be used when an object has one or
|
// 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"
|
// more soft variants under one type. For example, an object "Slider"
|
||||||
// may have variations "horizontal" and "vertical".
|
// may have variations "horizontal" and "vertical".
|
||||||
|
@ -27,7 +28,7 @@ type Role struct {
|
||||||
// R is shorthand for creating a Role structure.
|
// R is shorthand for creating a Role structure.
|
||||||
func R (pack, object, variant string) Role {
|
func R (pack, object, variant string) Role {
|
||||||
return Role { Package: pack, Object: object, Variant: variant }
|
return Role { Package: pack, Object: object, Variant: variant }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Color represents a color ID.
|
// Color represents a color ID.
|
||||||
type Color int; const (
|
type Color int; const (
|
||||||
|
@ -50,24 +51,24 @@ type Theme interface {
|
||||||
// role. This may register event listeners with the given object;
|
// role. This may register event listeners with the given object;
|
||||||
// closing the returned cookie will remove them.
|
// closing the returned cookie will remove them.
|
||||||
Apply (tomo.Object, Role) event.Cookie
|
Apply (tomo.Object, Role) event.Cookie
|
||||||
|
|
||||||
// RGBA returns the RGBA values of the corresponding color ID.
|
// RGBA returns the RGBA values of the corresponding color ID.
|
||||||
RGBA (Color) (r, g, b, a uint32)
|
RGBA (Color) (r, g, b, a uint32)
|
||||||
|
|
||||||
// Icon returns a texture of the corresponding icon ID. This texture
|
// Icon returns a texture of the corresponding icon ID. This texture
|
||||||
// should be protected, unless a new copy of it is returned with each
|
// should be protected, unless a new copy of it is returned with each
|
||||||
// subsequent call.
|
// subsequent call.
|
||||||
Icon (Icon, IconSize) tomo.Texture
|
Icon (Icon, IconSize) canvas.Texture
|
||||||
|
|
||||||
// MimeIcon returns an icon corresponding to a MIME type. This texture
|
// MimeIcon returns an icon corresponding to a MIME type. This texture
|
||||||
// should be protected, unless a new copy of it is returned with each
|
// should be protected, unless a new copy of it is returned with each
|
||||||
// subsequent call.
|
// subsequent call.
|
||||||
MimeIcon (data.Mime, IconSize) tomo.Texture
|
MimeIcon (data.Mime, IconSize) canvas.Texture
|
||||||
|
|
||||||
// ApplicationIcon returns an icon corresponding to an application. This
|
// ApplicationIcon returns an icon corresponding to an application. This
|
||||||
// texture should be protected, unless a new copy of it is returned with
|
// texture should be protected, unless a new copy of it is returned with
|
||||||
// each subsequent call.
|
// each subsequent call.
|
||||||
ApplicationIcon (ApplicationIcon, IconSize) tomo.Texture
|
ApplicationIcon (ApplicationIcon, IconSize) canvas.Texture
|
||||||
}
|
}
|
||||||
|
|
||||||
var current Theme
|
var current Theme
|
||||||
|
|
Loading…
Reference in New Issue