handy

package module
v0.0.0-...-387ad28 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: LGPL-2.1 Imports: 10 Imported by: 1

README

handy

A Golang binding for libhandy-1.

Some parts of this library are uncovered or may contain bugs (mainly leaks) as this binding is generated without complete testing (TODO).

Missing

Avatar.GetLoadableIcon
TabBar.GetExtraDragDestTargets

Regenerating

go generate && go build

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EaseOutCubic

func EaseOutCubic(t float64) float64

EaseOutCubic computes the ease out for t.

func EnumValueRowName

func EnumValueRowName(value *EnumValueObject) string

EnumValueRowName is a default implementation of ComboRowGetEnumValueNameFunc to be used with (*ComboRow).SetForEnum(). If the enumeration has a nickname, it will return it, otherwise it will return its name.

func GetEnableAnimations

func GetEnableAnimations(widget gtk.IWidget) bool

GetEnableAnimations returns whether animations are enabled for that widget. This should be used when implementing an animated widget to know whether to animate it or not.

func Init

func Init()

Init call this function just after initializing GTK, if you are using Application it means it must be called when the #GApplication::startup signal is emitted. If libhandy has already been initialized, the function will simply return.

This makes sure translations, types, themes, and icons for the Handy library are set up properly.

Types

type ActionRow

type ActionRow struct {
	PreferencesRow

	// Interfaces
	gtk.Actionable
}

func ActionRowNew

func ActionRowNew() *ActionRow

ActionRowNew creates a new ActionRow.

func (*ActionRow) Activate

func (a *ActionRow) Activate()

func (*ActionRow) AddPrefix

func (a *ActionRow) AddPrefix(widget gtk.IWidget)

AddPrefix adds a prefix widget to a.

func (*ActionRow) GetActivatableWidget

func (a *ActionRow) GetActivatableWidget() gtk.IWidget

GetActivatableWidget gets the widget activated when a is activated.

func (*ActionRow) GetIconName

func (a *ActionRow) GetIconName() string

GetIconName gets the icon name for a.

func (*ActionRow) GetSubtitle

func (a *ActionRow) GetSubtitle() string

GetSubtitle gets the subtitle for a.

func (*ActionRow) GetSubtitleLines

func (a *ActionRow) GetSubtitleLines() int

GetSubtitleLines gets the number of lines at the end of which the subtitle label will be ellipsized. If the value is 0, the number of lines won't be limited.

func (*ActionRow) GetTitleLines

func (a *ActionRow) GetTitleLines() int

GetTitleLines gets the number of lines at the end of which the title label will be ellipsized. If the value is 0, the number of lines won't be limited.

func (*ActionRow) GetUseUnderline

func (a *ActionRow) GetUseUnderline() bool

GetUseUnderline gets whether an embedded underline in the text of the title and subtitle labels indicates a mnemonic. See (*ActionRow).SetUseUnderline().

func (*ActionRow) SetActivatableWidget

func (a *ActionRow) SetActivatableWidget(widget gtk.IWidget)

SetActivatableWidget sets the widget to activate when a is activated, either by clicking on it, by calling (*ActionRow).Activate(), or via mnemonics in the title or the subtitle. See the “use_underline” property to enable mnemonics.

The target widget will be activated by emitting the GtkWidget::mnemonic-activate signal on it.

func (*ActionRow) SetIconName

func (a *ActionRow) SetIconName(iconName string)

SetIconName sets the icon name for a.

func (*ActionRow) SetSubtitle

func (a *ActionRow) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle for a.

func (*ActionRow) SetSubtitleLines

func (a *ActionRow) SetSubtitleLines(subtitleLines int)

SetSubtitleLines sets the number of lines at the end of which the subtitle label will be ellipsized. If the value is 0, the number of lines won't be limited.

func (*ActionRow) SetTitleLines

func (a *ActionRow) SetTitleLines(titleLines int)

SetTitleLines sets the number of lines at the end of which the title label will be ellipsized. If the value is 0, the number of lines won't be limited.

func (*ActionRow) SetUseUnderline

func (a *ActionRow) SetUseUnderline(useUnderline bool)

SetUseUnderline if true, an underline in the text of the title and subtitle labels indicates the next character should be used for the mnemonic accelerator key.

type ApplicationWindow

type ApplicationWindow struct {
	gtk.ApplicationWindow

	// Interfaces
	glib.ActionGroup
	glib.ActionMap
}

func ApplicationWindowNew

func ApplicationWindowNew() *ApplicationWindow

ApplicationWindowNew creates a new ApplicationWindow.

type Avatar

type Avatar struct {
	gtk.DrawingArea
}

func AvatarNew

func AvatarNew(size int, text string, showInitials bool) *Avatar

AvatarNew creates a new Avatar.

func (*Avatar) DrawToPixbuf

func (a *Avatar) DrawToPixbuf(size int, scaleFactor int) *gdk.Pixbuf

DrawToPixbuf renders a into a pixbuf at size and scale_factor. This can be used to export the fallback avatar.

func (*Avatar) GetIconName

func (a *Avatar) GetIconName() string

GetIconName gets the name of the icon in the icon theme to use when the icon should be displayed.

func (*Avatar) GetShowInitials

func (a *Avatar) GetShowInitials() bool

GetShowInitials returns whether initials are used for the fallback or the icon.

func (*Avatar) GetSize

func (a *Avatar) GetSize() int

GetSize returns the size of the avatar.

func (*Avatar) GetText

func (a *Avatar) GetText() string

GetText get the text used to generate the fallback initials and color

func (*Avatar) SetIconName

func (a *Avatar) SetIconName(iconName string)

SetIconName sets the name of the icon in the icon theme to use when the icon should be displayed. If no name is set, the avatar-default-symbolic icon will be used. If the name doesn't match a valid icon, it is an error and no icon will be displayed. If the icon theme is changed, the image will be updated automatically.

func (*Avatar) SetImageLoadFunc

func (a *Avatar) SetImageLoadFunc(loadImage AvatarImageLoadFunc)

SetImageLoadFunc a callback which is called when the custom image need to be reloaded for some reason (e.g. scale-factor changes).

This method is deprecated since version 1.2.

func (*Avatar) SetShowInitials

func (a *Avatar) SetShowInitials(showInitials bool)

SetShowInitials sets whether the initials should be shown on the fallback avatar or the icon.

func (*Avatar) SetSize

func (a *Avatar) SetSize(size int)

SetSize sets the size of the avatar.

func (*Avatar) SetText

func (a *Avatar) SetText(text string)

SetText set the text used to generate the fallback initials color

type AvatarImageLoadFunc

type AvatarImageLoadFunc func(size int) *gdk.Pixbuf

AvatarImageLoadFunc the returned Pixbuf is expected to be square with width and height set to size. The image is cropped to a circle without any scaling or transformation.

type Carousel struct {
	gtk.EventBox

	// Interfaces
	gtk.Orientable
	Swiper
}

func CarouselNew

func CarouselNew() *Carousel

CarouselNew create a new Carousel widget.

func (*Carousel) GetAllowLongSwipes

func (c *Carousel) GetAllowLongSwipes() bool

GetAllowLongSwipes whether to allow swiping for more than one page at a time. If the value is false, each swipe can only move to the adjacent pages.

func (*Carousel) GetAllowMouseDrag

func (c *Carousel) GetAllowMouseDrag() bool

GetAllowMouseDrag sets whether c can be dragged with mouse pointer

func (*Carousel) GetAnimationDuration

func (c *Carousel) GetAnimationDuration() uint

GetAnimationDuration gets animation duration used by (*Carousel).ScrollTo().

func (*Carousel) GetInteractive

func (c *Carousel) GetInteractive() bool

GetInteractive gets whether c can be navigated.

func (*Carousel) GetNPages

func (c *Carousel) GetNPages() uint

GetNPages gets the number of pages in c.

func (*Carousel) GetPosition

func (c *Carousel) GetPosition() float64

GetPosition gets current scroll position in c. It's unitless, 1 matches 1 page.

func (*Carousel) GetRevealDuration

func (c *Carousel) GetRevealDuration() uint

GetRevealDuration gets duration of the animation used when adding or removing pages in milliseconds.

func (*Carousel) GetSpacing

func (c *Carousel) GetSpacing() uint

GetSpacing gets spacing between pages in pixels.

func (*Carousel) Insert

func (c *Carousel) Insert(child gtk.IWidget, position int)

Insert inserts child into c at position position.

If position is -1, or larger than the number of pages, child will be appended to the end.

func (*Carousel) Prepend

func (c *Carousel) Prepend(child gtk.IWidget)

Prepend prepends child to c

func (*Carousel) Reorder

func (c *Carousel) Reorder(child gtk.IWidget, position int)

Reorder moves child into position position.

If position is -1, or larger than the number of pages, child will be moved to the end.

func (*Carousel) ScrollTo

func (c *Carousel) ScrollTo(widget gtk.IWidget)

ScrollTo scrolls to widget position with an animation. Carousel:animation-duration property can be used for controlling the duration.

func (*Carousel) ScrollToFull

func (c *Carousel) ScrollToFull(widget gtk.IWidget, duration int64)

ScrollToFull scrolls to widget position with an animation.

func (*Carousel) SetAllowLongSwipes

func (c *Carousel) SetAllowLongSwipes(allowLongSwipes bool)

SetAllowLongSwipes sets whether to allow swiping for more than one page at a time. If the value is false, each swipe can only move to the adjacent pages.

func (*Carousel) SetAllowMouseDrag

func (c *Carousel) SetAllowMouseDrag(allowMouseDrag bool)

SetAllowMouseDrag sets whether c can be dragged with mouse pointer. If allow_mouse_drag is false, dragging is only available on touch.

func (*Carousel) SetAnimationDuration

func (c *Carousel) SetAnimationDuration(duration uint)

SetAnimationDuration sets animation duration used by (*Carousel).ScrollTo().

func (*Carousel) SetInteractive

func (c *Carousel) SetInteractive(interactive bool)

SetInteractive sets whether c can be navigated. This can be used to temporarily disable a Carousel to only allow swiping in a certain state.

func (*Carousel) SetRevealDuration

func (c *Carousel) SetRevealDuration(revealDuration uint)

SetRevealDuration sets duration of the animation used when adding or removing pages in milliseconds.

func (*Carousel) SetSpacing

func (c *Carousel) SetSpacing(spacing uint)

SetSpacing sets spacing between pages in pixels.

type CarouselIndicatorDots

type CarouselIndicatorDots struct {
	gtk.DrawingArea

	// Interfaces
	gtk.Orientable
}

func CarouselIndicatorDotsNew

func CarouselIndicatorDotsNew() *CarouselIndicatorDots

CarouselIndicatorDotsNew create a new CarouselIndicatorDots widget.

func (*CarouselIndicatorDots) GetCarousel

func (c *CarouselIndicatorDots) GetCarousel() *Carousel

GetCarousel get the Carousel the indicator uses.

See: (*CarouselIndicatorDots).SetCarousel()

func (*CarouselIndicatorDots) SetCarousel

func (c *CarouselIndicatorDots) SetCarousel(carousel *Carousel)

SetCarousel sets the Carousel to use.

type CarouselIndicatorLines

type CarouselIndicatorLines struct {
	gtk.DrawingArea

	// Interfaces
	gtk.Orientable
}

func CarouselIndicatorLinesNew

func CarouselIndicatorLinesNew() *CarouselIndicatorLines

CarouselIndicatorLinesNew create a new CarouselIndicatorLines widget.

func (*CarouselIndicatorLines) GetCarousel

func (c *CarouselIndicatorLines) GetCarousel() *Carousel

