confgui

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Overview

Package confgui is a configuration window for Cairo-Dock.

Using GTK 3.10 to 3.20 library https://github.com/gotk3/gotk3

If you use GTK 3.10, you will have to add a flag to compile it:

go get -tags gtk_3_10 github.com/gotk3/gotk3/gtk

GUI XML files are compressed with github.com/jteeuwen/go-bindata

Index

Constants

View Source
const (
	WindowTitle  = "Cairo-Dock Config"
	WindowClass  = "cdc"
	WindowWidth  = 900
	WindowHeight = 600
)

Window settings.

View Source
const (
	GroupIcons  = "Icons"
	GroupAdd    = "Add"
	GroupConfig = "Config"
)

Main config groups.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clearer

type Clearer interface {
	Saver
	Selecter
	Clear() string
}

Clearer defines the interface to clear the data of a config page.

type GuiConfigure

type GuiConfigure struct {
	gtk.Box

	datatype.Source // embeds the data source.

	Menu *confmenu.MenuBar // GUI menu widget.

	OnQuit func() // On clicked Quit callback.
	// contains filtered or unexported fields
}

GuiConfigure defines the main Cairo-Dock configuration widget.

func NewWidget

func NewWidget(source datatype.Source, log cdtype.Logger) *GuiConfigure

NewWidget creates the main Cairo-Dock configuration widget.

func NewWindow

func NewWindow(data datatype.Source, log cdtype.Logger) (*GuiConfigure, error)

NewWindow creates a new config window with its widget, ready to use.

func (*GuiConfigure) AddPage

func (widget *GuiConfigure) AddPage(name, iconName string, saver Saver, btn btnaction.Tune, onShow, onHide func())

AddPage adds a tab to the main config switcher with its widget.

func (*GuiConfigure) ClickedQuit

func (widget *GuiConfigure) ClickedQuit()

ClickedQuit launches the OnQuit event defined. The OnQuit action is delayed to the next glib iteration to let GTK finish its current action (like closing a menu before the close window).

func (*GuiConfigure) ClickedSave

func (widget *GuiConfigure) ClickedSave()

ClickedSave forwards the save event to the current widget.

func (*GuiConfigure) GetWindow

func (widget *GuiConfigure) GetWindow() cftype.WinLike

GetWindow returns the pointer to the parent window.

func (*GuiConfigure) Load

func (widget *GuiConfigure) Load()

Load loads all pages data.

func (*GuiConfigure) OnSelectPage

func (widget *GuiConfigure) OnSelectPage(page string)

OnSelectPage reacts when the page is changed to set the button state and trigger OnHide and OnShow additional callbacks.

func (*GuiConfigure) ReloadItems

func (widget *GuiConfigure) ReloadItems()

ReloadItems refreshes the icons page list (clear and reselect, or select cached).

func (*GuiConfigure) Select

func (widget *GuiConfigure) Select(page string, item ...string) bool

Select selects the given group page and may also select a specific item in the page.

func (*GuiConfigure) SelectIcons

func (widget *GuiConfigure) SelectIcons(item string)

SelectIcons selects a specific icon in the Icons page (key = full path to config file). If the icon isn't found, the name is cached for the late ReloadItems callback.

func (*GuiConfigure) SetWindow

func (widget *GuiConfigure) SetWindow(win *gtk.Window)

SetWindow sets the pointer to the parent window, used for some config callbacks (grab events).

func (*GuiConfigure) UpdateDeskletParams

func (widget *GuiConfigure) UpdateDeskletParams(icon datatype.Iconer)

UpdateDeskletParams updates applet desklet settings if it's loaded.

func (*GuiConfigure) UpdateDeskletVisibility

func (widget *GuiConfigure) UpdateDeskletVisibility(icon datatype.Iconer)

UpdateDeskletVisibility updates applet desklet settings if it's loaded.

func (*GuiConfigure) UpdateModuleState

func (widget *GuiConfigure) UpdateModuleState(name string, active bool)

UpdateModuleState updates the state of the given applet.

func (*GuiConfigure) UpdateModulesList

func (widget *GuiConfigure) UpdateModulesList()

UpdateModulesList updates listed references of applets.

func (*GuiConfigure) UpdateShortkeys

func (widget *GuiConfigure) UpdateShortkeys()

UpdateShortkeys updates the shortkeys widget.

type Page

type Page struct {
	Widget Saver
	OnShow func()
	OnHide func()
	// contains filtered or unexported fields
}

Page defines a switcher page.

type Saver

type Saver interface {
	gtk.IWidget
	Load()
	Save()
}

Saver extends the Widget interface with a Save action.

type Selecter

type Selecter interface {
	Select(string) bool
}

Selecter defines the interface to select an item in the config page.

type ShowWelcomer

type ShowWelcomer interface {
	ShowWelcome(setBtn bool)
}

ShowWelcomer defines the optional interface to show a placeholder page.

type UpdateDeskletParamser

type UpdateDeskletParamser interface {
	UpdateDeskletParams(icon datatype.Iconer)
}

UpdateDeskletParamser defines the interface to update shortkeys of a config page.

type UpdateDeskletVisibilityer

type UpdateDeskletVisibilityer interface {
	UpdateDeskletVisibility(icon datatype.Iconer)
}

UpdateDeskletVisibilityer defines the interface to update shortkeys of a config page.

type UpdateShortkeyser

type UpdateShortkeyser interface {
	UpdateShortkeys()
}

UpdateShortkeyser defines the interface to update shortkeys of a config page.

Directories

Path Synopsis
Package btnaction provides a button with different actions texts.
Package btnaction provides a button with different actions texts.

Jump to

Keyboard shortcuts

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