cfwidget

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

Documentation

Overview

Package cfwidget implements key widgets for the config file builder.

Index

Constants

View Source
const (
	RowKey = iota
	RowName
	RowIcon
	RowDesc
)

Rows defines liststore rows. Must match the ListStore declaration type and order.

Variables

View Source
var Types = map[cftype.KeyType]func(key *cftype.Key){
	cftype.KeyTextLabel: Text,
	cftype.KeyLink:      Link,
	cftype.KeySeparator: Separator,
	cftype.KeyFrame:     Frame,
	cftype.KeyExpander:  Frame,

	cftype.KeyBoolButton:        CheckButton,
	cftype.KeyBoolCtrl:          CheckButton,
	cftype.KeyIntSpin:           IntegerSpin,
	cftype.KeyIntScale:          IntegerScale,
	cftype.KeyIntSize:           IntegerSize,
	cftype.KeyFloatSpin:         Float,
	cftype.KeyFloatScale:        Float,
	cftype.KeyColorSelectorRGB:  ColorSelector,
	cftype.KeyColorSelectorRGBA: ColorSelector,
	cftype.KeyFontSelector:      FontSelector,

	cftype.KeyStringEntry:      Strings,
	cftype.KeyPasswordEntry:    Strings,
	cftype.KeyFileSelector:     Strings,
	cftype.KeyFolderSelector:   Strings,
	cftype.KeySoundSelector:    Strings,
	cftype.KeyShortkeySelector: Strings,
	cftype.KeyClassSelector:    Strings,
	cftype.KeyImageSelector:    Strings,

	cftype.KeyListSimple:       Lists,
	cftype.KeyListEntry:        Lists,
	cftype.KeyListNumbered:     Lists,
	cftype.KeyListNbCtrlSimple: Lists,
	cftype.KeyListNbCtrlSelect: Lists,

	cftype.KeyTreeViewSortSimple:  TreeView,
	cftype.KeyTreeViewSortModify:  TreeView,
	cftype.KeyTreeViewMultiChoice: TreeView,

	cftype.KeyLaunchCmdSimple: LaunchCommand,
	cftype.KeyLaunchCmdIf:     LaunchCommand,

	cftype.KeyEmptyWidget: Nil,
	cftype.KeyEmptyFull:   Nil,

	cftype.KeyListThemeApplet: ListThemeApplet,
	cftype.KeyListDocks:       ListDock,
	cftype.KeyListViews:       ListView,

	cftype.KeyListThemeDesktopIcon: ListThemeDesktopIcon,

	cftype.KeyListAnimation:          ListAnimation,
	cftype.KeyListDialogDecorator:    ListDialogDecorator,
	cftype.KeyListDeskletDecoSimple:  ListDeskletDecoration,
	cftype.KeyListDeskletDecoDefault: ListDeskletDecoration,
	cftype.KeyListIconsMainDock:      ListIconsMainDock,
	cftype.KeyListScreens:            ListScreens,

	cftype.KeyHandbook: Handbook,
}

Types defines widget build methods by key type.

Functions

func CheckButton

func CheckButton(key *cftype.Key)

CheckButton adds a check button widget.

func ColorSelector

func ColorSelector(key *cftype.Key)

ColorSelector adds a color selector widget.

func Float

func Float(key *cftype.Key)

Float adds a float selector widget. SpinButton or Horizontal Scale

func FontSelector

func FontSelector(key *cftype.Key)

FontSelector adds a font selector widget.

func Frame

func Frame(key *cftype.Key)

Frame adds a simple or expanded frame widget.

func Handbook

func Handbook(key *cftype.Key)

Handbook adds a handbook widget to show basic applet informations.

func IntegerScale

func IntegerScale(key *cftype.Key)

IntegerScale adds an integer scale widget.

func IntegerSize

func IntegerSize(key *cftype.Key)

IntegerSize adds an integer selector widget.

func IntegerSpin

func IntegerSpin(key *cftype.Key)

IntegerSpin adds an integer scale widget.

func JumpToModule

func JumpToModule(key *cftype.Key)