GetCarousel get the Carousel the indicator uses.

See: (*CarouselIndicatorLines).SetCarousel()

func (*CarouselIndicatorLines) SetCarousel

func (c *CarouselIndicatorLines) SetCarousel(carousel *Carousel)

SetCarousel sets the Carousel to use.

type Caster

type Caster interface {
	Cast() (gtk.IWidget, error)
	// contains filtered or unexported methods
}

Caster is the interface that allows casting objects to widgets.

type CenteringPolicy

type CenteringPolicy int
const (
	// CenteringPolicyLoose keep the title centered when possible
	CenteringPolicyLoose CenteringPolicy = 0
	// CenteringPolicyStrict keep the title centered at all cost
	CenteringPolicyStrict CenteringPolicy = 1
)

type Clamp

type Clamp struct {
	gtk.Bin

	// Interfaces
	gtk.Orientable
}

func ClampNew

func ClampNew() *Clamp

ClampNew creates a new Clamp.

func (*Clamp) GetMaximumSize

func (c *Clamp) GetMaximumSize() int

GetMaximumSize gets the maximum size to allocate to the contained child. It is the width if c is horizontal, or the height if it is vertical.

func (*Clamp) GetTighteningThreshold

func (c *Clamp) GetTighteningThreshold() int

GetTighteningThreshold gets the size starting from which the clamp will tighten its grip on the child.

func (*Clamp) SetMaximumSize

func (c *Clamp) SetMaximumSize(maximumSize int)

SetMaximumSize sets the maximum size to allocate to the contained child. It is the width if c is horizontal, or the height if it is vertical.

func (*Clamp) SetTighteningThreshold

func (c *Clamp) SetTighteningThreshold(tighteningThreshold int)

SetTighteningThreshold sets the size starting from which the clamp will tighten its grip on the child.

type ComboRow

type ComboRow struct {
	ActionRow

	// Interfaces
	gtk.Actionable
}

func ComboRowNew

func ComboRowNew() *ComboRow

ComboRowNew creates a new ComboRow.

func (*ComboRow) BindModel

func (c *ComboRow) BindModel(model *glib.ListModel)

BindModel binds model to c.

If c was already bound to a model, that previous binding is destroyed.

The contents of c are cleared and then filled with widgets that represent items from model. c is updated whenever model changes. If model is nil, c is left empty.

func (*ComboRow) BindNameModel

func (c *ComboRow) BindNameModel(model *glib.ListModel, getNameFunc ComboRowGetNameFunc)

BindNameModel binds model to c.

If c was already bound to a model, that previous binding is destroyed.

The contents of c are cleared and then filled with widgets that represent items from model. c is updated whenever model changes. If model is nil, c is left empty.

This is more convenient to use than (*ComboRow).BindModel() if you want to represent items of the model with names.

func (*ComboRow) GetModel

func (c *ComboRow) GetModel() *glib.ListModel

GetModel gets the model bound to c, or nil if none is bound.

func (*ComboRow) GetSelectedIndex

func (c *ComboRow) GetSelectedIndex() int

GetSelectedIndex gets the index of the selected item in its Model.

func (*ComboRow) GetUseSubtitle

func (c *ComboRow) GetUseSubtitle() bool

GetUseSubtitle gets whether the current value of c should be displayed as its subtitle.

func (*ComboRow) SetForEnum

func (c *ComboRow) SetForEnum(enumType glib.Type, getNameFunc ComboRowGetEnumValueNameFunc)

SetForEnum creates a model for enum_type and binds it to c. The items of the model will be EnumValueObject objects.

If c was already bound to a model, that previous binding is destroyed.

The contents of c are cleared and then filled with widgets that represent items from model. c is updated whenever model changes. If model is nil, c is left empty.

This is more convenient to use than (*ComboRow).BindNameModel() if you want to represent values of an enumeration with names.

See EnumValueRowName().

func (*ComboRow) SetGetNameFunc

func (c *ComboRow) SetGetNameFunc(getNameFunc ComboRowGetNameFunc)

SetGetNameFunc sets a closure to convert items into names. See HdyComboRow:use-subtitle.

func (*ComboRow) SetSelectedIndex

func (c *ComboRow) SetSelectedIndex(selectedIndex int)

SetSelectedIndex sets the index of the selected item in its Model.

func (*ComboRow) SetUseSubtitle

func (c *ComboRow) SetUseSubtitle(useSubtitle bool)

SetUseSubtitle sets whether the current value of c should be displayed as its subtitle.

If true, you should not access HdyActionRow:subtitle.

type ComboRowGetEnumValueNameFunc

type ComboRowGetEnumValueNameFunc func(value *EnumValueObject) string

ComboRowGetEnumValueNameFunc called for combo rows that are bound to an enumeration with (*ComboRow).SetForEnum() for each value from that enumeration.

type ComboRowGetNameFunc

type ComboRowGetNameFunc func(item *glib.Object) string

ComboRowGetNameFunc called for combo rows that are bound to a Model with (*ComboRow).BindNameModel() for each item that gets added to the model.

type Deck

type Deck struct {
	gtk.Container

	// Interfaces
	gtk.Orientable
	Swiper
}

func DeckNew

func DeckNew() *Deck

DeckNew creates a new Deck.

func (*Deck) GetAdjacentChild

func (d *Deck) GetAdjacentChild(direction NavigationDirection) gtk.IWidget

GetAdjacentChild gets the previous or next child, or nil if it doesn't exist. This will be the same widget (*Deck).Navigate() will navigate to.

func (*Deck) GetCanSwipeBack

func (d *Deck) GetCanSwipeBack() bool

GetCanSwipeBack returns whether the Deck allows swiping to the previous child.

func (*Deck) GetCanSwipeForward

func (d *Deck) GetCanSwipeForward() bool

GetCanSwipeForward returns whether the Deck allows swiping to the next child.

func (*Deck) GetChildByName

func (d *Deck) GetChildByName(name string) gtk.IWidget

GetChildByName finds the child of d with the name given as the argument. Returns nil if there is no child with this name.

func (*Deck) GetHomogeneous

func (d *Deck) GetHomogeneous(orientation gtk.Orientation) bool

GetHomogeneous gets whether d is homogeneous for the given orientation. See (*Deck).SetHomogeneous().

func (*Deck) GetInterpolateSize

func (d *Deck) GetInterpolateSize() bool

GetInterpolateSize returns whether the Deck is set up to interpolate between the sizes of children on page switch.

func (*Deck) GetTransitionDuration

func (d *Deck) GetTransitionDuration() uint

GetTransitionDuration returns the amount of time (in milliseconds) that transitions between children in d will take.

func (*Deck) GetTransitionRunning

func (d *Deck) GetTransitionRunning() bool

GetTransitionRunning returns whether d is currently in a transition from one page to another.

func (*Deck) GetTransitionType

func (d *Deck) GetTransitionType() DeckTransitionType

GetTransitionType gets the type of animation that will be used for transitions between children in d.

func (*Deck) GetVisibleChild

func (d *Deck) GetVisibleChild() gtk.IWidget

GetVisibleChild gets the visible child widget.

func (*Deck) GetVisibleChildName

func (d *Deck) GetVisibleChildName() string

GetVisibleChildName gets the name of the currently visible child widget.

func (*Deck) InsertChildAfter

func (d *Deck) InsertChildAfter(child gtk.IWidget, sibling gtk.IWidget)

InsertChildAfter inserts child in the position after sibling in the list of children. If sibling is nil, insert child at the first position.

func (*Deck) Navigate

func (d *Deck) Navigate(direction NavigationDirection) bool

Navigate switches to the previous or next child, similar to performing a swipe gesture to go in direction.

func (*Deck) Prepend

func (d *Deck) Prepend(child gtk.IWidget)

Prepend inserts child at the first position in d.

func (*Deck) ReorderChildAfter

func (d *Deck) ReorderChildAfter(child gtk.IWidget, sibling gtk.IWidget)

ReorderChildAfter moves child to the position after sibling in the list of children. If sibling is nil, move child to the first position.

func (*Deck) SetCanSwipeBack

func (d *Deck) SetCanSwipeBack(canSwipeBack bool)

SetCanSwipeBack sets whether or not d allows switching to the previous child via a swipe gesture.

func (*Deck) SetCanSwipeForward

func (d *Deck) SetCanSwipeForward(canSwipeForward bool)

SetCanSwipeForward sets whether or not d allows switching to the next child via a swipe gesture.

func (*Deck) SetHomogeneous

func (d *Deck) SetHomogeneous(orientation gtk.Orientation, homogeneous bool)

SetHomogeneous sets the Deck to be homogeneous or not for the given orientation. If it is homogeneous, the Deck will request the same width or height for all its children depending on the orientation. If it isn't, the deck may change width or height when a different child becomes visible.

func (*Deck) SetInterpolateSize

func (d *Deck) SetInterpolateSize(interpolateSize bool)

SetInterpolateSize sets whether or not d will interpolate its size when changing the visible child. If the Deck:interpolate-size property is set to true, d will interpolate its size between the current one and the one it'll take after changing the visible child, according to the set transition duration.

func (*Deck) SetTransitionDuration

func (d *Deck) SetTransitionDuration(duration uint)

SetTransitionDuration sets the duration that transitions between children in d will take.

func (*Deck) SetTransitionType

func (d *Deck) SetTransitionType(transition DeckTransitionType)

SetTransitionType sets the type of animation that will be used for transitions between children in d.

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the child that is about to become current.

func (*Deck) SetVisibleChild

func (d *Deck) SetVisibleChild(visibleChild gtk.IWidget)

SetVisibleChild makes visible_child visible using a transition determined by HdyDeck:transition-type and HdyDeck:transition-duration. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

func (*Deck) SetVisibleChildName

func (d *Deck) SetVisibleChildName(name string)

SetVisibleChildName makes the child with the name name visible.

See (*Deck).SetVisibleChild() for more details.

type DeckTransitionType

type DeckTransitionType int

DeckTransitionType enumeration value describes the possible transitions between children in a Deck widget.

New values may be added to this enumeration over time.

const (
	// DeckTransitionTypeOver cover the old page or uncover the new page,
	// sliding from or towards the end according to orientation, text direction
	// and children order
	DeckTransitionTypeOver DeckTransitionType = 0
	// DeckTransitionTypeUnder uncover the new page or cover the old page,
	// sliding from or towards the start according to orientation, text
	// direction and children order
	DeckTransitionTypeUnder DeckTransitionType = 1
	// DeckTransitionTypeSlide slide from left, right, up or down according to
	// the orientation, text direction and the children order
	DeckTransitionTypeSlide DeckTransitionType = 2
)

type EnumValueObject

type EnumValueObject struct {
	*glib.Object
}

func (*EnumValueObject) GetName

func (e *EnumValueObject) GetName() string

func (*EnumValueObject) GetNick

func (e *EnumValueObject) GetNick() string

func (*EnumValueObject) GetValue

func (e *EnumValueObject) GetValue() int

type ExpanderRow

type ExpanderRow struct {
	PreferencesRow

	// Interfaces
	gtk.Actionable
}

func ExpanderRowNew

func ExpanderRowNew() *ExpanderRow

ExpanderRowNew creates a new ExpanderRow.

func (*ExpanderRow) AddAction

func (e *ExpanderRow) AddAction(widget gtk.IWidget)

AddAction adds an action widget to e.

func (*ExpanderRow) AddPrefix

func (e *ExpanderRow) AddPrefix(widget gtk.IWidget)

AddPrefix adds a prefix widget to e.

func (*ExpanderRow) GetEnableExpansion

