From 7510047ef343e5e08208c408c96a759d36b8fcf7 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 24 Aug 2023 16:30:10 -0400 Subject: [PATCH] Fix package name errors in theme --- theme/icon.go | 50 +++++++++++++++++++++++++------------------------- theme/theme.go | 21 +++++++++++---------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/theme/icon.go b/theme/icon.go index f9bcf28..cfe479b 100644 --- a/theme/icon.go +++ b/theme/icon.go @@ -1,7 +1,7 @@ package theme -import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/tomo/data" +import "git.tebibyte.media/tomo/tomo/canvas" // IconSize represents the size of an icon. type IconSize int; const ( @@ -18,7 +18,7 @@ type Icon int; const ( IconFile Icon = iota IconDirectory IconDirectoryFull - + // places IconDownloads IconPhotos @@ -33,7 +33,7 @@ type Icon int; const ( Icon3DObjects IconHistory IconPreferences - + // storage IconStorage // generic IconMagneticTape @@ -46,7 +46,7 @@ type Icon int; const ( IconRAMDisk IconCD IconDVD - + // network IconNetwork // generic IconLocalNetwork @@ -56,7 +56,7 @@ type Icon int; const ( IconCell IconBluetooth IconRadio - + // devices IconDevice // generic IconRouter @@ -67,7 +67,7 @@ type Icon int; const ( IconPhone IconWatch IconCamera - + // peripherals IconPeripheral // generic IconKeyboard @@ -79,7 +79,7 @@ type Icon int; const ( IconPenTablet IconTrackpad IconController - + // i/o IconPort // generic IconEthernetPort @@ -93,9 +93,9 @@ type Icon int; const ( IconHDMIPort IconDisplayPort IconInfrared - + // --- Actions --- // - + // files IconOpen IconOpenIn @@ -109,7 +109,7 @@ type Icon int; const ( IconGetInformation IconChangePermissions IconRevert - + // list management IconAdd IconRemove @@ -117,7 +117,7 @@ type Icon int; const ( IconRemoveBookmark IconAddFavorite IconRemoveFavorite - + // media IconPlay IconPause @@ -130,7 +130,7 @@ type Icon int; const ( IconVolumeUp IconVolumeDown IconMute - + // editing IconUndo IconRedo @@ -143,8 +143,8 @@ type Icon int; const ( IconSelectNone IconIncrement IconDecrement - - // window management + + // window management IconClose IconQuit IconIconify @@ -167,7 +167,7 @@ type Icon int; const ( IconMove IconResize IconGoTo - + // tools IconTransform IconTranslate @@ -188,9 +188,9 @@ type Icon int; const ( IconEraser IconText IconEyedropper - + // --- Status --- // - + // dialogs IconInformation IconQuestion @@ -198,7 +198,7 @@ type Icon int; const ( IconError IconCancel IconOkay - + // network IconCellSignal0 IconCellSignal1 @@ -208,7 +208,7 @@ type Icon int; const ( IconWirelessSignal1 IconWirelessSignal2 IconWirelessSignal3 - + // power IconBattery0 IconBattery1 @@ -218,7 +218,7 @@ type Icon int; const ( IconBrightness1 IconBrightness2 IconBrightness3 - + // media IconVolume0 IconVolume1 @@ -227,13 +227,13 @@ type Icon int; const ( ) // 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 } return current.Icon(id, size) } // 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 } return current.MimeIcon(mime, size) } @@ -244,14 +244,14 @@ type ApplicationIcon struct { // correspond to the file name (without the path or extension) of the // icon on the system. This field is optional. Name string - + // Role describes what the application does. If a specific icon file // cannot be found, a generic one is picked using this field. Role ApplicationRole } // 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 } return current.ApplicationIcon(icon, size) } @@ -279,7 +279,7 @@ type ApplicationRole int; const ( RoleProcessManager RoleSystemInformation RoleManual - + RoleCamera RoleImageViewer RoleMediaPlayer diff --git a/theme/theme.go b/theme/theme.go index a441af3..769c8b7 100644 --- a/theme/theme.go +++ b/theme/theme.go @@ -3,13 +3,14 @@ package theme import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/tomo/data" import "git.tebibyte.media/tomo/tomo/event" +import "git.tebibyte.media/tomo/tomo/canvas" // Role describes the role of an object. 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 @@ -17,7 +18,7 @@ type Role struct { // - 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". @@ -27,7 +28,7 @@ type Role struct { // R is shorthand for creating a Role structure. func R (pack, object, variant string) Role { return Role { Package: pack, Object: object, Variant: variant } -} +} // Color represents a color ID. type Color int; const ( @@ -50,24 +51,24 @@ type Theme interface { // role. This may register event listeners with the given object; // closing the returned cookie will 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. This texture // should be protected, unless a new copy of it is returned with each // subsequent call. - Icon (Icon, IconSize) tomo.Texture - + Icon (Icon, IconSize) canvas.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 // subsequent call. - MimeIcon (data.Mime, IconSize) tomo.Texture - + MimeIcon (data.Mime, IconSize) canvas.Texture + // ApplicationIcon returns an icon corresponding to an application. This // texture should be protected, unless a new copy of it is returned with // each subsequent call. - ApplicationIcon (ApplicationIcon, IconSize) tomo.Texture + ApplicationIcon (ApplicationIcon, IconSize) canvas.Texture } var current Theme