ui

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindListBoxModel added in v0.14.0

func BindListBoxModel[T any](lb *gtk.ListBox, m gio.ListModeller, f func(T) gtk.Widgetter)

func BindModel added in v0.14.0

func BindModel[T any](
	add func(int, gtk.Widgetter),
	remove func(int, gtk.Widgetter),
	m gio.ListModeller,
	f func(T) gtk.Widgetter,
) func()

func NewObjectComparer added in v0.14.0

func NewObjectComparer[T any](f func(T, T) int) glib.CompareDataFunc

Types

type App

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

App is the main type for the app, containing all of the state necessary to run it.

func (*App) Quit

func (a *App) Quit()

Quit exits the app completely, causing Run to return.

func (*App) Run

func (a *App) Run(ctx context.Context)

Run runs the app, initializing everything and then entering the main loop. It will return if either ctx is cancelled or Quit is called.

type Confirmation

type Confirmation struct {
	Heading string
	Body    string
	Accept  string
	Reject  string
}

func (Confirmation) Show

func (d Confirmation) Show(a *App, res func(bool))

type Info added in v0.10.2

type Info struct {
	Heading string
	Body    string
}

func (Info) Show added in v0.10.2

func (d Info) Show(a *App, closed func())

type MainWindow

type MainWindow struct {
	*adw.ApplicationWindow `gtk:"MainWindow"`

	ToastOverlay    *adw.ToastOverlay
	SplitView       *adw.NavigationSplitView
	StatusSwitch    *gtk.Switch
	MainMenuButton  *gtk.MenuButton
	PeersStack      *gtk.Stack
	WorkSpinner     *gtk.Spinner
	ProfileDropDown *gtk.DropDown

	ProfileModel     *gtk.StringList
	ProfileSortModel *gtk.SortListModel
}

func NewMainWindow

func NewMainWindow(app *gtk.Application) *MainWindow

type MullvadPage added in v0.12.0

type MullvadPage struct {
	*adw.StatusPage `gtk:"Page"`

	ExitNodesGroup *adw.PreferencesGroup
	// contains filtered or unexported fields
}

func NewMullvadPage added in v0.12.0

func NewMullvadPage(a *App, status tsutil.Status) *MullvadPage

func (*MullvadPage) ID added in v0.12.0

func (page *MullvadPage) ID() string

func (*MullvadPage) Name added in v0.12.0

func (page *MullvadPage) Name() string

func (*MullvadPage) Root added in v0.12.0

func (page *MullvadPage) Root() gtk.Widgetter

func (*MullvadPage) Update added in v0.12.0

func (page *MullvadPage) Update(a *App, peer *ipnstate.PeerStatus, status tsutil.Status)

type Page added in v0.12.0

type Page interface {
	// Root returns the root widget that is can be placed into a container.
	Root() gtk.Widgetter

	// An identifier for the page.
	ID() string

	// Name returns a displayable name for the page.
	Name() string

	// Update performs an update of the UI to match new state.
	Update(*App, *ipnstate.PeerStatus, tsutil.Status)
}

Page represents the UI for a single page of the app. This usually corresponds to information about a specific peer in the tailnet.

type PeerPage

type PeerPage struct {
	*adw.StatusPage `gtk:"Page"`

	IPList                *gtk.ListBox
	AdvertisedRoutesGroup *adw.PreferencesGroup
	AdvertisedRoutesList  *gtk.ListBox
	UDPRow                *adw.ActionRow
	UDP                   *gtk.Image
	IPv4Row               *adw.ActionRow
	IPv4Icon              *gtk.Image
	IPv4Addr              *gtk.Label
	IPv6Row               *adw.ActionRow
	IPv6Icon              *gtk.Image
	IPv6Addr              *gtk.Label
	UPnPRow               *adw.ActionRow
	UPnP                  *gtk.Image
	PMPRow                *adw.ActionRow
	PMP                   *gtk.Image
	PCPRow                *adw.ActionRow
	PCP                   *gtk.Image
	HairPinningRow        *adw.ActionRow
	HairPinning           *gtk.Image
	PreferredDERPRow      *adw.ActionRow
	PreferredDERP         *gtk.Label
	DERPLatencies         *adw.ExpanderRow
	MiscGroup             *adw.PreferencesGroup
	ExitNodeRow           *adw.SwitchRow
	OnlineRow             *adw.ActionRow
	Online                *gtk.Image
	LastSeenRow           *adw.ActionRow
	LastSeen              *gtk.Label
	CreatedRow            *adw.ActionRow
	Created               *gtk.Label
	LastWriteRow          *adw.ActionRow
	LastWrite             *gtk.Label
	LastHandshakeRow      *adw.ActionRow
	LastHandshake         *gtk.Label
	RxBytesRow            *adw.ActionRow
	RxBytes               *gtk.Label
	TxBytesRow            *adw.ActionRow
	TxBytes               *gtk.Label
	SendFileGroup         *adw.PreferencesGroup
	SendFileRow           *adw.ActionRow
	DropTarget            *gtk.DropTarget
	// contains filtered or unexported fields
}