func (e *ExpanderRow) GetEnableExpansion() bool

GetEnableExpansion gets whether the expansion of e is enabled.

func (*ExpanderRow) GetExpanded

func (e *ExpanderRow) GetExpanded() bool

func (*ExpanderRow) GetIconName

func (e *ExpanderRow) GetIconName() string

GetIconName gets the icon name for e.

func (*ExpanderRow) GetShowEnableSwitch

func (e *ExpanderRow) GetShowEnableSwitch() bool

GetShowEnableSwitch gets whether the switch enabling the expansion of e is visible.

func (*ExpanderRow) GetSubtitle

func (e *ExpanderRow) GetSubtitle() string

GetSubtitle gets the subtitle for e.

func (*ExpanderRow) GetUseUnderline

func (e *ExpanderRow) GetUseUnderline() bool

GetUseUnderline gets whether an embedded underline in the text of the title and subtitle labels indicates a mnemonic. See (*ExpanderRow).SetUseUnderline().

func (*ExpanderRow) SetEnableExpansion

func (e *ExpanderRow) SetEnableExpansion(enableExpansion bool)

SetEnableExpansion sets whether the expansion of e is enabled.

func (*ExpanderRow) SetExpanded

func (e *ExpanderRow) SetExpanded(expanded bool)

func (*ExpanderRow) SetIconName

func (e *ExpanderRow) SetIconName(iconName string)

SetIconName sets the icon name for e.

func (*ExpanderRow) SetShowEnableSwitch

func (e *ExpanderRow) SetShowEnableSwitch(showEnableSwitch bool)

SetShowEnableSwitch sets whether the switch enabling the expansion of e is visible.

func (*ExpanderRow) SetSubtitle

func (e *ExpanderRow) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle for e.

func (*ExpanderRow) SetUseUnderline

func (e *ExpanderRow) SetUseUnderline(useUnderline bool)

SetUseUnderline if true, an underline in the text of the title and subtitle labels indicates the next character should be used for the mnemonic accelerator key.

type Flap

type Flap struct {
	gtk.Container

	// Interfaces
	gtk.Orientable
	Swiper
}

func FlapNew

func FlapNew() *Flap

FlapNew creates a new Flap.

func (*Flap) GetContent

func (f *Flap) GetContent() gtk.IWidget

GetContent gets the content widget for f

func (*Flap) GetFlap

func (f *Flap) GetFlap() gtk.IWidget

GetFlap gets the flap widget for f

func (*Flap) GetFlapPosition

func (f *Flap) GetFlapPosition() gtk.PackType

GetFlapPosition gets the flap position for f.

func (*Flap) GetFoldDuration

func (f *Flap) GetFoldDuration() uint

GetFoldDuration returns the amount of time (in milliseconds) that fold transitions in f will take.

func (*Flap) GetFoldPolicy

func (f *Flap) GetFoldPolicy() FlapFoldPolicy

GetFoldPolicy gets the current fold policy of f. See (*Flap).SetFoldPolicy().

func (*Flap) GetFolded

func (f *Flap) GetFolded() bool

GetFolded gets whether f is currently folded.

See Flap:fold-policy.

func (*Flap) GetLocked

func (f *Flap) GetLocked() bool

GetLocked gets whether f is locked.

func (*Flap) GetModal

func (f *Flap) GetModal() bool

GetModal gets whether the f is modal. See (*Flap).SetModal().

func (*Flap) GetRevealDuration

func (f *Flap) GetRevealDuration() uint

GetRevealDuration returns the amount of time (in milliseconds) that reveal transitions in f will take.

func (*Flap) GetRevealFlap

func (f *Flap) GetRevealFlap() bool

GetRevealFlap gets whether the flap widget is revealed for f.

func (*Flap) GetRevealProgress

func (f *Flap) GetRevealProgress() float64

GetRevealProgress gets the current reveal transition progress for f. 0 means fully hidden, 1 means fully revealed. See Flap:reveal-flap.

func (*Flap) GetSeparator

func (f *Flap) GetSeparator() gtk.IWidget

GetSeparator gets the separator widget for f.

func (*Flap) GetSwipeToClose

func (f *Flap) GetSwipeToClose() bool

GetSwipeToClose gets whether f can be closed with a swipe gesture.

func (*Flap) GetSwipeToOpen

func (f *Flap) GetSwipeToOpen() bool

GetSwipeToOpen gets whether f can be opened with a swipe gesture.

func (*Flap) GetTransitionType

func (f *Flap) GetTransitionType() FlapTransitionType

GetTransitionType gets the type of animation that will be used for reveal and fold transitions in f.

func (*Flap) SetContent

func (f *Flap) SetContent(content gtk.IWidget)

SetContent sets the content widget for f, always displayed when unfolded, and partially visible when folded.

func (*Flap) SetFlap

func (f *Flap) SetFlap(flap gtk.IWidget)

SetFlap sets the flap widget for f, only visible when Flap:reveal-progress is greater than 0.

func (*Flap) SetFlapPosition

func (f *Flap) SetFlapPosition(position gtk.PackType)

SetFlapPosition sets the flap position for f. If GTK_PACK_START, the flap is displayed before the content, if GTK_PACK_END, it's displayed after the content.

func (*Flap) SetFoldDuration

func (f *Flap) SetFoldDuration(duration uint)

SetFoldDuration sets the duration that fold transitions in f will take.

func (*Flap) SetFoldPolicy

func (f *Flap) SetFoldPolicy(policy FlapFoldPolicy)

SetFoldPolicy sets the current fold policy for f. See FlapFoldPolicy for available policies.

func (*Flap) SetLocked

func (f *Flap) SetLocked(locked bool)

SetLocked sets whether f is locked.

If false, folding f when the flap is revealed automatically closes it, and unfolding it when the flap is not revealed opens it. If true, Flap:reveal-flap value never changes on its own.

func (*Flap) SetModal

func (f *Flap) SetModal(modal bool)

SetModal sets whether the f can be closed with a click.

If modal is true, clicking the content widget while flap is revealed, or pressing Escape key, will close the flap. If false, clicks are passed through to the content widget.

func (*Flap) SetRevealDuration

func (f *Flap) SetRevealDuration(duration uint)

SetRevealDuration sets the duration that reveal transitions in f will take.

func (*Flap) SetRevealFlap

func (f *Flap) SetRevealFlap(revealFlap bool)

SetRevealFlap sets whether the flap widget is revealed for f.

func (*Flap) SetSeparator

func (f *Flap) SetSeparator(separator gtk.IWidget)

SetSeparator sets the separator widget for f, displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the Flap:transition-type value. If nil, no separator will be used.

func (*Flap) SetSwipeToClose

func (f *Flap) SetSwipeToClose(swipeToClose bool)

SetSwipeToClose sets whether f can be closed with a swipe gesture.

The area that can be swiped depends on the Flap:transition-type value.

func (*Flap) SetSwipeToOpen

func (f *Flap) SetSwipeToOpen(swipeToOpen bool)

SetSwipeToOpen sets whether f can be opened with a swipe gesture.

The area that can be swiped depends on the Flap:transition-type value.

func (*Flap) SetTransitionType

func (f *Flap) SetTransitionType(transitionType FlapTransitionType)

SetTransitionType sets the type of animation that will be used for reveal and fold transitions in f.

Flap:flap is transparent by default, which means the content will be seen through it with HDY_FLAP_TRANSITION_TYPE_OVER transitions; add the .background style class to it if this is unwanted.

type FlapFoldPolicy

type FlapFoldPolicy int

FlapFoldPolicy these enumeration values describe the possible folding behavior in a Flap widget.

const (
	// FlapFoldPolicyNever disable folding, the flap cannot reach narrow
	// sizes.
	FlapFoldPolicyNever FlapFoldPolicy = 0
	// FlapFoldPolicyAlways keep the flap always folded.
	FlapFoldPolicyAlways FlapFoldPolicy = 1
	// FlapFoldPolicyAuto fold and unfold the flap based on available   space.
	FlapFoldPolicyAuto FlapFoldPolicy = 2
)

type FlapTransitionType

type FlapTransitionType int

FlapTransitionType these enumeration values describe the possible transitions between children in a Flap widget, as well as which areas can be swiped via Flap:swipe-to-open and Flap:swipe-to-close.

New values may be added to this enum over time.

const (
	// FlapTransitionTypeOver the flap slides over the content, which is
	// dimmed. When folded, only the flap can be swiped.
	FlapTransitionTypeOver FlapTransitionType = 0
	// FlapTransitionTypeUnder the content slides over the flap. Only the
	// content can be swiped.
	FlapTransitionTypeUnder FlapTransitionType = 1
	// FlapTransitionTypeSlide the flap slides offscreen when hidden,   neither
	// the flap nor content overlap each other. Both widgets can be   swiped.
	FlapTransitionTypeSlide FlapTransitionType = 2
)

type HeaderBar

type HeaderBar struct {
	gtk.Container
}

func HeaderBarNew

func HeaderBarNew() *HeaderBar

HeaderBarNew creates a new HeaderBar widget.

func (*HeaderBar) GetCenteringPolicy

func (h *HeaderBar) GetCenteringPolicy() CenteringPolicy

GetCenteringPolicy gets the policy h follows to horizontally align its center widget.

func (*HeaderBar) GetCustomTitle

func (h *HeaderBar) GetCustomTitle() gtk.IWidget

GetCustomTitle retrieves the custom title widget of the header. See (*HeaderBar).SetCustomTitle().

func (*HeaderBar) GetDecorationLayout

func (h *HeaderBar) GetDecorationLayout() string

GetDecorationLayout gets the decoration layout set with (*HeaderBar).SetDecorationLayout().

func (*HeaderBar) GetHasSubtitle

func (h *HeaderBar) GetHasSubtitle() bool

GetHasSubtitle retrieves whether the header bar reserves space for a subtitle, regardless if one is currently set or not.

func (*HeaderBar) GetInterpolateSize

func (h *HeaderBar) GetInterpolateSize() bool

GetInterpolateSize gets whether h should interpolate its size on visible child change.

See (*HeaderBar).SetInterpolateSize().

func (*HeaderBar) GetShowCloseButton

func (h *HeaderBar) GetShowCloseButton() bool

GetShowCloseButton returns whether this header bar shows the standard window decorations.

func (*HeaderBar) GetSubtitle

func (h *HeaderBar) GetSubtitle() string

GetSubtitle retrieves the subtitle of the header. See (*HeaderBar).SetSubtitle().

func (*HeaderBar) GetTitle

func (h *HeaderBar) GetTitle() string

GetTitle retrieves the title of the header. See (*HeaderBar).SetTitle().

func (*HeaderBar) GetTransitionDuration

func (h *HeaderBar) GetTransitionDuration() uint

GetTransitionDuration returns the amount of time (in milliseconds) that transitions between pages in h will take.

func (*HeaderBar) GetTransitionRunning

func (h *HeaderBar) GetTransitionRunning() bool

GetTransitionRunning returns whether the h is currently in a transition from one page to another.

func (*HeaderBar) PackEnd

func (h *HeaderBar) PackEnd(child gtk.IWidget)

PackEnd adds child to h:, packed with reference to the end of the h:.

func (*HeaderBar) PackStart

func (h *HeaderBar) PackStart(child gtk.IWidget)

PackStart adds child to h:, packed with reference to the start of the h:.

func (*HeaderBar) SetCenteringPolicy

func (h *HeaderBar) SetCenteringPolicy(centeringPolicy CenteringPolicy)

SetCenteringPolicy sets the policy h must follow to horizontally align its center widget.

func (*HeaderBar) SetCustomTitle