JumpToModule adds a redirect button widget. USED?

func LaunchCommand

func LaunchCommand(key *cftype.Key)

LaunchCommand adds a launch command widget. HELP ONLY

func Link(key *cftype.Key)

Link adds a link widget.

func ListAnimation

func ListAnimation(key *cftype.Key)

ListAnimation adds an animation list widget.

func ListDeskletDecoration

func ListDeskletDecoration(key *cftype.Key)

ListDeskletDecoration adds a desklet decoration list widget.

func ListDialogDecorator

func ListDialogDecorator(key *cftype.Key)

ListDialogDecorator adds an dialog decorator list widget.

func ListDock

func ListDock(key *cftype.Key)

ListDock adds a dock list widget.

func ListIconsMainDock

func ListIconsMainDock(key *cftype.Key)

ListIconsMainDock adds an icon list widget.

func ListScreens

func ListScreens(key *cftype.Key)

ListScreens adds a screen selection widget.

func ListThemeApplet

func ListThemeApplet(key *cftype.Key)

ListThemeApplet adds an theme list widget.

func ListThemeDesktopIcon

func ListThemeDesktopIcon(key *cftype.Key)

ListThemeDesktopIcon adds a desktop icon-themes list widget.

func ListView

func ListView(key *cftype.Key)

ListView adds a view list widget.

func Lists

func Lists(key *cftype.Key)

Lists adds a string list widget.

func MainCSS

func MainCSS() *gtk.CssProvider

MainCSS provides a common css for widgets.

func Maker

func Maker(key *cftype.Key) func()

Maker returns the make widget call for the key type.

func NewComboBox

func NewComboBox(key *cftype.Key, withEntry, numbered bool, current string, list []datatype.Field) (
	widget *gtk.ComboBox, model *gtk.ListStore, getValue func() interface{}, setValue func(interface{}))

NewComboBox creates a combo box.

func NewComboBoxWithModel

func NewComboBoxWithModel(model *gtk.ListStore, log cdtype.Logger, bAddPreviewWidgets, bWithEntry, bHorizontalPackaging bool) (
	widget *gtk.ComboBox, getValue func() interface{})

NewComboBoxWithModel adds a combo box with the given model (can be nil).

_add_combo_from_modele used do/while. find why

func Nil

func Nil(key *cftype.Key)

Nil defines a nil widget builder.

func PackComboBoxWithIndexHandbooker

func PackComboBoxWithIndexHandbooker(key *cftype.Key, index map[string]datatype.Handbooker)

PackComboBoxWithIndexHandbooker creates a combo box filled with the getList call.

func PackComboBoxWithListField

func PackComboBoxWithListField(key *cftype.Key, withEntry, numbered bool, getList func() []datatype.Field) *gtk.ComboBox

PackComboBoxWithListField creates a combo box filled with the getList call.

func PackReset

func PackReset(key *cftype.Key, value interface{}) *gtk.Button

PackReset adds a reset value button.

func PackValuerAsInt

func PackValuerAsInt(key *cftype.Key, w gtk.IWidget, valuer WidgetValuer, value int)

PackValuerAsInt packs a valuer widget with its reset button (to given value). Values are get and set as int.

func Separator

func Separator(key *cftype.Key)

Separator adds a simple horizontal separator.

func Strings

func Strings(key *cftype.Key)

Strings adds a string widget. Many options included. TODO: G_USER_DIRECTORY_PICTURES.

func Text

func Text(key *cftype.Key)

Text just enlarges the widget label (nothing more intended).

func TreeView

func TreeView(key *cftype.Key)

TreeView adds a treeview widget.

func WrapKeyScale

func WrapKeyScale(key *cftype.Key, child *gtk.Scale) gtk.IWidget

WrapKeyScale wraps a key scale with its information labels if needed (enough values).

(was _pack_hscale).

Types

type WidgetValuer

type WidgetValuer interface {
	GetValue() float64
	SetValue(float64)
}

WidgetValuer defines a widget with GetValue and SetValue methods.

Jump to

Keyboard shortcuts

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