func NewPeerPage

func NewPeerPage(a *App, peer *ipnstate.PeerStatus, status tsutil.Status) *PeerPage

func (*PeerPage) ID added in v0.12.0

func (page *PeerPage) ID() string

func (*PeerPage) Name added in v0.12.0

func (page *PeerPage) Name() string

func (*PeerPage) Root added in v0.12.0

func (page *PeerPage) Root() gtk.Widgetter

func (*PeerPage) Update added in v0.12.0

func (page *PeerPage) Update(a *App, peer *ipnstate.PeerStatus, status tsutil.Status)

type PreferencesWindow

type PreferencesWindow struct {
	*adw.PreferencesWindow `gtk:"PreferencesWindow"`

	UseTrayIconRow            *adw.SwitchRow
	PollingIntervalRow        *adw.SpinRow
	PollingIntervalAdjustment *gtk.Adjustment
}

func NewPreferencesWindow

func NewPreferencesWindow() *PreferencesWindow

type Prompt

type Prompt struct {
	Heading   string
	Body      string
	Responses []PromptResponse
}

func (Prompt) Show

func (d Prompt) Show(a *App, initialValue string, res func(response, val string))

type PromptResponse added in v0.13.0

type PromptResponse struct {
	ID         string
	Label      string
	Appearance adw.ResponseAppearance
	Default    bool
}

type SelfPage added in v0.12.0

type SelfPage struct {
	*adw.StatusPage `gtk:"Page"`

	IPList               *gtk.ListBox
	OptionsGroup         *adw.PreferencesGroup
	AdvertiseExitNodeRow *adw.SwitchRow
	AllowLANAccessRow    *adw.SwitchRow
	AcceptRoutesRow      *adw.SwitchRow
	AdvertisedRoutesList *gtk.ListBox
	AdvertiseRouteButton *gtk.Button
	NetCheckGroup        *adw.PreferencesGroup
	NetCheckButton       *gtk.Button
	LastNetCheckRow      *adw.ActionRow
	LastNetCheck         *gtk.Label
	UDPRow               *adw.ActionRow
	UDP                  *gtk.Image
	IPv4Row              *adw.ActionRow
	IPv4Icon             *gtk.Image
	IPv4Addr             *gtk.Label
	IPv6Row              *adw.ActionRow
	IPv6Icon             *gtk.Image
	IPv6Addr             *gtk.Label
	UPnPRow              *adw.ActionRow
	UPnP                 *gtk.Image
	PMPRow               *adw.ActionRow
	PMP                  *gtk.Image
	PCPRow               *adw.ActionRow
	PCP                  *gtk.Image
	CaptivePortalRow     *adw.ActionRow
	CaptivePortal        *gtk.Image
	PreferredDERPRow     *adw.ActionRow
	PreferredDERP        *gtk.Label
	DERPLatencies        *adw.ExpanderRow
	FilesList            *gtk.ListBox
	// contains filtered or unexported fields
}

func NewSelfPage added in v0.12.0

func NewSelfPage(a *App, peer *ipnstate.PeerStatus, status tsutil.Status) *SelfPage

func (*SelfPage) ID added in v0.12.0

func (page *SelfPage) ID() string

func (*SelfPage) Name added in v0.12.0

func (page *SelfPage) Name() string

func (*SelfPage) Root added in v0.12.0

func (page *SelfPage) Root() gtk.Widgetter

func (*SelfPage) Update added in v0.12.0

func (page *SelfPage) Update(a *App, peer *ipnstate.PeerStatus, status tsutil.Status)

Jump to

Keyboard shortcuts

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