func (h *HeaderBar) SetCustomTitle(titleWidget gtk.IWidget)

SetCustomTitle sets a custom title for the HeaderBar.

The title should help a user identify the current view. This supersedes any title set by (*HeaderBar).SetTitle() or (*HeaderBar).SetSubtitle(). To achieve the same style as the builtin title and subtitle, use the “title” and “subtitle” style classes.

You should set the custom title to nil, for the header title label to be visible again.

func (*HeaderBar) SetDecorationLayout

func (h *HeaderBar) SetDecorationLayout(layout string)

SetDecorationLayout sets the decoration layout for this header bar, overriding the Settings:gtk-decoration-layout setting.

There can be valid reasons for overriding the setting, such as a header bar design that does not allow for buttons to take room on the right, or only offers room for a single close button. Split header bars are another example for overriding the setting.

The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close, icon (the window icon) and menu (a menu button for the fallback app menu).

For example, “menu:minimize,maximize,close” specifies a menu on the left, and minimize, maximize and close buttons on the right.

func (*HeaderBar) SetHasSubtitle

func (h *HeaderBar) SetHasSubtitle(setting bool)

SetHasSubtitle sets whether the header bar should reserve space for a subtitle, even if none is currently set.

func (*HeaderBar) SetInterpolateSize

func (h *HeaderBar) SetInterpolateSize(interpolateSize bool)

SetInterpolateSize sets whether or not h will interpolate the size of its opposing orientation when changing the visible child. If true, h will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if h is horizontal, it will interpolate the its height.

func (*HeaderBar) SetShowCloseButton

func (h *HeaderBar) SetShowCloseButton(setting bool)

SetShowCloseButton sets whether this header bar shows the standard window decorations, including close, maximize, and minimize.

func (*HeaderBar) SetSubtitle

func (h *HeaderBar) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle of the HeaderBar. The title should give a user an additional detail to help them identify the current view.

Note that HdyHeaderBar by default reserves room for the subtitle, even if none is currently set. If this is not desired, set the HeaderBar:has-subtitle property to false.

func (*HeaderBar) SetTitle

func (h *HeaderBar) SetTitle(title string)

SetTitle sets the title of the HeaderBar. The title should help a user identify the current view. A good title should not include the application name.

func (*HeaderBar) SetTransitionDuration

func (h *HeaderBar) SetTransitionDuration(duration uint)

SetTransitionDuration sets the duration that transitions between pages in h will take.

type HeaderGroup

type HeaderGroup struct {
	*glib.Object
}

func HeaderGroupNew

func HeaderGroupNew() *HeaderGroup

HeaderGroupNew creates a new HeaderGroup.

func (*HeaderGroup) AddGtkHeaderBar

func (h *HeaderGroup) AddGtkHeaderBar(headerBar *gtk.HeaderBar)

AddGtkHeaderBar adds header_bar to h. When the widget is destroyed or no longer referenced elsewhere, it will be removed from the header group.

func (*HeaderGroup) AddHeaderBar

func (h *HeaderGroup) AddHeaderBar(headerBar *HeaderBar)

AddHeaderBar adds header_bar to h. When the widget is destroyed or no longer referenced elsewhere, it will be removed from the header group.

func (*HeaderGroup) AddHeaderGroup

func (h *HeaderGroup) AddHeaderGroup(headerGroup *HeaderGroup)

AddHeaderGroup adds header_group to h. When the nested group is no longer referenced elsewhere, it will be removed from the header group.

func (*HeaderGroup) GetChildren

func (h *HeaderGroup) GetChildren() *glib.SList

GetChildren returns the list of children associated with h.

func (*HeaderGroup) GetDecorateAll

func (h *HeaderGroup) GetDecorateAll() bool

GetDecorateAll gets whether the elements of the group should all receive the full decoration.

func (*HeaderGroup) RemoveChild

func (h *HeaderGroup) RemoveChild(child *HeaderGroupChild)

RemoveChild removes child from h.

func (*HeaderGroup) RemoveGtkHeaderBar

func (h *HeaderGroup) RemoveGtkHeaderBar(headerBar *gtk.HeaderBar)

RemoveGtkHeaderBar removes header_bar from h.

func (*HeaderGroup) RemoveHeaderBar

func (h *HeaderGroup) RemoveHeaderBar(headerBar *HeaderBar)

RemoveHeaderBar removes header_bar from h.

func (*HeaderGroup) RemoveHeaderGroup

func (h *HeaderGroup) RemoveHeaderGroup(headerGroup *HeaderGroup)

RemoveHeaderGroup removes a nested HeaderGroup from a HeaderGroup

func (*HeaderGroup) SetDecorateAll

func (h *HeaderGroup) SetDecorateAll(decorateAll bool)

SetDecorateAll sets whether the elements of the group should all receive the full decoration.

type HeaderGroupChild

type HeaderGroupChild struct {
	*glib.Object
}

func (*HeaderGroupChild) GetChildType

func (h *HeaderGroupChild) GetChildType() HeaderGroupChildType

GetChildType gets the child type.

func (*HeaderGroupChild) GetGtkHeaderBar

func (h *HeaderGroupChild) GetGtkHeaderBar() *gtk.HeaderBar

GetGtkHeaderBar gets the child HeaderBar. Use (*HeaderGroupChild).GetChildType() to check the child type.

func (*HeaderGroupChild) GetHeaderBar

func (h *HeaderGroupChild) GetHeaderBar() *HeaderBar

GetHeaderBar gets the child HeaderBar. Use (*HeaderGroupChild).GetChildType() to check the child type.

func (*HeaderGroupChild) GetHeaderGroup

func (h *HeaderGroupChild) GetHeaderGroup() *HeaderGroup

GetHeaderGroup gets the child HeaderGroup. Use (*HeaderGroupChild).GetChildType() to check the child type.

type HeaderGroupChildType

type HeaderGroupChildType int

HeaderGroupChildType enumeration value describes the child types handled by HeaderGroup.

New values may be added to this enumeration over time.

const (
	// HeaderGroupChildTypeHeaderBar the child is a HeaderBar
	HeaderGroupChildTypeHeaderBar HeaderGroupChildType = 0
	// HeaderGroupChildTypeGtkHeaderBar the child is a HeaderBar
	HeaderGroupChildTypeGtkHeaderBar HeaderGroupChildType = 1
	// HeaderGroupChildTypeHeaderGroup the child is a HeaderGroup
	HeaderGroupChildTypeHeaderGroup HeaderGroupChildType = 2
)

type Keypad

type Keypad struct {
	gtk.Bin
}

func KeypadNew

func KeypadNew(symbolsVisible bool, lettersVisible bool) *Keypad

KeypadNew create a new Keypad widget.

func (*Keypad) GetColumnSpacing

func (k *Keypad) GetColumnSpacing() uint

GetColumnSpacing returns the amount of space between the columns of k.

func (*Keypad) GetEndAction

func (k *Keypad) GetEndAction() gtk.IWidget

GetEndAction returns the widget for the lower right corner (or left, in RTL locales) of k.

func (*Keypad) GetEntry

func (k *Keypad) GetEntry() *gtk.Entry

GetEntry get the connected entry. See (*Keypad).SetEntry() for details.

func (*Keypad) GetLettersVisible

func (k *Keypad) GetLettersVisible() bool

GetLettersVisible returns whether k should display the standard letters below the digits on its buttons.

func (*Keypad) GetRowSpacing

func (k *Keypad) GetRowSpacing() uint

GetRowSpacing returns the amount of space between the rows of k.

func (*Keypad) GetStartAction

func (k *Keypad) GetStartAction() gtk.IWidget

GetStartAction returns the widget for the lower left corner (or right, in RTL locales) of k.

func (*Keypad) GetSymbolsVisible

func (k *Keypad) GetSymbolsVisible() bool

GetSymbolsVisible returns whether k should display the standard letters below the digits on its buttons.

Returns Whether k should display the hash and asterisk buttons, and should display the plus symbol at the bottom of its 0 button.

func (*Keypad) SetColumnSpacing

func (k *Keypad) SetColumnSpacing(spacing uint)

SetColumnSpacing sets the amount of space between columns of k.

func (*Keypad) SetEndAction

func (k *Keypad) SetEndAction(endAction gtk.IWidget)

SetEndAction sets the widget for the lower right corner (or left, in RTL locales) of k.

func (*Keypad) SetEntry

func (k *Keypad) SetEntry(entry *gtk.Entry)

SetEntry binds entry to k and blocks any input which wouldn't be possible to type with with the keypad.

func (*Keypad) SetLettersVisible

func (k *Keypad) SetLettersVisible(lettersVisible bool)

SetLettersVisible sets whether k should display the standard letters below the digits on its buttons.

func (*Keypad) SetRowSpacing

func (k *Keypad) SetRowSpacing(spacing uint)

SetRowSpacing sets the amount of space between rows of k.

func (*Keypad) SetStartAction

func (k *Keypad) SetStartAction(startAction gtk.IWidget)

SetStartAction sets the widget for the lower left corner (or right, in RTL locales) of k.

func (*Keypad) SetSymbolsVisible

func (k *Keypad) SetSymbolsVisible(symbolsVisible bool)

SetSymbolsVisible sets whether k should display the hash and asterisk buttons, and should display the plus symbol at the bottom of its 0 button.

type Leaflet

type Leaflet struct {
	gtk.Container

	// Interfaces
	gtk.Orientable
	Swiper
}

func LeafletNew

func LeafletNew() *Leaflet

LeafletNew creates a new Leaflet.

func (*Leaflet) GetAdjacentChild

func (l *Leaflet) GetAdjacentChild(direction NavigationDirection) gtk.IWidget

GetAdjacentChild gets the previous or next child that doesn't have 'navigatable' child property set to false, or nil if it doesn't exist. This will be the same widget (*Leaflet).Navigate() will navigate to.

func (*Leaflet) GetCanSwipeBack

func (l *Leaflet) GetCanSwipeBack() bool

GetCanSwipeBack returns whether the Leaflet allows swiping to the previous child.

func (*Leaflet) GetCanSwipeForward

func (l *Leaflet) GetCanSwipeForward() bool

GetCanSwipeForward returns whether the Leaflet allows swiping to the next child.

func (*Leaflet) GetChildByName

func (l *Leaflet) GetChildByName(name string) gtk.IWidget

GetChildByName finds the child of l with the name given as the argument. Returns nil if there is no child with this name.

func (*Leaflet) GetChildTransitionDuration

func (l *Leaflet) GetChildTransitionDuration() uint

GetChildTransitionDuration returns the amount of time (in milliseconds) that transitions between children in l will take.

func (*Leaflet) GetChildTransitionRunning

func (l *Leaflet) GetChildTransitionRunning() bool

GetChildTransitionRunning returns whether l is currently in a transition from one page to another.

func (*Leaflet) GetFolded

func (l *Leaflet) GetFolded() bool

GetFolded gets whether l is folded.

func (*Leaflet) GetHomogeneous

func (l *Leaflet) GetHomogeneous(folded bool, orientation gtk.Orientation) bool

GetHomogeneous gets whether l is homogeneous for the given fold and orientation. See (*Leaflet).SetHomogeneous().

func (*Leaflet) GetInterpolateSize

func (l *Leaflet) GetInterpolateSize() bool

GetInterpolateSize returns whether the Leaflet is set up to interpolate between the sizes of children on page switch.

func (*Leaflet) GetModeTransitionDuration

func (l *Leaflet) GetModeTransitionDuration() uint

GetModeTransitionDuration returns the amount of time (in milliseconds) that transitions between modes in l will take.

