theme

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package theme provides a macOS-inspired Fyne theme for the SBOM Utility GUI. It mirrors macOS Ventura/Sonoma light-mode aesthetics:

  • System background #F5F5F5 (window chrome grey)
  • Content background #FFFFFF (white panels)
  • Sidebar/header #EBEBEB (sidebar grey)
  • Accent blue #007AFF (macOS system blue)
  • Primary text #1D1D1F
  • Secondary text #6E6E73
  • Border/separator #D2D2D7
  • Input background #FFFFFF with a subtle border
  • Font sizes matching macOS HIG (body 13 pt, caption 11 pt, heading 17 pt)

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewerBG          = color.NRGBA{R: 0x1E, G: 0x1E, B: 0x1E, A: 0xFF} // #1E1E1E
	ViewerFG          = color.NRGBA{R: 0xCE, G: 0xCE, B: 0xCE, A: 0xFF} // #CECECE
	ViewerPlaceholder = color.NRGBA{R: 0x7A, G: 0x7A, B: 0x7A, A: 0xFF} // #7A7A7A
	ViewerDisabled    = color.NRGBA{R: 0x88, G: 0x88, B: 0x88, A: 0xFF} // slightly lighter placeholder
	ViewerSelection   = color.NRGBA{R: 0x26, G: 0x4F, B: 0x78, A: 0xFF} // muted blue selection
	ViewerCursor      = color.NRGBA{R: 0xCE, G: 0xCE, B: 0xCE, A: 0xFF} // cursor matches FG
	ViewerBorder      = color.NRGBA{R: 0x3C, G: 0x3C, B: 0x3C, A: 0xFF} // subtle border
)

Colour constants for the viewer.

Functions

This section is empty.

Types

type MacOSTheme

type MacOSTheme struct{}

MacOSTheme is a Fyne theme that approximates macOS Ventura/Sonoma light mode.

func (*MacOSTheme) Color

Color implements fyne.Theme.

func (*MacOSTheme) Font

func (m *MacOSTheme) Font(style fyne.TextStyle) fyne.Resource

Font implements fyne.Theme. We use Fyne's bundled fonts because shipping the full San Francisco font is not possible without a license. The bundled fonts are clean sans-serif faces that are visually close to SF Pro at the sizes we configure below.

func (*MacOSTheme) Icon

func (m *MacOSTheme) Icon(name fyne.ThemeIconName) fyne.Resource

Icon implements fyne.Theme. We keep Fyne's built-in icons.

func (*MacOSTheme) Size

func (m *MacOSTheme) Size(name fyne.ThemeSizeName) float32

Size implements fyne.Theme using macOS HIG-inspired metrics.

macOS HIG reference sizes (1 pt ≈ 1 dp on a non-Retina display):

Body text      13 pt
Caption        11 pt
Heading        17 pt
Sub-heading    15 pt
Control height ~22 pt  → padding 4 pt top/bottom
Input border    1 pt
Corner radius   5 pt   (text fields), 6 pt (controls)

type ViewerTheme

type ViewerTheme struct {
	// contains filtered or unexported fields
}

ViewerTheme is a local theme override for the BOM source-viewer entry widget. It provides a dark-editor look:

Background / input bg   #1E1E1E  (VS Code-style dark charcoal)
Foreground / text       #CECECE  (light grey)
Placeholder             #7A7A7A  (dimmer grey)

Font order preference: Consolas → Courier New → system monospace fallback. Fyne resolves monospace fonts from the OS; we keep the existing monospace resource (DefaultTextMonospaceFont) but set TextStyle.Monospace = true on the entry so the host system's preferred monospace font is selected. Consolas and Courier are listed in the FyneApp.toml font settings instead of here because Fyne's font-loading pipeline requires TTF resources, not font family names.

func NewViewerTheme

func NewViewerTheme(base fyne.Theme) *ViewerTheme

NewViewerTheme creates a ViewerTheme that delegates non-overridden values to the supplied base theme (typically the application's active theme).

func (*ViewerTheme) Color

func (v *ViewerTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color

Color implements fyne.Theme.

func (*ViewerTheme) Font

func (v *ViewerTheme) Font(style fyne.TextStyle) fyne.Resource

Font implements fyne.Theme — delegate to base; callers set TextStyle.Monospace = true.

func (*ViewerTheme) Icon

func (v *ViewerTheme) Icon(name fyne.ThemeIconName) fyne.Resource

Icon implements fyne.Theme — delegate to base.

func (*ViewerTheme) Size

func (v *ViewerTheme) Size(name fyne.ThemeSizeName) float32

Size implements fyne.Theme — delegate to base so font size stays consistent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL