Documentation
¶
Overview ¶
Package component provides UI components for the browser.
Package component provides UI components for the browser.
Package component provides UI components for the browser.
Package component provides UI components for the browser.
Package component provides UI components for the browser.
Package component provides reusable GTK UI components.
Package component provides UI components for the browser.
Package component provides UI components for the browser.
Index ¶
- Variables
- func CalculateModalDimensions(parent layout.OverlayWidget, cfg ModalSizeConfig) (width, marginTop int)
- func MeasureWidgetHeight(widget *gtk.Widget, forWidth int) int
- func ScaleValue(base int, uiScale float64) int
- func SetScrolledWindowHeight(sw *gtk.ScrolledWindow, height int)
- type Favorite
- type FindBar
- type FindBarConfig
- type LinkStatusOverlay
- type ListDisplayDefaults
- type ModalSizeConfig
- type Omnibox
- func (o *Omnibox) Destroy()
- func (o *Omnibox) Hide(ctx context.Context)
- func (o *Omnibox) IsVisible() bool
- func (o *Omnibox) SetOnClose(fn func())
- func (o *Omnibox) SetOnNavigate(fn func(url string))
- func (o *Omnibox) SetParentOverlay(overlay layout.OverlayWidget)
- func (o *Omnibox) Show(ctx context.Context, query string)
- func (o *Omnibox) Toggle(ctx context.Context)
- func (o *Omnibox) UpdateZoomIndicator(factor float64)
- func (o *Omnibox) Widget() *gtk.Widget
- func (o *Omnibox) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget
- type OmniboxConfig
- type PaneView
- func (pv *PaneView) AddCssClass(class string)
- func (pv *PaneView) AddOverlayWidget(widget layout.Widget)
- func (pv *PaneView) AttachHoverHandler(ctx context.Context)
- func (pv *PaneView) Cleanup()
- func (pv *PaneView) GetContentDimensions() (width, height int)
- func (pv *PaneView) GrabFocus() bool
- func (pv *PaneView) HasFocus() bool
- func (pv *PaneView) Hide()
- func (pv *PaneView) HideLinkStatus()
- func (pv *PaneView) IsActive() bool
- func (pv *PaneView) IsVisible() bool
- func (pv *PaneView) Overlay() layout.OverlayWidget
- func (pv *PaneView) PaneID() entity.PaneID
- func (pv *PaneView) RemoveCssClass(class string)
- func (pv *PaneView) RemoveOverlayWidget(widget layout.Widget)
- func (pv *PaneView) SetActive(active bool)
- func (pv *PaneView) SetLoadProgress(progress float64)
- func (pv *PaneView) SetLoading(loading bool)
- func (pv *PaneView) SetOnFocusIn(fn func(paneID entity.PaneID))
- func (pv *PaneView) SetOnFocusOut(fn func(paneID entity.PaneID))
- func (pv *PaneView) SetOnHover(fn func(paneID entity.PaneID))
- func (pv *PaneView) SetVisible(visible bool)
- func (pv *PaneView) SetWebViewWidget(widget layout.Widget)
- func (pv *PaneView) Show()
- func (pv *PaneView) ShowLinkStatus(uri string)
- func (pv *PaneView) ShowToast(ctx context.Context, message string, level ToastLevel)
- func (pv *PaneView) ShowZoomToast(ctx context.Context, zoomPercent int)
- func (pv *PaneView) WebViewWidget() layout.Widget
- func (pv *PaneView) Widget() layout.Widget
- type ProgressBar
- type RowHeightDefaults
- type SessionManager
- func (sm *SessionManager) Destroy()
- func (sm *SessionManager) Hide(ctx context.Context)
- func (sm *SessionManager) IsVisible() bool
- func (sm *SessionManager) SetParentOverlay(overlay layout.OverlayWidget)
- func (sm *SessionManager) Show(ctx context.Context)
- func (sm *SessionManager) Toggle(ctx context.Context)
- func (sm *SessionManager) Widget() *gtk.Widget
- func (sm *SessionManager) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget
- type SessionManagerConfig
- type StackedPaneManager
- func (spm *StackedPaneManager) AddPaneToStack(ctx context.Context, wsView *WorkspaceView, activePaneID entity.PaneID, ...) error
- func (spm *StackedPaneManager) GetStackedView(wsView *WorkspaceView, paneID entity.PaneID) *layout.StackedView
- func (spm *StackedPaneManager) IsStacked(wsView *WorkspaceView, paneID entity.PaneID) bool
- func (spm *StackedPaneManager) NavigateStack(ctx context.Context, wsView *WorkspaceView, currentPaneID entity.PaneID, ...) (entity.PaneID, error)
- func (spm *StackedPaneManager) SetStackActiveCallback(wsView *WorkspaceView, paneID entity.PaneID, callback func(index int))
- type Suggestion
- type TabBar
- func (tb *TabBar) ActiveTabID() entity.TabID
- func (tb *TabBar) AddTab(tab *entity.Tab)
- func (tb *TabBar) Box() *gtk.Box
- func (tb *TabBar) Count() int
- func (tb *TabBar) Destroy()
- func (tb *TabBar) RemoveTab(tabID entity.TabID)
- func (tb *TabBar) SetActive(tabID entity.TabID)
- func (tb *TabBar) SetOnClose(fn func(tabID entity.TabID))
- func (tb *TabBar) SetOnCreate(fn func())
- func (tb *TabBar) SetOnSwitch(fn func(tabID entity.TabID))
- func (tb *TabBar) SetVisible(visible bool)
- func (tb *TabBar) UpdateTitle(tabID entity.TabID, title string)
- func (tb *TabBar) Widget() *gtk.Widget
- type TabButton
- func (tb *TabButton) Button() *gtk.Button
- func (tb *TabButton) Destroy()
- func (tb *TabButton) IsActive() bool
- func (tb *TabButton) SetActive(active bool)
- func (tb *TabButton) SetOnClick(fn func(tabID entity.TabID))
- func (tb *TabButton) SetTitle(title string)
- func (tb *TabButton) TabID() entity.TabID
- func (tb *TabButton) Widget() *gtk.Widget
- type ToastLevel
- type Toaster
- type ViewMode
- type WorkspaceView
- func (wv *WorkspaceView) ClearRootWidgetRef()
- func (wv *WorkspaceView) Container() layout.BoxWidget
- func (wv *WorkspaceView) ContainerWidget() layout.Widget
- func (wv *WorkspaceView) Factory() layout.WidgetFactory
- func (wv *WorkspaceView) FindNext()
- func (wv *WorkspaceView) FindPrevious()
- func (wv *WorkspaceView) FocusPane(paneID entity.PaneID) bool
- func (wv *WorkspaceView) GetActivePaneID() entity.PaneID
- func (wv *WorkspaceView) GetActivePaneView() *PaneView
- func (wv *WorkspaceView) GetOmnibox() *Omnibox
- func (wv *WorkspaceView) GetPaneIDs() []entity.PaneID
- func (wv *WorkspaceView) GetPaneView(paneID entity.PaneID) *PaneView
- func (wv *WorkspaceView) GetPaneWidget(paneID entity.PaneID) layout.Widget
- func (wv *WorkspaceView) GetRootWidget() layout.Widget
- func (wv *WorkspaceView) GetStackContainerWidget(paneID entity.PaneID) layout.Widget
- func (wv *WorkspaceView) HideFindBar()
- func (wv *WorkspaceView) HideOmnibox()
- func (wv *WorkspaceView) IsFindBarVisible() bool
- func (wv *WorkspaceView) IsOmniboxVisible() bool
- func (wv *WorkspaceView) PaneCount() int
- func (wv *WorkspaceView) Rebuild(ctx context.Context) error
- func (wv *WorkspaceView) RegisterPaneView(paneID entity.PaneID, pv *PaneView)
- func (wv *WorkspaceView) SetActivePaneID(paneID entity.PaneID) error
- func (wv *WorkspaceView) SetFindBarConfig(cfg FindBarConfig)
- func (wv *WorkspaceView) SetModeBorderOverlay(widget layout.Widget)
- func (wv *WorkspaceView) SetOmniboxConfig(cfg OmniboxConfig)
- func (wv *WorkspaceView) SetOnPaneFocused(fn func(paneID entity.PaneID))
- func (wv *WorkspaceView) SetOnSplitRatioDragged(fn func(nodeID string, ratio float64))
- func (wv *WorkspaceView) SetRootWidgetDirect(widget layout.Widget)
- func (wv *WorkspaceView) SetWebViewWidget(paneID entity.PaneID, widget layout.Widget) error
- func (wv *WorkspaceView) SetWorkspace(ctx context.Context, ws *entity.Workspace) error
- func (wv *WorkspaceView) ShowFindBar(ctx context.Context)
- func (wv *WorkspaceView) ShowOmnibox(ctx context.Context, query string)
- func (wv *WorkspaceView) TreeRenderer() *layout.TreeRenderer
- func (wv *WorkspaceView) UnregisterPaneView(paneID entity.PaneID)
- func (wv *WorkspaceView) Widget() layout.Widget
- func (wv *WorkspaceView) Workspace() *entity.Workspace
Constants ¶
This section is empty.
Variables ¶
var DefaultRowHeights = RowHeightDefaults{
Standard: 50,
Compact: 28,
Divider: 30,
}
Package-level defaults for row heights.
var ErrNilWorkspace = errors.New("workspace is nil")
ErrNilWorkspace is returned when attempting to set a nil workspace.
var ErrPaneNotFound = errors.New("pane not found")
ErrPaneNotFound is returned when a pane ID cannot be found.
var ErrStackNotFound = errors.New("stacked view not found for pane")
ErrStackNotFound is returned when a StackedView cannot be found for a pane.
var OmniboxListDefaults = ListDisplayDefaults{
MaxVisibleRows: 10,
MaxResults: 10,
}
OmniboxListDefaults provides display limits for omnibox modal.
var OmniboxSizeDefaults = ModalSizeConfig{
WidthPct: 0.8,
MaxWidth: 800,
TopMarginPct: 0.2,
FallbackWidth: 800,
FallbackHeight: 600,
}
OmniboxSizeDefaults provides default sizing for omnibox modal.
var SessionManagerListDefaults = ListDisplayDefaults{
MaxVisibleRows: 6,
MaxResults: 50,
}
SessionManagerListDefaults provides display limits for session manager modal.
var SessionManagerSizeDefaults = ModalSizeConfig{
WidthPct: 0.6,
MaxWidth: 600,
TopMarginPct: 0.15,
FallbackWidth: 600,
FallbackHeight: 600,
}
SessionManagerSizeDefaults provides default sizing for session manager modal.
Functions ¶
func CalculateModalDimensions ¶ added in v0.21.0
func CalculateModalDimensions(parent layout.OverlayWidget, cfg ModalSizeConfig) (width, marginTop int)
CalculateModalDimensions computes width and top margin based on parent overlay. Returns calculated width and top margin in pixels.
func MeasureWidgetHeight ¶ added in v0.21.0
MeasureWidgetHeight returns the natural height of a widget for a given width. Returns 0 if widget is nil or measurement fails.
func ScaleValue ¶ added in v0.21.0
ScaleValue scales a base pixel value by UI scale factor. Returns the base value if scale is <= 0.
func SetScrolledWindowHeight ¶ added in v0.21.0
func SetScrolledWindowHeight(sw *gtk.ScrolledWindow, height int)
SetScrolledWindowHeight safely sets min/max content height on a ScrolledWindow. Resets min to -1 first to avoid GTK assertion (min <= max) when shrinking.
Types ¶
type FindBar ¶
type FindBar struct {
// contains filtered or unexported fields
}
FindBar is a compact find-in-page UI overlay.
func NewFindBar ¶
func NewFindBar(ctx context.Context, cfg FindBarConfig) *FindBar
NewFindBar creates a new FindBar component.
func (*FindBar) FindPrevious ¶
func (fb *FindBar) FindPrevious()
FindPrevious moves to the previous match.
func (*FindBar) SetFindController ¶
func (fb *FindBar) SetFindController(controller port.FindController)
SetFindController attaches the FindController to the use case.
func (*FindBar) WidgetAsLayout ¶
func (fb *FindBar) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget
WidgetAsLayout returns the find bar's outer widget as a layout.Widget.
type FindBarConfig ¶
type FindBarConfig struct {
OnClose func()
GetFindController func(paneID entity.PaneID) port.FindController
}
FindBarConfig holds configuration for creating a FindBar.
type LinkStatusOverlay ¶ added in v0.21.0
type LinkStatusOverlay struct {
// contains filtered or unexported fields
}
LinkStatusOverlay displays the destination URL when hovering over links. It appears in the bottom-left corner with a fade-in/fade-out transition.
func NewLinkStatusOverlay ¶ added in v0.21.0
func NewLinkStatusOverlay(factory layout.WidgetFactory) *LinkStatusOverlay
NewLinkStatusOverlay creates a new link status overlay component. The overlay is positioned at bottom-left with fade transitions via CSS.
func (*LinkStatusOverlay) Cleanup ¶ added in v0.21.0
func (l *LinkStatusOverlay) Cleanup()
Cleanup cancels any pending timers and clears state. Must be called before removing the overlay from the UI.
func (*LinkStatusOverlay) Hide ¶ added in v0.21.0
func (l *LinkStatusOverlay) Hide()
Hide manually hides the link status overlay.
func (*LinkStatusOverlay) IsVisible ¶ added in v0.21.0
func (l *LinkStatusOverlay) IsVisible() bool
IsVisible returns whether the overlay is currently visible.
func (*LinkStatusOverlay) Show ¶ added in v0.21.0
func (l *LinkStatusOverlay) Show(uri string)
Show displays the link status overlay with the given URI. If uri is empty, hides the overlay instead. Uses a small delay to avoid flicker during rapid mouse movement.
func (*LinkStatusOverlay) Widget ¶ added in v0.21.0
func (l *LinkStatusOverlay) Widget() layout.Widget
Widget returns the underlying widget for embedding in overlays.
type ListDisplayDefaults ¶ added in v0.21.0
type ListDisplayDefaults struct {
MaxVisibleRows int // Maximum rows visible before scrolling
MaxResults int // Maximum results to fetch/display
}
ListDisplayDefaults holds display limits for list-based modals.
type ModalSizeConfig ¶ added in v0.21.0
type ModalSizeConfig struct {
WidthPct float64 // Percentage of parent width (e.g., 0.6)
MaxWidth int // Maximum width in pixels
TopMarginPct float64 // Top margin as percentage of parent height
FallbackWidth int // Fallback when parent not allocated
FallbackHeight int // Fallback height
}
ModalSizeConfig holds configuration for modal sizing calculations.
type Omnibox ¶
type Omnibox struct {
// contains filtered or unexported fields
}
Omnibox is the native GTK4 address bar / command palette.
func NewOmnibox ¶
func NewOmnibox(ctx context.Context, cfg OmniboxConfig) *Omnibox
NewOmnibox creates a new native GTK4 omnibox widget. Call SetParentOverlay() before Show() to set the parent for sizing.
func (*Omnibox) SetOnClose ¶
func (o *Omnibox) SetOnClose(fn func())
SetOnClose sets the callback for omnibox close events.
func (*Omnibox) SetOnNavigate ¶
SetOnNavigate sets the callback for URL navigation.
func (*Omnibox) SetParentOverlay ¶
func (o *Omnibox) SetParentOverlay(overlay layout.OverlayWidget)
SetParentOverlay sets the overlay widget used for sizing calculations. Must be called before Show().
func (*Omnibox) UpdateZoomIndicator ¶
UpdateZoomIndicator updates the zoom percentage display. Shows the indicator when zoom != 100%, hides it when at 100%.
func (*Omnibox) WidgetAsLayout ¶
func (o *Omnibox) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget
WidgetAsLayout returns the omnibox's outer widget as a layout.Widget. This is useful for adding the omnibox to a PaneView overlay.
type OmniboxConfig ¶
type OmniboxConfig struct {
HistoryUC *usecase.SearchHistoryUseCase
FavoritesUC *usecase.ManageFavoritesUseCase
FaviconAdapter *adapter.FaviconAdapter
CopyURLUC *usecase.CopyURLUseCase
Shortcuts map[string]config.SearchShortcut
DefaultSearch string
InitialBehavior string
UIScale float64 // UI scale for favicon sizing
OnToast func(message string) // Callback to show toast notification
}
OmniboxConfig holds configuration for creating an Omnibox.
type PaneView ¶
type PaneView struct {
// contains filtered or unexported fields
}
PaneView is a container for a single WebView with active state indication. It uses an overlay to display a border around the active pane.
func NewPaneView ¶
func NewPaneView(factory layout.WidgetFactory, paneID entity.PaneID, webViewWidget layout.Widget) *PaneView
NewPaneView creates a new pane view container for a WebView widget.
func (*PaneView) AddCssClass ¶
AddCssClass adds a CSS class to the overlay.
func (*PaneView) AddOverlayWidget ¶
AddOverlayWidget adds a widget as an overlay on this pane. The widget will appear above the WebView and border.
func (*PaneView) AttachHoverHandler ¶
AttachHoverHandler creates and attaches a hover handler for focus-follows-mouse behavior.
func (*PaneView) Cleanup ¶ added in v0.20.1
func (pv *PaneView) Cleanup()
Cleanup removes the WebView widget from the overlay and clears references. This must be called before destroying the WebView to ensure proper GTK cleanup. After calling Cleanup, the PaneView should not be reused.
func (*PaneView) GetContentDimensions ¶
GetContentDimensions returns the pane's allocated width and height.
func (*PaneView) GrabFocus ¶
GrabFocus attempts to focus the WebView. Returns true if focus was successfully grabbed.
func (*PaneView) HideLinkStatus ¶ added in v0.21.0
func (pv *PaneView) HideLinkStatus()
HideLinkStatus hides the link status overlay.
func (*PaneView) Overlay ¶
func (pv *PaneView) Overlay() layout.OverlayWidget
Overlay returns the underlying overlay widget for direct access.
func (*PaneView) RemoveCssClass ¶
RemoveCssClass removes a CSS class from the overlay.
func (*PaneView) RemoveOverlayWidget ¶
RemoveOverlayWidget removes an overlay widget from this pane.
func (*PaneView) SetActive ¶
SetActive updates the active state of the pane. Active panes display a visual border indicator.
func (*PaneView) SetLoadProgress ¶
SetLoadProgress updates the progress bar with the current load progress. progress should be between 0.0 and 1.0.
func (*PaneView) SetLoading ¶
SetLoading shows or hides the progress bar.
func (*PaneView) SetOnFocusIn ¶
SetOnFocusIn sets the callback for when the pane gains focus.
func (*PaneView) SetOnFocusOut ¶
SetOnFocusOut sets the callback for when the pane loses focus.
func (*PaneView) SetOnHover ¶
SetOnHover sets the callback for when the pane is hovered.
func (*PaneView) SetVisible ¶
SetVisible sets the visibility of the pane.
func (*PaneView) SetWebViewWidget ¶
SetWebViewWidget replaces the WebView widget.
func (*PaneView) ShowLinkStatus ¶ added in v0.21.0
ShowLinkStatus displays the link status overlay with the given URI. If uri is empty, hides the overlay instead.
func (*PaneView) ShowToast ¶
func (pv *PaneView) ShowToast(ctx context.Context, message string, level ToastLevel)
ShowToast displays a toast notification with the given message and level. If a toast is already visible, updates the text and resets the dismiss timer.
func (*PaneView) ShowZoomToast ¶
ShowZoomToast displays a zoom level toast notification. Formats the zoom percentage with a % suffix.
func (*PaneView) WebViewWidget ¶
WebViewWidget returns the underlying WebView widget.
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar displays a slim loading progress indicator at the bottom of a pane. Uses native GtkProgressBar with "osd" styling for overlay appearance. Implements smooth animation by incrementing towards the target value.
func NewProgressBar ¶
func NewProgressBar(factory layout.WidgetFactory) *ProgressBar
NewProgressBar creates a new progress bar component using the widget factory.
func (*ProgressBar) Hide ¶
func (pb *ProgressBar) Hide()
Hide makes the progress bar invisible and resets state.
func (*ProgressBar) IsVisible ¶
func (pb *ProgressBar) IsVisible() bool
IsVisible returns whether the progress bar is currently visible.
func (*ProgressBar) SetProgress ¶
func (pb *ProgressBar) SetProgress(progress float64)
SetProgress sets the target progress value and starts smooth animation. progress should be between 0.0 and 1.0.
func (*ProgressBar) Widget ¶
func (pb *ProgressBar) Widget() layout.Widget
Widget returns the underlying widget for embedding in overlays.
type RowHeightDefaults ¶ added in v0.21.0
type RowHeightDefaults struct {
Standard int // Standard list row (e.g., session row, history row)
Compact int // Compact row (e.g., tree row, sub-item)
Divider int // Divider/separator row
}
RowHeightDefaults holds default (unscaled) row heights for list-based modals. These are base pixel values that should be multiplied by UI scale.
type SessionManager ¶ added in v0.21.0
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is a modal overlay for managing sessions.
func NewSessionManager ¶ added in v0.21.0
func NewSessionManager(ctx context.Context, cfg SessionManagerConfig) *SessionManager
NewSessionManager creates a new SessionManager component.
func (*SessionManager) Destroy ¶ added in v0.21.0
func (sm *SessionManager) Destroy()
Destroy cleans up session manager resources.
func (*SessionManager) Hide ¶ added in v0.21.0
func (sm *SessionManager) Hide(ctx context.Context)
Hide hides the session manager.
func (*SessionManager) IsVisible ¶ added in v0.21.0
func (sm *SessionManager) IsVisible() bool
IsVisible returns whether the session manager is visible.
func (*SessionManager) SetParentOverlay ¶ added in v0.21.0
func (sm *SessionManager) SetParentOverlay(overlay layout.OverlayWidget)
SetParentOverlay sets the overlay widget used for sizing calculations. Must be called before Show().
func (*SessionManager) Show ¶ added in v0.21.0
func (sm *SessionManager) Show(ctx context.Context)
Show displays the session manager and loads sessions.
func (*SessionManager) Toggle ¶ added in v0.21.0
func (sm *SessionManager) Toggle(ctx context.Context)
Toggle shows if hidden, hides if visible.
func (*SessionManager) Widget ¶ added in v0.21.0
func (sm *SessionManager) Widget() *gtk.Widget
Widget returns the session manager widget for embedding in an overlay.
func (*SessionManager) WidgetAsLayout ¶ added in v0.21.0
func (sm *SessionManager) WidgetAsLayout(factory layout.WidgetFactory) layout.Widget
WidgetAsLayout returns the session manager's outer widget as a layout.Widget.
type SessionManagerConfig ¶ added in v0.21.0
type SessionManagerConfig struct {
ListSessionsUC *usecase.ListSessionsUseCase
DeleteSessionUC *usecase.DeleteSessionUseCase
Spawner port.SessionSpawner
CurrentSession entity.SessionID
UIScale float64
OnClose func()
OnOpen func(sessionID entity.SessionID)
OnToast func(ctx context.Context, message string, level ToastLevel)
}
SessionManagerConfig holds configuration for creating a SessionManager.
type StackedPaneManager ¶
type StackedPaneManager struct {
// contains filtered or unexported fields
}
StackedPaneManager handles stacked pane operations. With the new architecture, every pane is wrapped in a StackedView from the start, making stacking operations trivial - we just add panes to the existing StackedView.
func NewStackedPaneManager ¶
func NewStackedPaneManager(factory layout.WidgetFactory) *StackedPaneManager
NewStackedPaneManager creates a new stacked pane manager.
func (*StackedPaneManager) AddPaneToStack ¶
func (spm *StackedPaneManager) AddPaneToStack( ctx context.Context, wsView *WorkspaceView, activePaneID entity.PaneID, newPaneView *PaneView, title string, ) error
AddPaneToStack adds a new pane to the stack containing the active pane. The StackedView is looked up from the TreeRenderer.
func (*StackedPaneManager) GetStackedView ¶
func (spm *StackedPaneManager) GetStackedView(wsView *WorkspaceView, paneID entity.PaneID) *layout.StackedView
GetStackedView returns the StackedView for a pane.
func (*StackedPaneManager) IsStacked ¶
func (spm *StackedPaneManager) IsStacked(wsView *WorkspaceView, paneID entity.PaneID) bool
IsStacked returns true if the pane is in a stack with multiple panes.
func (*StackedPaneManager) NavigateStack ¶
func (spm *StackedPaneManager) NavigateStack( ctx context.Context, wsView *WorkspaceView, currentPaneID entity.PaneID, direction string, ) (entity.PaneID, error)
NavigateStack moves to the next or previous pane in a stack. Returns the pane ID that became active.
func (*StackedPaneManager) SetStackActiveCallback ¶
func (spm *StackedPaneManager) SetStackActiveCallback( wsView *WorkspaceView, paneID entity.PaneID, callback func(index int), )
SetStackActiveCallback sets up the callback for when a stack pane is clicked.
type Suggestion ¶
Suggestion represents a search result from history.
type TabBar ¶
type TabBar struct {
// contains filtered or unexported fields
}
TabBar represents the horizontal tab bar widget.
func (*TabBar) ActiveTabID ¶
ActiveTabID returns the currently active tab ID.
func (*TabBar) SetOnClose ¶
SetOnClose sets the callback for tab close events.
func (*TabBar) SetOnCreate ¶
func (tb *TabBar) SetOnCreate(fn func())
SetOnCreate sets the callback for new tab creation.
func (*TabBar) SetOnSwitch ¶
SetOnSwitch sets the callback for tab switch events.
func (*TabBar) SetVisible ¶
SetVisible shows or hides the tab bar.
func (*TabBar) UpdateTitle ¶
UpdateTitle updates the title of a specific tab button.
type TabButton ¶
type TabButton struct {
// contains filtered or unexported fields
}
TabButton represents a single tab button in the tab bar.
func NewTabButton ¶
NewTabButton creates a new tab button for the given tab.
func (*TabButton) SetOnClick ¶
SetOnClick sets the callback for click events.
type ToastLevel ¶
type ToastLevel int
ToastLevel indicates the visual style of a toast notification.
const ( // ToastInfo is for informational messages (accent color). ToastInfo ToastLevel = iota // ToastSuccess is for success confirmations (green). ToastSuccess // ToastWarning is for warning messages (yellow). ToastWarning // ToastError is for error messages (red). ToastError )
type Toaster ¶
type Toaster struct {
// contains filtered or unexported fields
}
Toaster displays toast notifications in an overlay. It supports different notification levels and auto-dismissal. When a new toast is shown while one is already visible, the text is updated in-place and the dismiss timer is reset (spam protection).
func NewToaster ¶
func NewToaster(factory layout.WidgetFactory) *Toaster
NewToaster creates a new toaster component for overlay display. The toaster is positioned in the top-left corner with margin.
func (*Toaster) Show ¶
func (t *Toaster) Show(ctx context.Context, message string, level ToastLevel)
Show displays a toast notification with the given message and level. If a toast is already visible, updates the text and resets the dismiss timer.
type WorkspaceView ¶
type WorkspaceView struct {
// contains filtered or unexported fields
}
WorkspaceView is the top-level container that renders a workspace's pane tree. It manages the widget tree and handles active pane state.
func NewWorkspaceView ¶
func NewWorkspaceView(ctx context.Context, factory layout.WidgetFactory) *WorkspaceView
NewWorkspaceView creates a new workspace view.
func (*WorkspaceView) ClearRootWidgetRef ¶
func (wv *WorkspaceView) ClearRootWidgetRef()
ClearRootWidgetRef clears the stored root widget reference without removing it. Use this before SetRootWidgetDirect when the old root has already been removed through other means (e.g., GTK paned operations).
func (*WorkspaceView) Container ¶
func (wv *WorkspaceView) Container() layout.BoxWidget
Container returns the underlying BoxWidget for direct access.
func (*WorkspaceView) ContainerWidget ¶
func (wv *WorkspaceView) ContainerWidget() layout.Widget
ContainerWidget returns the container widget for relative positioning. Implements focus.PaneGeometryProvider.
func (*WorkspaceView) Factory ¶
func (wv *WorkspaceView) Factory() layout.WidgetFactory
Factory returns the widget factory used by this workspace view.
func (*WorkspaceView) FindNext ¶
func (wv *WorkspaceView) FindNext()
FindNext triggers the next match in the find bar if available.
func (*WorkspaceView) FindPrevious ¶
func (wv *WorkspaceView) FindPrevious()
FindPrevious triggers the previous match in the find bar if available.
func (*WorkspaceView) FocusPane ¶
func (wv *WorkspaceView) FocusPane(paneID entity.PaneID) bool
FocusPane attempts to give focus to a specific pane. Returns true if focus was successfully grabbed.
func (*WorkspaceView) GetActivePaneID ¶
func (wv *WorkspaceView) GetActivePaneID() entity.PaneID
GetActivePaneID returns the ID of the currently active pane. Reads from the domain model as the single source of truth.
func (*WorkspaceView) GetActivePaneView ¶
func (wv *WorkspaceView) GetActivePaneView() *PaneView
GetActivePaneView returns the PaneView for the current active pane.
func (*WorkspaceView) GetOmnibox ¶
func (wv *WorkspaceView) GetOmnibox() *Omnibox
GetOmnibox returns the current omnibox if visible.
func (*WorkspaceView) GetPaneIDs ¶
func (wv *WorkspaceView) GetPaneIDs() []entity.PaneID
GetPaneIDs returns all pane IDs in this workspace view.
func (*WorkspaceView) GetPaneView ¶
func (wv *WorkspaceView) GetPaneView(paneID entity.PaneID) *PaneView
GetPaneView returns the PaneView for a given pane ID. Returns nil if not found.
func (*WorkspaceView) GetPaneWidget ¶
func (wv *WorkspaceView) GetPaneWidget(paneID entity.PaneID) layout.Widget
GetPaneWidget returns the widget for a pane ID. Implements focus.PaneGeometryProvider.
func (*WorkspaceView) GetRootWidget ¶
func (wv *WorkspaceView) GetRootWidget() layout.Widget
GetRootWidget returns the current root widget of the workspace. This is useful for incremental operations that need to modify the tree.
func (*WorkspaceView) GetStackContainerWidget ¶
func (wv *WorkspaceView) GetStackContainerWidget(paneID entity.PaneID) layout.Widget
GetStackContainerWidget returns the stack container widget for a stacked pane. Returns nil if the pane is not in a stack. Implements focus.PaneGeometryProvider.
func (*WorkspaceView) HideFindBar ¶
func (wv *WorkspaceView) HideFindBar()
HideFindBar hides and destroys the current find bar.
func (*WorkspaceView) HideOmnibox ¶
func (wv *WorkspaceView) HideOmnibox()
HideOmnibox hides and destroys the current omnibox.
func (*WorkspaceView) IsFindBarVisible ¶
func (wv *WorkspaceView) IsFindBarVisible() bool
IsFindBarVisible returns whether the find bar is currently visible.
func (*WorkspaceView) IsOmniboxVisible ¶
func (wv *WorkspaceView) IsOmniboxVisible() bool
IsOmniboxVisible returns whether the omnibox is currently visible.
func (*WorkspaceView) PaneCount ¶
func (wv *WorkspaceView) PaneCount() int
PaneCount returns the number of panes in the workspace view.
func (*WorkspaceView) Rebuild ¶
func (wv *WorkspaceView) Rebuild(ctx context.Context) error
Rebuild rebuilds the widget tree from the current workspace. Use this after structural changes like splits or closes.
func (*WorkspaceView) RegisterPaneView ¶
func (wv *WorkspaceView) RegisterPaneView(paneID entity.PaneID, pv *PaneView)
RegisterPaneView adds a PaneView to the tracking map without rebuilding. Use this for incremental operations like stacked panes.
func (*WorkspaceView) SetActivePaneID ¶
func (wv *WorkspaceView) SetActivePaneID(paneID entity.PaneID) error
SetActivePaneID updates which pane is visually marked as active.
func (*WorkspaceView) SetFindBarConfig ¶
func (wv *WorkspaceView) SetFindBarConfig(cfg FindBarConfig)
SetFindBarConfig stores the find bar configuration for later use.
func (*WorkspaceView) SetModeBorderOverlay ¶
func (wv *WorkspaceView) SetModeBorderOverlay(widget layout.Widget)
SetModeBorderOverlay attaches a mode border overlay widget. The widget will be displayed on top of the pane container when modes are active.
func (*WorkspaceView) SetOmniboxConfig ¶
func (wv *WorkspaceView) SetOmniboxConfig(cfg OmniboxConfig)
SetOmniboxConfig stores the omnibox configuration for later use.
func (*WorkspaceView) SetOnPaneFocused ¶
func (wv *WorkspaceView) SetOnPaneFocused(fn func(paneID entity.PaneID))
SetOnPaneFocused sets the callback for when a pane receives focus.
func (*WorkspaceView) SetOnSplitRatioDragged ¶ added in v0.21.0
func (wv *WorkspaceView) SetOnSplitRatioDragged(fn func(nodeID string, ratio float64))
func (*WorkspaceView) SetRootWidgetDirect ¶
func (wv *WorkspaceView) SetRootWidgetDirect(widget layout.Widget)
SetRootWidgetDirect replaces the root widget without rebuilding the entire tree. Use this for incremental operations when converting to/from stacked panes.
func (*WorkspaceView) SetWebViewWidget ¶
SetWebViewWidget attaches a WebView widget to a specific pane.
func (*WorkspaceView) SetWorkspace ¶
SetWorkspace sets the workspace to render and builds the widget tree.
func (*WorkspaceView) ShowFindBar ¶
func (wv *WorkspaceView) ShowFindBar(ctx context.Context)
ShowFindBar creates and shows the find bar in the active pane.
func (*WorkspaceView) ShowOmnibox ¶
func (wv *WorkspaceView) ShowOmnibox(ctx context.Context, query string)
ShowOmnibox creates and shows the omnibox in the active pane.
func (*WorkspaceView) TreeRenderer ¶
func (wv *WorkspaceView) TreeRenderer() *layout.TreeRenderer
TreeRenderer returns the underlying tree renderer.
func (*WorkspaceView) UnregisterPaneView ¶
func (wv *WorkspaceView) UnregisterPaneView(paneID entity.PaneID)
UnregisterPaneView removes a PaneView from the tracking map and cleans it up. This must be called when closing a pane to properly release GTK resources before destroying the WebView.
func (*WorkspaceView) Widget ¶
func (wv *WorkspaceView) Widget() layout.Widget
Widget returns the overlay widget for embedding in the UI. The overlay wraps the pane container and allows mode borders to be displayed.
func (*WorkspaceView) Workspace ¶
func (wv *WorkspaceView) Workspace() *entity.Workspace
Workspace returns the current workspace.