func (*Leaflet) GetTransitionType

func (l *Leaflet) GetTransitionType() LeafletTransitionType

GetTransitionType gets the type of animation that will be used for transitions between modes and children in l.

func (*Leaflet) GetVisibleChild

func (l *Leaflet) GetVisibleChild() gtk.IWidget

GetVisibleChild gets the visible child widget.

func (*Leaflet) GetVisibleChildName

func (l *Leaflet) GetVisibleChildName() string

GetVisibleChildName gets the name of the currently visible child widget.

func (*Leaflet) InsertChildAfter

func (l *Leaflet) InsertChildAfter(child gtk.IWidget, sibling gtk.IWidget)

InsertChildAfter inserts child in the position after sibling in the list of children. If sibling is nil, insert child at the first position.

func (*Leaflet) Navigate

func (l *Leaflet) Navigate(direction NavigationDirection) bool

Navigate switches to the previous or next child that doesn't have 'navigatable' child property set to false, similar to performing a swipe gesture to go in direction.

func (*Leaflet) Prepend

func (l *Leaflet) Prepend(child gtk.IWidget)

Prepend inserts child at the first position in l.

func (*Leaflet) ReorderChildAfter

func (l *Leaflet) ReorderChildAfter(child gtk.IWidget, sibling gtk.IWidget)

ReorderChildAfter moves child to the position after sibling in the list of children. If sibling is nil, move child to the first position.

func (*Leaflet) SetCanSwipeBack

func (l *Leaflet) SetCanSwipeBack(canSwipeBack bool)

SetCanSwipeBack sets whether or not l allows switching to the previous child that has 'navigatable' child property set to true via a swipe gesture

func (*Leaflet) SetCanSwipeForward

func (l *Leaflet) SetCanSwipeForward(canSwipeForward bool)

SetCanSwipeForward sets whether or not l allows switching to the next child that has 'navigatable' child property set to true via a swipe gesture.

func (*Leaflet) SetChildTransitionDuration

func (l *Leaflet) SetChildTransitionDuration(duration uint)

SetChildTransitionDuration sets the duration that transitions between children in l will take.

func (*Leaflet) SetHomogeneous

func (l *Leaflet) SetHomogeneous(folded bool, orientation gtk.Orientation, homogeneous bool)

SetHomogeneous sets the Leaflet to be homogeneous or not for the given fold and orientation. If it is homogeneous, the Leaflet will request the same width or height for all its children depending on the orientation. If it isn't and it is folded, the leaflet may change width or height when a different child becomes visible.

func (*Leaflet) SetInterpolateSize

func (l *Leaflet) SetInterpolateSize(interpolateSize bool)

SetInterpolateSize sets whether or not l will interpolate its size when changing the visible child. If the Leaflet:interpolate-size property is set to true, l will interpolate its size between the current one and the one it'll take after changing the visible child, according to the set transition duration.

func (*Leaflet) SetModeTransitionDuration

func (l *Leaflet) SetModeTransitionDuration(duration uint)

SetModeTransitionDuration sets the duration that transitions between modes in l will take.

func (*Leaflet) SetTransitionType

func (l *Leaflet) SetTransitionType(transition LeafletTransitionType)

SetTransitionType sets the type of animation that will be used for transitions between modes and children in l.

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the mode or child that is about to become current.

func (*Leaflet) SetVisibleChild

func (l *Leaflet) SetVisibleChild(visibleChild gtk.IWidget)

SetVisibleChild makes visible_child visible using a transition determined by HdyLeaflet:transition-type and HdyLeaflet:child-transition-duration. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

func (*Leaflet) SetVisibleChildName

func (l *Leaflet) SetVisibleChildName(name string)

SetVisibleChildName makes the child with the name name visible.

See (*Leaflet).SetVisibleChild() for more details.

type LeafletTransitionType

type LeafletTransitionType int

LeafletTransitionType enumeration value describes the possible transitions between modes and children in a Leaflet widget.

New values may be added to this enumeration over time.

const (
	// LeafletTransitionTypeOver cover the old page or uncover the new page,
	// sliding from or towards the end according to orientation, text direction
	// and children order
	LeafletTransitionTypeOver LeafletTransitionType = 0
	// LeafletTransitionTypeUnder uncover the new page or cover the old page,
	// sliding from or towards the start according to orientation, text
	// direction and children order
	LeafletTransitionTypeUnder LeafletTransitionType = 1
	// LeafletTransitionTypeSlide slide from left, right, up or down according
	// to the orientation, text direction and the children order
	LeafletTransitionTypeSlide LeafletTransitionType = 2
)
type NavigationDirection int

NavigationDirection represents direction of a swipe navigation gesture in Deck and Leaflet.

const (
	// NavigationDirectionBack corresponds to start or top, depending on
	// orientation and text direction
	NavigationDirectionBack NavigationDirection = 0
	// NavigationDirectionForward corresponds to end or bottom, depending on
	// orientation and text direction
	NavigationDirectionForward NavigationDirection = 1
)

type PreferencesGroup

type PreferencesGroup struct {
	gtk.Bin
}

func PreferencesGroupNew

func PreferencesGroupNew() *PreferencesGroup

PreferencesGroupNew creates a new PreferencesGroup.

func (*PreferencesGroup) GetDescription

func (p *PreferencesGroup) GetDescription() string

func (*PreferencesGroup) GetTitle

func (p *PreferencesGroup) GetTitle() string

GetTitle gets the title of p.

func (*PreferencesGroup) SetDescription

func (p *PreferencesGroup) SetDescription(description string)

SetDescription sets the description for p.

func (*PreferencesGroup) SetTitle

func (p *PreferencesGroup) SetTitle(title string)

SetTitle sets the title for p.

type PreferencesPage

type PreferencesPage struct {
	gtk.Bin
}

func PreferencesPageNew

func PreferencesPageNew() *PreferencesPage

PreferencesPageNew creates a new PreferencesPage.

func (*PreferencesPage) GetIconName

func (p *PreferencesPage) GetIconName() string

GetIconName gets the icon name for p, or nil.

func (*PreferencesPage) GetTitle

func (p *PreferencesPage) GetTitle() string

GetTitle gets the title of p, or nil.

func (*PreferencesPage) SetIconName

func (p *PreferencesPage) SetIconName(iconName string)

SetIconName sets the icon name for p.

func (*PreferencesPage) SetTitle

func (p *PreferencesPage) SetTitle(title string)

SetTitle sets the title of p.

type PreferencesRow

type PreferencesRow struct {
	gtk.ListBoxRow

	// Interfaces
	gtk.Actionable
}

func PreferencesRowNew

func PreferencesRowNew() *PreferencesRow

PreferencesRowNew creates a new PreferencesRow.

func (*PreferencesRow) GetTitle

func (p *PreferencesRow) GetTitle() string

GetTitle gets the title of the preference represented by p.

func (*PreferencesRow) GetUseUnderline

func (p *PreferencesRow) GetUseUnderline() bool

GetUseUnderline gets whether an embedded underline in the text of the title indicates a mnemonic. See (*PreferencesRow).SetUseUnderline().

func (*PreferencesRow) SetTitle

func (p *PreferencesRow) SetTitle(title string)

SetTitle sets the title of the preference represented by p.

func (*PreferencesRow) SetUseUnderline

func (p *PreferencesRow) SetUseUnderline(useUnderline bool)

SetUseUnderline if true, an underline in the text of the title indicates the next character should be used for the mnemonic accelerator key.

type PreferencesWindow

type PreferencesWindow struct {
	Window
}

func PreferencesWindowNew

func PreferencesWindowNew() *PreferencesWindow

PreferencesWindowNew creates a new PreferencesWindow.

func (*PreferencesWindow) CloseSubpage

func (p *PreferencesWindow) CloseSubpage()

CloseSubpage closes the current subpage to return back to the preferences, if there is no presented subpage, this does nothing.

func (*PreferencesWindow) GetCanSwipeBack

func (p *PreferencesWindow) GetCanSwipeBack() bool

GetCanSwipeBack returns whether or not p allows switching from a subpage to the preferences via a swipe gesture.

func (*PreferencesWindow) GetSearchEnabled

func (p *PreferencesWindow) GetSearchEnabled() bool

GetSearchEnabled gets whether search is enabled for p.

func (*PreferencesWindow) PresentSubpage

func (p *PreferencesWindow) PresentSubpage(subpage gtk.IWidget)

PresentSubpage sets subpage as the window's subpage and present it. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

func (*PreferencesWindow) SetCanSwipeBack

func (p *PreferencesWindow) SetCanSwipeBack(canSwipeBack bool)

SetCanSwipeBack sets whether or not p allows switching from a subpage to the preferences via a swipe gesture.

func (*PreferencesWindow) SetSearchEnabled

func (p *PreferencesWindow) SetSearchEnabled(searchEnabled bool)

SetSearchEnabled sets whether search is enabled for p.

type SearchBar struct {
	gtk.Bin
}

func SearchBarNew

func SearchBarNew() *SearchBar

SearchBarNew creates a SearchBar. You will need to tell it about which widget is going to be your text entry using (*SearchBar).ConnectEntry().

func (*SearchBar) ConnectEntry

func (s *SearchBar) ConnectEntry(entry *gtk.Entry)

ConnectEntry connects the Entry widget passed as the one to be used in this search bar. The entry should be a descendant of the search bar. This is only required if the entry isn’t the direct child of the search bar (as in our main example).

func (*SearchBar) GetSearchMode

func (s *SearchBar) GetSearchMode() bool

GetSearchMode returns whether the search mode is on or off.

func (*SearchBar) GetShowCloseButton

func (s *SearchBar) GetShowCloseButton() bool

GetShowCloseButton returns whether the close button is shown.

func (*SearchBar) HandleEvent

func (s *SearchBar) HandleEvent(event *gdk.Event) bool

HandleEvent function should be called when the top-level window which contains the search bar received a key event.

If the key event is handled by the search bar, the bar will be shown, the entry populated with the entered text and GDK_EVENT_STOP will be returned. The caller should ensure that events are not propagated further.

If no entry has been connected to the search bar, using (*SearchBar).ConnectEntry(), this function will return immediately with a warning.

Showing the search bar on key presses

static gboolean
on_key_press_event (GtkWidget *widget,
                    GdkEvent  *event,
                    gpointer   user_data)
{
  HdySearchBar *bar = HDY_SEARCH_BAR (user_data);
  return hdy_search_bar_handle_event (self, event);
}

static void
create_toplevel (void)
{
  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  GtkWindow *search_bar = hdy_search_bar_new ();

 // Add more widgets to the window...

  g_signal_connect (window,
                   "key-press-event",
                    G_CALLBACK (on_key_press_event),
                    search_bar);
}

func (*SearchBar) SetSearchMode

func (s *SearchBar) SetSearchMode(searchMode bool)

SetSearchMode switches the search mode on or off.

func (*SearchBar) SetShowCloseButton

func (s *SearchBar) SetShowCloseButton(visible bool)

SetShowCloseButton shows or hides the close button. Applications that already have a “search” toggle button should not show a close button in their search bar, as it duplicates the role of the toggle button.

type Squeezer

type Squeezer struct {
	gtk.Container

	// Interfaces
	gtk.Orientable
}

func SqueezerNew

func SqueezerNew() *Squeezer

SqueezerNew creates a new Squeezer container.

func (*Squeezer) GetChildEnabled

func (s *Squeezer) GetChildEnabled(child gtk.IWidget) bool

GetChildEnabled gets whether child is enabled.

See (*Squeezer).SetChildEnabled().

func (*Squeezer) GetHomogeneous

