widgets

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: 13 Imported by: 0

Documentation

Overview

Package widgets contains reusable Fyne widget helpers shared by all screens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilePicker

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

FilePicker is a label + entry + browse-button row that lets the user choose a local file path. OnChanged is called whenever the path changes.

func NewFilePicker

func NewFilePicker(label string, initial string, window fyne.Window, onChange func(string)) *FilePicker

NewFilePicker constructs a FilePicker.

  • label : short label shown to the left of the entry
  • initial : pre-filled path (empty is fine)
  • window : the parent window, required for the dialog
  • onChange : callback with the new path whenever it changes

func (*FilePicker) CanvasObject

func (fp *FilePicker) CanvasObject() fyne.CanvasObject

CanvasObject returns the Fyne layout object to embed in a screen.

func (*FilePicker) GetPath

func (fp *FilePicker) GetPath() string

GetPath returns the current file path value.

func (*FilePicker) SetPath

func (fp *FilePicker) SetPath(path string)

SetPath programmatically sets the entry value (does NOT trigger OnChanged).

type ResultsView

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

ResultsView is a scrollable text area used to display command output. It supports two rendering modes:

  • plain text (default): monospace entry widget inside a bidirectional scroll
  • markdown: VBox of RichText blocks and native widget.Table objects inside a vertical-only scroll. This is required because widget.RichText cannot render GFM pipe tables; we parse them out and hand them to widget.Table instead.

func NewResultsView

func NewResultsView() *ResultsView

NewResultsView creates a read-only, scrollable text area (plain-text mode by default). The results area uses the same dark viewer palette as the View screen.

func (*ResultsView) AppendText

func (rv *ResultsView) AppendText(text string)

AppendText adds text to the bottom of the results area (plain-text mode only).

func (*ResultsView) CanvasObject

func (rv *ResultsView) CanvasObject() fyne.CanvasObject

CanvasObject returns the embeddable Fyne layout.

func (*ResultsView) Clear

func (rv *ResultsView) Clear()

Clear empties the results view.

func (*ResultsView) SetMarkdownMode

func (rv *ResultsView) SetMarkdownMode(md bool)

SetMarkdownMode switches between plain-text and markdown rendering. The caller is responsible for calling SetText afterwards to populate the view.

func (*ResultsView) SetText

func (rv *ResultsView) SetText(text string)

SetText replaces the content of the results area. In markdown mode the text is parsed into text blocks and pipe tables, each rendered with the appropriate Fyne widget, then stacked in a VBox.

type SidePanel

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

SidePanel is a collapsible panel that wraps a content object under a toggle button. When collapsed, only the toggle bar is visible; when expanded, the full content shows.

func NewSidePanel

func NewSidePanel(title string, content fyne.CanvasObject, expanded bool) *SidePanel

NewSidePanel creates a collapsible side panel.

  • title : label shown on the collapse/expand toggle button
  • content : the widget tree inside the panel
  • expanded : initial state

func (*SidePanel) CanvasObject

func (sp *SidePanel) CanvasObject() fyne.CanvasObject

CanvasObject returns the embeddable Fyne layout.

type StatusBar

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

StatusBar is a fixed-height bar divided into three sections (30 / 45 / 25 %) displayed at the bottom of the application window.

  • Left (30%): "Format: <CycloneDX|SPDX>" and "Version: <specVersion>" once a BOM is loaded
  • Middle(45%): base-name of the loaded BOM file (tooltip shows the full file path on hover)
  • Right (25%): reserved / future use

The background is RGB(52,120,198) with white foreground text.

func NewStatusBar

func NewStatusBar() *StatusBar

NewStatusBar constructs a StatusBar with an empty left section on init. The left section is populated with the format and version once a BOM is loaded.

func (*StatusBar) CanvasObject

func (sb *StatusBar) CanvasObject() fyne.CanvasObject

CanvasObject returns the embeddable Fyne object to place at the bottom of the window via container.NewBorder(…, statusBar.CanvasObject(), …).

func (*StatusBar) SetMiddle

func (sb *StatusBar) SetMiddle(baseName, fullPath string)

SetMiddle updates the middle-section label text and its hover tooltip. Pass an empty fullPath to clear the tooltip.

func (*StatusBar) UpdateForBOM

func (sb *StatusBar) UpdateForBOM(format, specVersion, filePath string)

UpdateForBOM refreshes the left (format + version) and middle (filename) sections from the provided BOM metadata. Pass empty strings to reset.

Jump to

Keyboard shortcuts

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