func (s *Squeezer) GetHomogeneous() bool

GetHomogeneous gets whether s is homogeneous.

See (*Squeezer).SetHomogeneous().

func (*Squeezer) GetInterpolateSize

func (s *Squeezer) GetInterpolateSize() bool

GetInterpolateSize gets whether s should interpolate its size on visible child change.

See (*Squeezer).SetInterpolateSize().

func (*Squeezer) GetTransitionDuration

func (s *Squeezer) GetTransitionDuration() uint

GetTransitionDuration gets the amount of time (in milliseconds) that transitions between children in s will take.

func (*Squeezer) GetTransitionRunning

func (s *Squeezer) GetTransitionRunning() bool

GetTransitionRunning gets whether s is currently in a transition from one child to another.

func (*Squeezer) GetTransitionType

func (s *Squeezer) GetTransitionType() SqueezerTransitionType

GetTransitionType gets the type of animation that will be used for transitions between children in s.

func (*Squeezer) GetVisibleChild

func (s *Squeezer) GetVisibleChild() gtk.IWidget

GetVisibleChild gets the currently visible child of s, or nil if there are no visible children.

func (*Squeezer) GetXAlign

func (s *Squeezer) GetXAlign() float32

GetXAlign gets the Squeezer:xalign property for s.

func (*Squeezer) GetYAlign

func (s *Squeezer) GetYAlign() float32

GetYAlign gets the Squeezer:yalign property for s.

func (*Squeezer) SetChildEnabled

func (s *Squeezer) SetChildEnabled(child gtk.IWidget, enabled bool)

SetChildEnabled make s enable or disable child. If a child is disabled, it will be ignored when looking for the child fitting the available size best. This allows to programmatically and prematurely hide a child of s even if it fits in the available space.

This can be used e.g. to ensure a certain child is hidden below a certain window width, or any other constraint you find suitable.

func (*Squeezer) SetHomogeneous

func (s *Squeezer) SetHomogeneous(homogeneous bool)

SetHomogeneous sets s to be homogeneous or not. If it is homogeneous, s will request the same size for all its children for its opposite orientation, e.g. if s is oriented horizontally and is homogeneous, it will request the same height for all its children. If it isn't, s may change size when a different child becomes visible.

func (*Squeezer) SetInterpolateSize

func (s *Squeezer) SetInterpolateSize(interpolateSize bool)

SetInterpolateSize sets whether or not s will interpolate the size of its opposing orientation when changing the visible child. If true, s will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if s is horizontal, it will interpolate the its height.

func (*Squeezer) SetTransitionDuration

func (s *Squeezer) SetTransitionDuration(duration uint)

SetTransitionDuration sets the duration that transitions between children in s will take.

func (*Squeezer) SetTransitionType

func (s *Squeezer) SetTransitionType(transition SqueezerTransitionType)

SetTransitionType sets the type of animation that will be used for transitions between children in s. Available types include various kinds of fades and slides.

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the child that is about to become current.

func (*Squeezer) SetXAlign

func (s *Squeezer) SetXAlign(xalign float32)

SetXAlign sets the Squeezer:xalign property for s.

func (*Squeezer) SetYAlign

func (s *Squeezer) SetYAlign(yalign float32)

SetYAlign sets the Squeezer:yalign property for s.

type SqueezerTransitionType

type SqueezerTransitionType int

SqueezerTransitionType these enumeration values describe the possible transitions between children in a Squeezer widget.

const (
	// SqueezerTransitionTypeNone no transition
	SqueezerTransitionTypeNone SqueezerTransitionType = 0
	// SqueezerTransitionTypeCrossfade a cross-fade
	SqueezerTransitionTypeCrossfade SqueezerTransitionType = 1
)

type StatusPage

type StatusPage struct {
	gtk.Bin
}

func StatusPageNew

func StatusPageNew() *StatusPage

StatusPageNew creates a new StatusPage.

func (*StatusPage) GetDescription

func (s *StatusPage) GetDescription() string

GetDescription gets the description for s.

func (*StatusPage) GetIconName

func (s *StatusPage) GetIconName() string

GetIconName gets the icon name for s.

func (*StatusPage) GetTitle

func (s *StatusPage) GetTitle() string

GetTitle gets the title for s.

func (*StatusPage) SetDescription

func (s *StatusPage) SetDescription(description string)

SetDescription sets the description for s.

func (*StatusPage) SetIconName

func (s *StatusPage) SetIconName(iconName string)

SetIconName sets the icon name for s.

func (*StatusPage) SetTitle

func (s *StatusPage) SetTitle(title string)

SetTitle sets the title for s.

type SwipeGroup

type SwipeGroup struct {
	*glib.Object
}

func SwipeGroupNew

func SwipeGroupNew() *SwipeGroup

SwipeGroupNew create a new SwipeGroup object.

func (*SwipeGroup) AddSwipeable

func (s *SwipeGroup) AddSwipeable(swipeable Swiper)

AddSwipeable when the widget is destroyed or no longer referenced elsewhere, it will be removed from the swipe group.

func (*SwipeGroup) GetSwipeables

func (s *SwipeGroup) GetSwipeables() *glib.SList

GetSwipeables returns the list of swipeables associated with s.

func (*SwipeGroup) RemoveSwipeable

func (s *SwipeGroup) RemoveSwipeable(swipeable Swiper)

RemoveSwipeable removes a widget from a SwipeGroup.

type SwipeTracker

type SwipeTracker struct {
	*glib.Object

	// Interfaces
	gtk.Orientable
}

func SwipeTrackerNew

func SwipeTrackerNew(swipeable Swipeable) *SwipeTracker

SwipeTrackerNew create a new SwipeTracker object on widget.

func (*SwipeTracker) GetAllowLongSwipes

func (s *SwipeTracker) GetAllowLongSwipes() bool

GetAllowLongSwipes whether to allow swiping for more than one snap point at a time. If the value is false, each swipe can only move to the adjacent snap points.

func (*SwipeTracker) GetAllowMouseDrag

func (s *SwipeTracker) GetAllowMouseDrag() bool

GetAllowMouseDrag get whether s can be dragged with mouse pointer.

func (*SwipeTracker) GetEnabled

func (s *SwipeTracker) GetEnabled() bool

GetEnabled get whether s is enabled. When it's not enabled, no events will be processed. Generally widgets will want to expose this via a property.

func (*SwipeTracker) GetReversed

func (s *SwipeTracker) GetReversed() bool

GetReversed get whether s is reversing the swipe direction.

func (*SwipeTracker) GetSwipeable

func (s *SwipeTracker) GetSwipeable() Swiper

GetSwipeable get s's swipeable widget.

func (*SwipeTracker) SetAllowLongSwipes

func (s *SwipeTracker) SetAllowLongSwipes(allowLongSwipes bool)

SetAllowLongSwipes sets whether to allow swiping for more than one snap point at a time. If the value is false, each swipe can only move to the adjacent snap points.

func (*SwipeTracker) SetAllowMouseDrag

func (s *SwipeTracker) SetAllowMouseDrag(allowMouseDrag bool)

SetAllowMouseDrag set whether s can be dragged with mouse pointer. This should usually be false.

func (*SwipeTracker) SetEnabled

func (s *SwipeTracker) SetEnabled(enabled bool)

SetEnabled set whether s is enabled. When it's not enabled, no events will be processed. Usually widgets will want to expose this via a property.

func (*SwipeTracker) SetReversed

func (s *SwipeTracker) SetReversed(reversed bool)

SetReversed set whether to reverse the swipe direction. If s is horizontal, can be used for supporting RTL text direction.

func (*SwipeTracker) ShiftPosition

func (s *SwipeTracker) ShiftPosition(delta float64)

ShiftPosition move the current progress value by delta. This can be used to adjust the current position if snap points move during the gesture.

type Swipeable

type Swipeable struct {
	Caster
}

func (*Swipeable) EmitChildSwitched

func (s *Swipeable) EmitChildSwitched(index uint, duration int64)

EmitChildSwitched emits HdySwipeable::child-switched signal. This should be called when the widget switches visible child widget.

duration can be 0 if the child is switched without animation.

func (*Swipeable) GetCancelProgress

func (s *Swipeable) GetCancelProgress() float64

GetCancelProgress gets the progress s will snap back to after the gesture is canceled.

func (*Swipeable) GetDistance

func (s *Swipeable) GetDistance() float64

GetDistance gets the swipe distance of s. This corresponds to how many pixels 1 unit represents.

func (*Swipeable) GetProgress

func (s *Swipeable) GetProgress() float64

GetProgress gets the current progress of s

func (*Swipeable) GetSwipeArea

func (s *Swipeable) GetSwipeArea(navigationDirection NavigationDirection, isDrag bool, rect *gdk.Rectangle)

GetSwipeArea gets the area s can start a swipe from for the given direction and gesture type. This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.

Swipe area is only considered for direct swipes (as in, not initiated by SwipeGroup).

If not implemented, the default implementation returns the allocation of s, allowing swipes from anywhere.

func (*Swipeable) GetSwipeTracker

func (s *Swipeable) GetSwipeTracker() *SwipeTracker

GetSwipeTracker gets the SwipeTracker used by this swipeable widget.

func (*Swipeable) SwitchChild

func (s *Swipeable) SwitchChild(index uint, duration int64)

SwitchChild see HdySwipeable::child-switched.

type Swiper

type Swiper interface {
	Caster
	// EmitChildSwitched emits HdySwipeable::child-switched signal. This should be
	// called when the widget switches visible child widget.
	//
	// duration can be 0 if the child is switched without animation.
	EmitChildSwitched(index uint, duration int64)
	// GetCancelProgress gets the progress Swiper will snap back to after the
	// gesture is canceled.
	GetCancelProgress() float64
	// GetDistance gets the swipe distance of Swiper. This corresponds to how many
	// pixels 1 unit represents.
	GetDistance() float64
	// GetProgress gets the current progress of Swiper
	GetProgress() float64
	// GetSwipeArea gets the area Swiper can start a swipe from for the given
	// direction and gesture type. This can be used to restrict swipes to only be
	// possible from a certain area, for example, to only allow edge swipes, or to
	// have a draggable element and ignore swipes elsewhere.
	//
	// Swipe area is only considered for direct swipes (as in, not initiated by
	// SwipeGroup).
	//
	// If not implemented, the default implementation returns the allocation of
	// Swiper, allowing swipes from anywhere.
	GetSwipeArea(navigationDirection NavigationDirection, isDrag bool, rect *gdk.Rectangle)
	// GetSwipeTracker gets the SwipeTracker used by this swipeable widget.
	GetSwipeTracker() *SwipeTracker
	// SwitchChild see HdySwipeable::child-switched.
	SwitchChild(index uint, duration int64)
}

type TabBar

type TabBar struct {
	gtk.Bin
}

func TabBarNew

func TabBarNew() *TabBar

TabBarNew creates a new TabBar widget.

func (*TabBar) GetAutohide

func (t *TabBar) GetAutohide() bool

GetAutohide gets whether the tabs automatically hide, see (*TabBar).SetAutohide().

func (*TabBar) GetEndActionWidget

func (t *TabBar) GetEndActionWidget() gtk.IWidget

GetEndActionWidget gets the widget shown after the tabs.

func (*TabBar) GetExpandTabs

func (t *TabBar) GetExpandTabs() bool

GetExpandTabs gets whether tabs should expand, see (*TabBar).SetExpandTabs().

func (*TabBar) GetInverted

func (t *TabBar) GetInverted() bool

GetInverted gets whether tabs use inverted layout, see (*TabBar).SetInverted().

func (*TabBar) GetIsOverflowing

func (t *TabBar) GetIsOverflowing() bool

GetIsOverflowing gets whether t is overflowing.

func (*TabBar) GetStartActionWidget

func (t *TabBar) GetStartActionWidget() gtk.IWidget

GetStartActionWidget gets the widget shown before the tabs.

func (*TabBar) GetTabsRevealed

func (t *TabBar) GetTabsRevealed() bool

GetTabsRevealed gets the value of the TabBar:tabs-revealed property.

func (*TabBar) GetView

func (t *TabBar) GetView() *TabView

GetView gets the TabView t controls.

func (*TabBar) SetAutohide

func (t *TabBar) SetAutohide(autohide bool)

SetAutohide sets whether the tabs automatically hide.

If autohide is true, the tab bar disappears when the associated TabView has 0 or 1 tab, no pinned tabs, and no tab is being transferred.

Autohide is enabled by default.

See TabBar:tabs-revealed.

func (*TabBar) SetEndActionWidget

func (t *TabBar) SetEndActionWidget(widget gtk.IWidget)

SetEndActionWidget sets the widget to show after the tabs.

func (*TabBar) SetExpandTabs

func (t *TabBar) SetExpandTabs(expandTabs bool)

SetExpandTabs sets whether tabs should expand.

If expand_tabs is true, the tabs will always vary width filling the whole width when possible, otherwise tabs will always have the minimum possible size.

Expand is enabled by default.

func (*TabBar) SetInverted

func (t *TabBar) SetInverted(inverted bool)

SetInverted sets whether tabs tabs use inverted layout.

If inverted is true, non-pinned tabs will have the close button at the beginning and the indicator at the end rather than the opposite.

func (*TabBar) SetStartActionWidget

func (t *TabBar) SetStartActionWidget(widget gtk.IWidget)

SetStartActionWidget sets the widget to show before the tabs.

func (*TabBar) SetView

func (t *TabBar) SetView(view *TabView)

SetView sets the TabView t controls.

type TabPage

type TabPage struct {
	*glib.Object
}

func (*TabPage) GetChild

func (t *TabPage) GetChild() gtk.IWidget

GetChild gets the child of t.

func (*TabPage) GetIcon

func (t *TabPage) GetIcon() *glib.Icon

GetIcon gets the icon of t, see (*TabPage).SetIcon().

func (*TabPage) GetIndicatorActivatable

func (t *TabPage) GetIndicatorActivatable() bool

GetIndicatorActivatable gets whether the indicator of t is activatable, see (*TabPage).SetIndicatorActivatable().

func (*TabPage) GetIndicatorIcon

func (t *TabPage) GetIndicatorIcon() *glib.Icon

GetIndicatorIcon gets the indicator icon of t, see (*TabPage).SetIndicatorIcon().

func (*TabPage) GetLoading

func (t *TabPage) GetLoading() bool

GetLoading gets whether t is loading, see (*TabPage).SetLoading().

func (*TabPage) GetNeedsAttention

func (t *TabPage) GetNeedsAttention() bool

GetNeedsAttention gets whether t needs attention, see (*TabPage).SetNeedsAttention().

func (*TabPage) GetParent

func (t *TabPage) GetParent() *TabPage

GetParent gets the parent page of t, or nil if the t does not have a parent.

See (*TabView).AddPage() and (*TabView).ClosePage().

func (*TabPage) GetPinned

func (t *TabPage) GetPinned() bool

GetPinned gets whether t is pinned. See (*TabView).SetPagePinned().

func (*TabPage) GetSelected

func (t *TabPage) GetSelected() bool

GetSelected gets whether t is selected. See (*TabView).SetSelectedPage().

func (*TabPage) GetTitle

func (t *TabPage) GetTitle() string

GetTitle gets the title of t, see (*TabPage).SetTitle().

func (*TabPage) GetTooltip

func (t *TabPage) GetTooltip() string

GetTooltip gets the tooltip of t, see (*TabPage).SetTooltip().

func (*TabPage) SetIcon

func (t *TabPage) SetIcon(icon *glib.Icon)

SetIcon sets the icon of t, displayed next to the title.

TabBar will not show the icon if TabPage:loading is set to true, or if t is pinned and TabPage:indicator-icon is set.

func (*TabPage) SetIndicatorActivatable

func (t *TabPage) SetIndicatorActivatable(activatable bool)

SetIndicatorActivatable sets whether the indicator of t is activatable.

If set to true, TabView::indicator-activated will be emitted when the indicator is clicked.

If TabPage:indicator-icon is not set, does nothing.

func (*TabPage) SetIndicatorIcon

func (t *TabPage) SetIndicatorIcon(indicatorIcon *glib.Icon)

SetIndicatorIcon sets the indicator icon of t.

A common use case is an audio or camera indicator in a web browser.

TabPage will show it at the beginning of the tab, alongside icon representing TabPage:icon or loading spinner.

If the page is pinned, the indicator will be shown instead of icon or spinner.

If TabPage:indicator-activatable is set to true, indicator icon can act as a button.

func (*TabPage) SetLoading

func (t *TabPage) SetLoading(loading bool)

SetLoading sets wether t is loading.

If set to true, TabBar will display a spinner in place of icon.

If t is pinned and TabPage:indicator-icon is set, the loading status will not be visible.

func (*TabPage) SetNeedsAttention

func (t *TabPage) SetNeedsAttention(needsAttention bool)

SetNeedsAttention sets whether t needs attention.

TabBar will display a glow under the tab representing t if set to true. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.

func (*TabPage) SetTitle

func (t *TabPage) SetTitle(title string)

SetTitle sets the title of t.

TabBar will display it in the center of the tab representing t unless it's pinned, and will use it as a tooltip unless TabPage:tooltip is set.

func (*TabPage) SetTooltip

func (t *TabPage) SetTooltip(tooltip string)

SetTooltip sets the tooltip of t, marked up with the Pango text markup language.

If not set, TabBar will use TabPage:title as a tooltip instead.

type TabView

type TabView struct {
	gtk.Bin
}

func TabViewNew

func TabViewNew() *TabView

TabViewNew creates a new TabView widget.

func (*TabView) AddPage

func (t *TabView) AddPage(child gtk.IWidget, parent *TabPage) *TabPage

AddPage adds child to t with parent as the parent.

This function can be used to automatically position new pages, and to select the correct page when this page is closed while being selected (see (*TabView).ClosePage()).

If parent is nil, this function is equivalent to (*TabView).Append().

func (*TabView) Append

func (t *TabView) Append(child gtk.IWidget) *TabPage

Append inserts child as the last non-pinned page.

func (*TabView) AppendPinned

func (t *TabView) AppendPinned(child gtk.IWidget) *TabPage

AppendPinned inserts child as the last pinned page.

func (*TabView) CloseOtherPages

func (t *TabView) CloseOtherPages(page *TabPage)

CloseOtherPages requests to close all pages other than page.

func (*TabView) ClosePage

func (t *TabView) ClosePage(page *TabPage)

ClosePage requests to close page.

Calling this function will result in TabView::close-page signal being emitted for page. Closing the page can then be confirmed or denied via (*TabView).ClosePageFinish().

If the page is waiting for a (*TabView).ClosePageFinish() call, this function will do nothing.

The default handler for TabView::close-page will immediately confirm closing the page if it's non-pinned, or reject it if it's pinned. This behavior can be changed by registering your own handler for that signal.

If page was selected, another page will be selected instead:

If the TabPage:parent value is nil, the next page will be selected when possible, or if the page was already last, the previous page will be selected instead.

If it's not nil, the previous page will be selected if it's a descendant (possibly indirect) of the parent. If both the previous page and the parent are pinned, the parent will be selected instead.

func (*TabView) ClosePageFinish

func (t *TabView) ClosePageFinish(page *TabPage, confirm bool)

ClosePageFinish completes a (*TabView).ClosePage() call for page.

If confirm is true, page will be closed. If it's false, ite will be reverted to its previous state and (*TabView).ClosePage() can be called for it again.

This function should not be called unless a custom handler for TabView::close-page is used.

func (*TabView) ClosePagesAfter

func (t *TabView) ClosePagesAfter(page *TabPage)

ClosePagesAfter requests to close all pages after page.

func (*TabView) ClosePagesBefore

func (t *TabView) ClosePagesBefore(page *TabPage)

ClosePagesBefore requests to close all pages before page.

func (*TabView) GetDefaultIcon

func (t *TabView) GetDefaultIcon() *glib.Icon

GetDefaultIcon gets default icon of t, see (*TabView).SetDefaultIcon().

func (*TabView) GetIsTransferringPage

func (t *TabView) GetIsTransferringPage() bool

GetIsTransferringPage whether a page is being transferred.

Gets the value of TabView:is-transferring-page property.

func (*TabView) GetMenuModel

func (t *TabView) GetMenuModel() *glib.MenuModel

GetMenuModel gets the tab context menu model for t, see (*TabView).SetMenuModel().

func (*TabView) GetNPages

func (t *TabView) GetNPages() int

GetNPages gets the number of pages in t.

func (*TabView) GetNPinnedPages

func (t *TabView) GetNPinnedPages() int

GetNPinnedPages gets the number of pinned pages in t.

See (*TabView).SetPagePinned().

func (*TabView) GetNthPage

func (t *TabView) GetNthPage(position int) *TabPage

GetNthPage gets the TabPage representing the child at position.

func (*TabView) GetPage

func (t *TabView) GetPage(child gtk.IWidget) *TabPage

GetPage gets the TabPage object representing child.

func (*TabView) GetPagePosition

func (t *TabView) GetPagePosition(page *TabPage) int

GetPagePosition finds the position of page in t, starting from 0.

func (*TabView) GetPages

func (t *TabView) GetPages() *glib.ListModel

GetPages returns a Model containing the pages of t. This model can be used to keep an up to date view of the pages.

func (*TabView) GetSelectedPage

func (t *TabView) GetSelectedPage() *TabPage

GetSelectedPage gets the currently selected page in t.

func (*TabView) GetShortcutWidget

func (t *TabView) GetShortcutWidget() gtk.IWidget

GetShortcutWidget gets the shortcut widget for t, see (*TabView).SetShortcutWidget().

func (*TabView) Insert

func (t *TabView) Insert(child gtk.IWidget, position int) *TabPage

Insert inserts a non-pinned page at position.

It's an error to try to insert a page before a pinned page, in that case (*TabView).InsertPinned() should be used instead.

func (*TabView) InsertPinned

func (t *TabView) InsertPinned(child gtk.IWidget, position int) *TabPage

InsertPinned inserts a pinned page at position.

It's an error to try to insert a pinned page after a non-pinned page, in that case (*TabView).Insert() should be used instead.

func (*TabView) Prepend

func (t *TabView) Prepend(child gtk.IWidget) *TabPage

Prepend inserts child as the first non-pinned page.

func (*TabView) PrependPinned

func (t *TabView) PrependPinned(child gtk.IWidget) *TabPage

PrependPinned inserts child as the first pinned page.

func (*TabView) ReorderBackward

func (t *TabView) ReorderBackward(page *TabPage) bool

ReorderBackward reorders page to before its previous page if possible.

func (*TabView) ReorderFirst

func (t *TabView) ReorderFirst(page *TabPage) bool

ReorderFirst reorders page to the first possible position.

func (*TabView) ReorderForward

func (t *TabView) ReorderForward(page *TabPage) bool

ReorderForward reorders page to after its next page if possible.

func (*TabView) ReorderLast

func (t *TabView) ReorderLast(page *TabPage) bool

ReorderLast reorders page to the last possible position.

func (*TabView) ReorderPage

func (t *TabView) ReorderPage(page *TabPage, position int) bool

ReorderPage reorders page to position.

It's a programmer error to try to reorder a pinned page after a non-pinned one, or a non-pinned page before a pinned one.

func (*TabView) SelectNextPage

func (t *TabView) SelectNextPage() bool

SelectNextPage selects the page after the currently selected page.

If the last page was already selected, this function does nothing.

func (*TabView) SelectPreviousPage

func (t *TabView) SelectPreviousPage() bool

SelectPreviousPage selects the page before the currently selected page.

If the first page was already selected, this function does nothing.

func (*TabView) SetDefaultIcon

func (t *TabView) SetDefaultIcon(defaultIcon *glib.Icon)

SetDefaultIcon sets default page icon for t.

If a page doesn't provide its own icon via TabPage:icon, default icon may be used instead for contexts where having an icon is necessary.

TabBar will use default icon for pinned tabs in case the page is not loading, doesn't have an icon and an indicator. Default icon is never used for tabs that aren't pinned.

By default, 'hdy-tab-icon-missing-symbolic' icon is used.

func (*TabView) SetMenuModel

func (t *TabView) SetMenuModel(menuModel *glib.MenuModel)

SetMenuModel sets the tab context menu model for t.

When a context menu is shown for a tab, it will be constructed from the provided menu model. Use TabView::setup-menu signal to set up the menu actions for the particular tab.

func (*TabView) SetPagePinned

func (t *TabView) SetPagePinned(page *TabPage, pinned bool)

SetPagePinned pins or unpins page.

Pinned pages are guaranteed to be placed before all non-pinned pages; at any given moment the first TabView:n-pinned-pages pages in t are guaranteed to be pinned.

When a page is pinned or unpinned, it's automatically reordered: pinning a page moves it after other pinned pages; unpinning a page moves it before other non-pinned pages.

Pinned pages can still be reordered between each other.

TabBar will display pinned pages in a compact form, never showing the title or close button, and only showing a single icon, selected in the following order:

1. TabPage:indicator-icon 2. A spinner if TabPage:loading is true 3. TabPage:icon 4. TabView:default-icon

Pinned pages cannot be closed by default, see TabView::close-page for how to override that behavior.

func (*TabView) SetSelectedPage

func (t *TabView) SetSelectedPage(selectedPage *TabPage)

SetSelectedPage sets the currently selected page in t.

func (*TabView) SetShortcutWidget

func (t *TabView) SetShortcutWidget(widget gtk.IWidget)

SetShortcutWidget sets the shortcut widget for t.

Registers the following shortcuts on widget: * Ctrl+Page Up - switch to the previous page * Ctrl+Page Down - switch to the next page * Ctrl+Home - switch to the first page * Ctrl+End - switch to the last page * Ctrl+Shift+Page Up - move the current page backward * Ctrl+Shift+Page Down - move the current page forward * Ctrl+Shift+Home - move the current page at the start * Ctrl+Shift+End - move the current page at the end * Ctrl+Tab - switch to the next page, with looping * Ctrl+Shift+Tab - switch to the previous page, with looping * Alt+1-9 - switch to pages 1-9 * Alt+0 - switch to page 10

These shortcuts are always available on t, this function is useful if they should be available globally.

func (*TabView) TransferPage

func (t *TabView) TransferPage(page *TabPage, otherView *TabView, position int)

TransferPage transfers page from t to other_view. The page object will be reused.

It's a programmer error to try to insert a pinned page after a non-pinned one, or a non-pinned page before a pinned one.

type TitleBar

type TitleBar struct {
	gtk.Bin
}

func TitleBarNew

func TitleBarNew() *TitleBar

TitleBarNew creates a new TitleBar.

func (*TitleBar) GetSelectionMode

func (t *TitleBar) GetSelectionMode() bool

GetSelectionMode returns whether whether t is in selection mode.

func (*TitleBar) SetSelectionMode

func (t *TitleBar) SetSelectionMode(selectionMode bool)

SetSelectionMode sets whether t is in selection mode.

type ValueObject

type ValueObject struct {
	*glib.Object
}

func ValueObjectNew

func ValueObjectNew(value *glib.Value) *ValueObject

ValueObjectNew create a new ValueObject.

func ValueObjectNewString

func ValueObjectNewString(string string) *ValueObject

ValueObjectNewString creates a new ValueObject. This is a convenience method to create a ValueObject that stores a string.

func ValueObjectNewTakeString

func ValueObjectNewTakeString(string string) *ValueObject

ValueObjectNewTakeString creates a new ValueObject. This is a convenience method to create a ValueObject that stores a string taking ownership of it.

func (*ValueObject) CopyValue

func (v *ValueObject) CopyValue(dest *glib.Value)

CopyValue copy data from the contained #GValue into dest.

func (*ValueObject) DupString

func (v *ValueObject) DupString() string

DupString returns a copy of the contained string if the value is of type TYPE_STRING.

func (*ValueObject) GetString

func (v *ValueObject) GetString() string

GetString returns the contained string if the value is of type TYPE_STRING.

func (*ValueObject) GetValue

func (v *ValueObject) GetValue() *glib.Value

GetValue return the contained value.

type ViewSwitcher

type ViewSwitcher struct {
	gtk.Bin
}

func ViewSwitcherNew

func ViewSwitcherNew() *ViewSwitcher

ViewSwitcherNew creates a new ViewSwitcher widget.

func (*ViewSwitcher) GetNarrowEllipsize

func (v *ViewSwitcher) GetNarrowEllipsize() pango.EllipsizeMode

GetNarrowEllipsize get the ellipsizing position of the narrow mode label. See (*ViewSwitcher).SetNarrowEllipsize().

func (*ViewSwitcher) GetPolicy

func (v *ViewSwitcher) GetPolicy() ViewSwitcherPolicy

GetPolicy gets the policy of v.

func (*ViewSwitcher) GetStack

func (v *ViewSwitcher) GetStack() *gtk.Stack

GetStack get the Stack being controlled by the ViewSwitcher.

See: (*ViewSwitcher).SetStack()

func (*ViewSwitcher) SetNarrowEllipsize

func (v *ViewSwitcher) SetNarrowEllipsize(mode pango.EllipsizeMode)

SetNarrowEllipsize set the mode used to ellipsize the text in narrow mode if there is not enough space to render the entire string.

func (*ViewSwitcher) SetPolicy

func (v *ViewSwitcher) SetPolicy(policy ViewSwitcherPolicy)

SetPolicy sets the policy of v.

func (*ViewSwitcher) SetStack

func (v *ViewSwitcher) SetStack(stack *gtk.Stack)

SetStack sets the Stack to control.

type ViewSwitcherBar

type ViewSwitcherBar struct {
	gtk.Bin
}

func ViewSwitcherBarNew

func ViewSwitcherBarNew() *ViewSwitcherBar

ViewSwitcherBarNew creates a new ViewSwitcherBar widget.

func (*ViewSwitcherBar) GetPolicy

func (v *ViewSwitcherBar) GetPolicy() ViewSwitcherPolicy

GetPolicy gets the policy of v.

func (*ViewSwitcherBar) GetReveal

func (v *ViewSwitcherBar) GetReveal() bool

GetReveal gets whether v should be revealed or not.

func (*ViewSwitcherBar) GetStack

func (v *ViewSwitcherBar) GetStack() *gtk.Stack

GetStack get the Stack being controlled by the ViewSwitcher.

func (*ViewSwitcherBar) SetPolicy

func (v *ViewSwitcherBar) SetPolicy(policy ViewSwitcherPolicy)

SetPolicy sets the policy of v.

func (*ViewSwitcherBar) SetReveal

func (v *ViewSwitcherBar) SetReveal(reveal bool)

SetReveal sets whether v should be revealed or not.

func (*ViewSwitcherBar) SetStack

func (v *ViewSwitcherBar) SetStack(stack *gtk.Stack)

SetStack sets the Stack to control.

type ViewSwitcherPolicy

type ViewSwitcherPolicy int
const (
	// ViewSwitcherPolicyAuto automatically adapt to the best fitting mode
	ViewSwitcherPolicyAuto ViewSwitcherPolicy = 0
	// ViewSwitcherPolicyNarrow force the narrow mode
	ViewSwitcherPolicyNarrow ViewSwitcherPolicy = 1
	// ViewSwitcherPolicyWide force the wide mode
	ViewSwitcherPolicyWide ViewSwitcherPolicy = 2
)

type ViewSwitcherTitle

type ViewSwitcherTitle struct {
	gtk.Bin
}

func ViewSwitcherTitleNew

func ViewSwitcherTitleNew() *ViewSwitcherTitle

ViewSwitcherTitleNew creates a new ViewSwitcherTitle widget.

func (*ViewSwitcherTitle) GetPolicy

func (v *ViewSwitcherTitle) GetPolicy() ViewSwitcherPolicy

GetPolicy gets the policy of v.

func (*ViewSwitcherTitle) GetStack

func (v *ViewSwitcherTitle) GetStack() *gtk.Stack

GetStack get the Stack being controlled by the ViewSwitcher.

func (*ViewSwitcherTitle) GetSubtitle

func (v *ViewSwitcherTitle) GetSubtitle() string

GetSubtitle gets the subtitle of v. See (*ViewSwitcherTitle).SetSubtitle().

func (*ViewSwitcherTitle) GetTitle

func (v *ViewSwitcherTitle) GetTitle() string

GetTitle gets the title of v. See (*ViewSwitcherTitle).SetTitle().

func (*ViewSwitcherTitle) GetTitleVisible

func (v *ViewSwitcherTitle) GetTitleVisible() bool

GetTitleVisible get whether the title label of v is visible.

func (*ViewSwitcherTitle) GetViewSwitcherEnabled

func (v *ViewSwitcherTitle) GetViewSwitcherEnabled() bool

GetViewSwitcherEnabled gets whether v's view switcher is enabled.

See (*ViewSwitcherTitle).SetViewSwitcherEnabled().

func (*ViewSwitcherTitle) SetPolicy

func (v *ViewSwitcherTitle) SetPolicy(policy ViewSwitcherPolicy)

SetPolicy sets the policy of v.

func (*ViewSwitcherTitle) SetStack

func (v *ViewSwitcherTitle) SetStack(stack *gtk.Stack)

SetStack sets the Stack to control.

func (*ViewSwitcherTitle) SetSubtitle

func (v *ViewSwitcherTitle) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle of v. The subtitle should give a user additional details.

func (*ViewSwitcherTitle) SetTitle

func (v *ViewSwitcherTitle) SetTitle(title string)

SetTitle sets the title of v. The title should give a user additional details. A good title should not include the application name.

func (*ViewSwitcherTitle) SetViewSwitcherEnabled

func (v *ViewSwitcherTitle) SetViewSwitcherEnabled(enabled bool)

SetViewSwitcherEnabled make v enable or disable its view switcher. If it is disabled, the title will be displayed instead. This allows to programmatically and prematurely hide the view switcher of v even if it fits in the available space.

This can be used e.g. to ensure the view switcher is hidden below a certain window width, or any other constraint you find suitable.

type Window

type Window struct {
	gtk.Window
}

func WindowNew

func WindowNew() *Window

WindowNew creates a new Window.

type WindowHandle

type WindowHandle struct {
	gtk.EventBox
}

func WindowHandleNew

func WindowHandleNew() *WindowHandle

WindowHandleNew creates a new WindowHandle.

Directories

Path Synopsis
cmd
internal
gir
Package gir provides a roughly-written gir generator.
Package gir provides a roughly-written gir generator.

Jump to

Keyboard shortcuts

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