adw

package
v0.0.0-...-5f283b5 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MPL-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const DURATION_INFINITE = 4294967295

DURATION_INFINITE indicates an animation with an infinite duration.

This value is mostly used internally.

View Source
const MAJOR_VERSION = 1

MAJOR_VERSION: adwaita major version component (e.g. 1 if the version is 1.2.3).

View Source
const MICRO_VERSION = 2

MICRO_VERSION: adwaita micro version component (e.g. 3 if the version is 1.2.3).

View Source
const MINOR_VERSION = 4

MINOR_VERSION: adwaita minor version component (e.g. 2 if the version is 1.2.3).

View Source
const VERSION_S = "1.4.2"

VERSION_S: adwaita version, encoded as a string, useful for printing and concatenation.

Variables

View Source
var (
	GTypeAnimationTarget         = coreglib.Type(C.adw_animation_target_get_type())
	GTypeCallbackAnimationTarget = coreglib.Type(C.adw_callback_animation_target_get_type())
)

GType values.

View Source
var (
	GTypeAnimationState = coreglib.Type(C.adw_animation_state_get_type())
	GTypeAnimation      = coreglib.Type(C.adw_animation_get_type())
)

GType values.

View Source
var (
	GTypeBreakpointConditionLengthType = coreglib.Type(C.adw_breakpoint_condition_length_type_get_type())
	GTypeBreakpointConditionRatioType  = coreglib.Type(C.adw_breakpoint_condition_ratio_type_get_type())
	GTypeBreakpoint                    = coreglib.Type(C.adw_breakpoint_get_type())
	GTypeBreakpointCondition           = coreglib.Type(C.adw_breakpoint_condition_get_type())
)

GType values.

View Source
var (
	GTypeEnumListItem  = coreglib.Type(C.adw_enum_list_item_get_type())
	GTypeEnumListModel = coreglib.Type(C.adw_enum_list_model_get_type())
)

GType values.

View Source
var (
	GTypeFlapFoldPolicy     = coreglib.Type(C.adw_flap_fold_policy_get_type())
	GTypeFlapTransitionType = coreglib.Type(C.adw_flap_transition_type_get_type())
	GTypeFlap               = coreglib.Type(C.adw_flap_get_type())
)

GType values.

View Source
var (
	GTypeCenteringPolicy = coreglib.Type(C.adw_centering_policy_get_type())
	GTypeHeaderBar       = coreglib.Type(C.adw_header_bar_get_type())
)

GType values.

View Source
var (
	GTypeLeafletTransitionType = coreglib.Type(C.adw_leaflet_transition_type_get_type())
	GTypeLeaflet               = coreglib.Type(C.adw_leaflet_get_type())
	GTypeLeafletPage           = coreglib.Type(C.adw_leaflet_page_get_type())
)

GType values.

View Source
var (
	GTypeResponseAppearance = coreglib.Type(C.adw_response_appearance_get_type())
	GTypeMessageDialog      = coreglib.Type(C.adw_message_dialog_get_type())
)

GType values.

View Source
var (
	GTypeNavigationPage = coreglib.Type(C.adw_navigation_page_get_type())
	GTypeNavigationView = coreglib.Type(C.adw_navigation_view_get_type())
)

GType values.

View Source
var (
	GTypeSqueezerTransitionType = coreglib.Type(C.adw_squeezer_transition_type_get_type())
	GTypeSqueezer               = coreglib.Type(C.adw_squeezer_get_type())
	GTypeSqueezerPage           = coreglib.Type(C.adw_squeezer_page_get_type())
)

GType values.

View Source
var (
	GTypeColorScheme  = coreglib.Type(C.adw_color_scheme_get_type())
	GTypeStyleManager = coreglib.Type(C.adw_style_manager_get_type())
)

GType values.

View Source
var (
	GTypeTabPage = coreglib.Type(C.adw_tab_page_get_type())
	GTypeTabView = coreglib.Type(C.adw_tab_view_get_type())
)

GType values.

View Source
var (
	GTypeToastPriority = coreglib.Type(C.adw_toast_priority_get_type())
	GTypeToast         = coreglib.Type(C.adw_toast_get_type())
)

GType values.

View Source
var (
	GTypeToolbarStyle = coreglib.Type(C.adw_toolbar_style_get_type())
	GTypeToolbarView  = coreglib.Type(C.adw_toolbar_view_get_type())
)

GType values.

View Source
var (
	GTypeViewStack     = coreglib.Type(C.adw_view_stack_get_type())
	GTypeViewStackPage = coreglib.Type(C.adw_view_stack_page_get_type())
)

GType values.

View Source
var (
	GTypeViewSwitcherPolicy = coreglib.Type(C.adw_view_switcher_policy_get_type())
	GTypeViewSwitcher       = coreglib.Type(C.adw_view_switcher_get_type())
)

GType values.

View Source
var (
	GTypeAboutWindow = coreglib.Type(C.adw_about_window_get_type())
)

GType values.

View Source
var (
	GTypeActionRow = coreglib.Type(C.adw_action_row_get_type())
)

GType values.

View Source
var (
	GTypeApplication = coreglib.Type(C.adw_application_get_type())
)

GType values.

View Source
var (
	GTypeApplicationWindow = coreglib.Type(C.adw_application_window_get_type())
)

GType values.

View Source
var (
	GTypeAvatar = coreglib.Type(C.adw_avatar_get_type())
)

GType values.

View Source
var (
	GTypeBanner = coreglib.Type(C.adw_banner_get_type())
)

GType values.

View Source
var (
	GTypeBin = coreglib.Type(C.adw_bin_get_type())
)

GType values.

View Source
var (
	GTypeBreakpointBin = coreglib.Type(C.adw_breakpoint_bin_get_type())
)

GType values.

View Source
var (
	GTypeButtonContent = coreglib.Type(C.adw_button_content_get_type())
)

GType values.

View Source
var (
	GTypeCarousel = coreglib.Type(C.adw_carousel_get_type())
)

GType values.

View Source
var (
	GTypeCarouselIndicatorDots = coreglib.Type(C.adw_carousel_indicator_dots_get_type())
)

GType values.

View Source
var (
	GTypeCarouselIndicatorLines = coreglib.Type(C.adw_carousel_indicator_lines_get_type())
)

GType values.

View Source
var (
	GTypeClamp = coreglib.Type(C.adw_clamp_get_type())
)

GType values.

View Source
var (
	GTypeClampLayout = coreglib.Type(C.adw_clamp_layout_get_type())
)

GType values.

View Source
var (
	GTypeClampScrollable = coreglib.Type(C.adw_clamp_scrollable_get_type())
)

GType values.

View Source
var (
	GTypeComboRow = coreglib.Type(C.adw_combo_row_get_type())
)

GType values.

View Source
var (
	GTypeEasing = coreglib.Type(C.adw_easing_get_type())
)

GType values.

View Source
var (
	GTypeEntryRow = coreglib.Type(C.adw_entry_row_get_type())
)

GType values.

View Source
var (
	GTypeExpanderRow = coreglib.Type(C.adw_expander_row_get_type())
)

GType values.

View Source
var (
	GTypeFoldThresholdPolicy = coreglib.Type(C.adw_fold_threshold_policy_get_type())
)

GType values.

View Source
var (
	GTypeLengthUnit = coreglib.Type(C.adw_length_unit_get_type())
)

GType values.

View Source
var (
	GTypeNavigationDirection = coreglib.Type(C.adw_navigation_direction_get_type())
)

GType values.

View Source
var (
	GTypeNavigationSplitView = coreglib.Type(C.adw_navigation_split_view_get_type())
)

GType values.

View Source
var (
	GTypeOverlaySplitView = coreglib.Type(C.adw_overlay_split_view_get_type())
)

GType values.

View Source
var (
	GTypePasswordEntryRow = coreglib.Type(C.adw_password_entry_row_get_type())
)

GType values.

View Source
var (
	GTypePreferencesGroup = coreglib.Type(C.adw_preferences_group_get_type())
)

GType values.

View Source
var (
	GTypePreferencesPage = coreglib.Type(C.adw_preferences_page_get_type())
)

GType values.

View Source
var (
	GTypePreferencesRow = coreglib.Type(C.adw_preferences_row_get_type())
)

GType values.

View Source
var (
	GTypePreferencesWindow = coreglib.Type(C.adw_preferences_window_get_type())
)

GType values.

View Source
var (
	GTypePropertyAnimationTarget = coreglib.Type(C.adw_property_animation_target_get_type())
)

GType values.

View Source
var (
	GTypeSpinRow = coreglib.Type(C.adw_spin_row_get_type())
)

GType values.

View Source
var (
	GTypeSplitButton = coreglib.Type(C.adw_split_button_get_type())
)

GType values.

View Source
var (
	GTypeSpringAnimation = coreglib.Type(C.adw_spring_animation_get_type())
)

GType values.

View Source
var (
	GTypeSpringParams = coreglib.Type(C.adw_spring_params_get_type())
)

GType values.

View Source
var (
	GTypeStatusPage = coreglib.Type(C.adw_status_page_get_type())
)

GType values.

View Source
var (
	GTypeSwipeTracker = coreglib.Type(C.adw_swipe_tracker_get_type())
)

GType values.

View Source
var (
	GTypeSwipeable = coreglib.Type(C.adw_swipeable_get_type())
)

GType values.

View Source
var (
	GTypeSwitchRow = coreglib.Type(C.adw_switch_row_get_type())
)

GType values.

View Source
var (
	GTypeTabBar = coreglib.Type(C.adw_tab_bar_get_type())
)

GType values.

View Source
var (
	GTypeTabButton = coreglib.Type(C.adw_tab_button_get_type())
)

GType values.

View Source
var (
	GTypeTabOverview = coreglib.Type(C.adw_tab_overview_get_type())
)

GType values.

View Source
var (
	GTypeTabViewShortcuts = coreglib.Type(C.adw_tab_view_shortcuts_get_type())
)

GType values.

View Source
var (
	GTypeTimedAnimation = coreglib.Type(C.adw_timed_animation_get_type())
)

GType values.

View Source
var (
	GTypeToastOverlay = coreglib.Type(C.adw_toast_overlay_get_type())
)

GType values.

View Source
var (
	GTypeViewStackPages = coreglib.Type(C.adw_view_stack_pages_get_type())
)

GType values.

View Source
var (
	GTypeViewSwitcherBar = coreglib.Type(C.adw_view_switcher_bar_get_type())
)

GType values.

View Source
var (
	GTypeViewSwitcherTitle = coreglib.Type(C.adw_view_switcher_title_get_type())
)

GType values.

View Source
var (
	GTypeWindow = coreglib.Type(C.adw_window_get_type())
)

GType values.

View Source
var (
	GTypeWindowTitle = coreglib.Type(C.adw_window_title_get_type())
)

GType values.

Functions

func EasingEase

func EasingEase(self Easing, value float64) float64

EasingEase computes easing with easing for value.

value should generally be in the [0, 1] range.

The function takes the following parameters:

  • self: easing value.
  • value to ease.

The function returns the following values:

  • gdouble: easing for value.

func GetEnableAnimations

func GetEnableAnimations(widget gtk.Widgetter) bool

GetEnableAnimations checks whether animations are enabled for widget.

This should be used when implementing an animated widget to know whether to animate it or not.

The function takes the following parameters:

  • widget: GtkWidget.

The function returns the following values:

  • ok: whether animations are enabled for widget.

func GetMajorVersion

func GetMajorVersion() uint

GetMajorVersion returns the major version number of the Adwaita library.

For example, in libadwaita version 1.2.3 this is 1.

This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the major_version constant, which represents the major version of the libadwaita headers you have included when compiling your code.

The function returns the following values:

  • guint: major version number of the Adwaita library.

func GetMicroVersion

func GetMicroVersion() uint

GetMicroVersion returns the micro version number of the Adwaita library.

For example, in libadwaita version 1.2.3 this is 3.

This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the major_version constant, which represents the micro version of the libadwaita headers you have included when compiling your code.

The function returns the following values:

  • guint: micro version number of the Adwaita library.

func GetMinorVersion

func GetMinorVersion() uint

GetMinorVersion returns the minor version number of the Adwaita library.

For example, in libadwaita version 1.2.3 this is 2.

This function is in the library, so it represents the libadwaita library your code is running against. Contrast with the major_version constant, which represents the minor version of the libadwaita headers you have included when compiling your code.

The function returns the following values:

  • guint: minor version number of the Adwaita library.

func Init

func Init()

Init initializes Libadwaita.

This function can be used instead of gtk.Init() as it initializes GTK implicitly.

There's no need to call this function if you're using application.

If Libadwaita has already been initialized, the function will simply return.

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

func IsInitialized

func IsInitialized() bool

IsInitialized: use this function to check if libadwaita has been initialized with init.

The function returns the following values:

  • ok: initialization status.

func LengthUnitFromPx

func LengthUnitFromPx(unit LengthUnit, value float64, settings *gtk.Settings) float64

LengthUnitFromPx converts value from pixels to unit.

The function takes the following parameters:

  • unit: length unit.
  • value in pixels.
  • settings (optional) to use, or NULL for default settings.

The function returns the following values:

  • gdouble: length in unit.

func LengthUnitToPx

func LengthUnitToPx(unit LengthUnit, value float64, settings *gtk.Settings) float64

LengthUnitToPx converts value from unit to pixels.

The function takes the following parameters:

  • unit: length unit.
  • value in unit.
  • settings (optional) to use, or NULL for default settings.

The function returns the following values:

  • gdouble: length in pixels.

func Lerp

func Lerp(a, b, t float64) float64

Lerp computes the linear interpolation between a and b for t.

The function takes the following parameters:

  • a: start.
  • b: end.
  • t: interpolation rate.

The function returns the following values:

  • gdouble: computed value.

Types

type AboutWindow

type AboutWindow struct {
	Window
	// contains filtered or unexported fields
}

AboutWindow: window showing information about the application.

<picture> <source srcset="about-window-dark.png" media="(prefers-color-scheme: dark)"> <img src="about-window.png" alt="about-window"> </picture>

An about window is typically opened when the user activates the About … item in the application's primary menu. All parts of the window are optional.

Main page

AdwAboutWindow prominently displays the application's icon, name, developer name and version. They can be set with the aboutwindow:application-icon, aboutwindow:application-name, aboutwindow:developer-name and aboutwindow:version respectively.

What's New

AdwAboutWindow provides a way for applications to display their release notes, set with the aboutwindow:release-notes property.

Release notes are formatted the same way as AppStream descriptions (https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).

The supported formatting options are:

* Paragraph (<p>) * Ordered list (<ol>), with list items (<li>) * Unordered list (<ul>), with list items (<li>)

Within paragraphs and list items, emphasis (<em>) and inline code (<code>) text styles are supported. The emphasis is rendered in italic, while inline code is shown in a monospaced font.

Any text outside paragraphs or list items is ignored.

Nested lists are not supported.

Only one version can be shown at a time. By default, the displayed version number matches aboutwindow:version. Use aboutwindow:release-notes-version to override it.

Details

The Details page displays the application comments and links.

The comments can be set with the aboutwindow:comments property. Unlike gtk.AboutDialog:comments, this string can be long and detailed. It can also contain links and Pango markup.

To set the application website, use aboutwindow:website. To add extra links below the website, use aboutwindow.AddLink.

If the Details page doesn't have any other content besides website, the website will be displayed on the main page instead.

Troubleshooting

AdwAboutWindow displays the following two links on the main page:

* Support Questions, set with the aboutwindow:support-url property, * Report an Issue, set with the aboutwindow:issue-url property.

Additionally, applications can provide debugging information. It will be shown separately on the Troubleshooting page. Use the aboutwindow:debug-info property to specify it.

It's intended to be attached to issue reports when reporting issues against the application. As such, it cannot contain markup or links.

AdwAboutWindow provides a quick way to save debug information to a file. When saving, aboutwindow:debug-info-filename would be used as the suggested filename.

Credits and Acknowledgements

The Credits page has the following default sections:

* Developers, set with the aboutwindow:developers property, * Designers, set with the aboutwindow:designers property, * Artists, set with the aboutwindow:artists property, * Documenters, set with the aboutwindow:documenters property, * Translators, set with the aboutwindow:translator-credits property.

When setting translator credits, use the strings "translator-credits" or "translator_credits" and mark them as translatable.

The default sections that don't contain any names won't be displayed.

The Credits page can also contain an arbitrary number of extra sections below the default ones. Use aboutwindow.AddCreditSection to add them.

The Acknowledgements page can be used to acknowledge additional people and organizations for their non-development contributions. Use aboutwindow.AddAcknowledgementSection to add sections to it. For example, it can be used to list backers in a crowdfunded project or to give special thanks.

Each of the people or organizations can have an email address or a website specified. To add a email address, use a string like Edgar Allan Poe <edgarpoe.com>. To specify a website with a title, use a string like The GNOME Project https://www.gnome.org:

<picture> <source srcset="about-window-credits-dark.png" media="(prefers-color-scheme: dark)"> <img src="about-window-credits.png" alt="about-window-credits"> </picture>

The Legal page displays the copyright and licensing information for the application and other modules.

The copyright string is set with the aboutwindow:copyright property and should be a short string of one or two lines, for example: © 2022 Example.

Licensing information can be quickly set from a list of known licenses with the aboutwindow:license-type property. If the application's license is not in the list, aboutwindow:license can be used instead.

To add information about other modules, such as application dependencies or data, use aboutwindow.AddLegalSection.

Constructing

To make constructing an AdwAboutWindow as convenient as possible, you can use the function show_about_window which constructs and shows a window.

static void
show_about (GtkApplication *app)
{
  const char *developers[] = {
    "Angela Avery",
    NULL
  };

  const char *designers[] = {
    "GNOME Design Team",
    NULL
  };

  adw_show_about_window (gtk_application_get_active_window (app),
                         "application-name", _("Example"),
                         "application-icon", "org.example.App",
                         "version", "1.2.3",
                         "copyright", "© 2022 Angela Avery",
                         "issue-url", "https://gitlab.gnome.org/example/example/-/issues/new",
                         "license-type", GTK_LICENSE_GPL_3_0,
                         "developers", developers,
                         "designers", designers,
                         "translator-credits", _("translator-credits"),
                         NULL);
}

CSS nodes

AdwAboutWindow has a main CSS node with the name window and the style class .about.

func NewAboutWindow

func NewAboutWindow() *AboutWindow

NewAboutWindow creates a new AdwAboutWindow.

The function returns the following values:

  • aboutWindow: newly created AdwAboutWindow.

func NewAboutWindowFromAppdata

func NewAboutWindowFromAppdata(resourcePath, releaseNotesVersion string) *AboutWindow

NewAboutWindowFromAppdata creates a new AdwAboutWindow using AppStream metadata.

This automatically sets the following properties with the following AppStream values:

* aboutwindow:application-icon is set from the <id> * aboutwindow:application-name is set from the <name> * aboutwindow:developer-name is set from the <developer_name> * aboutwindow:version is set from the version of the latest release * aboutwindow:website is set from the <url type="homepage"> * aboutwindow:support-url is set from the <url type="help"> * aboutwindow:issue-url is set from the <url type="bugtracker"> * aboutwindow:license-type is set from the <project_license> If the license type retrieved from AppStream is not listed in gtk.License, it will be set to GTK_LICENCE_CUSTOM.

If release_notes_version is not NULL, aboutwindow:release-notes-version is set to match it, while aboutwindow:release-notes is set from the AppStream release description for that version.

The function takes the following parameters:

  • resourcePath: resource to use.
  • releaseNotesVersion (optional): version to retrieve release notes for.

The function returns the following values:

  • aboutWindow: newly created AdwAboutWindow.

func (*AboutWindow) AddAcknowledgementSection

func (self *AboutWindow) AddAcknowledgementSection(name string, people []string)

AddAcknowledgementSection adds a section to the Acknowledgements page.

This can be used to acknowledge additional people and organizations for their non-development contributions - for example, backers in a crowdfunded project.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:designers * aboutwindow:artists * aboutwindow:documenters * aboutwindow:translator-credits * aboutwindow.AddCreditSection.

The function takes the following parameters:

  • name (optional): section name.
  • people: list of names.

func (*AboutWindow) AddCreditSection

func (self *AboutWindow) AddCreditSection(name string, people []string)

AddCreditSection adds an extra section to the Credits page.

Extra sections are displayed below the standard categories.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:designers * aboutwindow:artists * aboutwindow:documenters * aboutwindow:translator-credits * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • name (optional): section name.
  • people: list of names.

func (*AboutWindow) AddLegalSection

func (self *AboutWindow) AddLegalSection(title, copyright string, licenseType gtk.License, license string)

AddLegalSection adds an extra section to the Legal page.

Extra sections will be displayed below the application's own information.

The parameters copyright, license_type and license will be used to present the it the same way as aboutwindow:copyright, aboutwindow:license-type and aboutwindow:license are for the application's own information.

See those properties for more details.

This can be useful to attribute the application dependencies or data.

Examples:

adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
                                    _("Copyright and a known license"),
                                    "© 2022 Example",
                                    GTK_LICENSE_LGPL_2_1,
                                    NULL);

adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
                                    _("Copyright and custom license"),
                                    "© 2022 Example",
                                    GTK_LICENSE_CUSTOM,
                                    "Custom license text");

adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
                                    _("Copyright only"),
                                    "© 2022 Example",
                                    GTK_LICENSE_UNKNOWN,
                                    NULL);

adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
                                    _("Custom license only"),
                                    NULL,
                                    GTK_LICENSE_CUSTOM,
                                    "Something completely custom here.");.

The function takes the following parameters:

  • title: name of the section.
  • copyright (optional) string.
  • licenseType: type of license.
  • license (optional): custom license information.
func (self *AboutWindow) AddLink(title, url string)

AddLink adds an extra link to the Details page.

Extra links are displayed under the comment and website.

Underlines in title will be interpreted as indicating a mnemonic.

See aboutwindow:website.

The function takes the following parameters:

  • title: link title.
  • url: link URL.

func (*AboutWindow) ApplicationIcon

func (self *AboutWindow) ApplicationIcon() string

ApplicationIcon gets the name of the application icon for self.

The function returns the following values:

  • utf8: application icon name.

func (*AboutWindow) ApplicationName

func (self *AboutWindow) ApplicationName() string

ApplicationName gets the application name for self.

The function returns the following values:

  • utf8: application name.

func (*AboutWindow) Artists

func (self *AboutWindow) Artists() []string

Artists gets the list of artists of the application.

The function returns the following values:

  • utf8s (optional): list of artists.

func (*AboutWindow) Comments

func (self *AboutWindow) Comments() string

Comments gets the comments about the application.

The function returns the following values:

  • utf8: comments.
func (self *AboutWindow) ConnectActivateLink(f func(uri string) (ok bool)) coreglib.SignalHandle

ConnectActivateLink is emitted when a URL is activated.

Applications may connect to it to override the default behavior, which is to call gtk.ShowURI().

func (*AboutWindow) Copyright

func (self *AboutWindow) Copyright() string

Copyright gets the copyright information for self.

The function returns the following values:

  • utf8: copyright information.

func (*AboutWindow) DebugInfo

func (self *AboutWindow) DebugInfo() string

DebugInfo gets the debug information for self.

The function returns the following values:

  • utf8: debug information.

func (*AboutWindow) DebugInfoFilename

func (self *AboutWindow) DebugInfoFilename() string

DebugInfoFilename gets the debug information filename for self.

The function returns the following values:

  • utf8: debug information filename.

func (*AboutWindow) Designers

func (self *AboutWindow) Designers() []string

Designers gets the list of designers of the application.

The function returns the following values:

  • utf8s (optional): list of designers.

func (*AboutWindow) DeveloperName

func (self *AboutWindow) DeveloperName() string

DeveloperName gets the developer name for self.

The function returns the following values:

  • utf8: developer_name.

func (*AboutWindow) Developers

func (self *AboutWindow) Developers() []string

Developers gets the list of developers of the application.

The function returns the following values:

  • utf8s (optional): list of developers.

func (*AboutWindow) Documenters

func (self *AboutWindow) Documenters() []string

Documenters gets the list of documenters of the application.

The function returns the following values:

  • utf8s (optional): list of documenters.

func (*AboutWindow) IssueURL

func (self *AboutWindow) IssueURL() string

IssueURL gets the issue tracker URL for self.

The function returns the following values:

  • utf8: issue tracker URL.

func (*AboutWindow) License

func (self *AboutWindow) License() string

License gets the license for self.

The function returns the following values:

  • utf8: license.

func (*AboutWindow) LicenseType

func (self *AboutWindow) LicenseType() gtk.License

LicenseType gets the license type for self.

The function returns the following values:

  • license type.

func (*AboutWindow) ReleaseNotes

func (self *AboutWindow) ReleaseNotes() string

ReleaseNotes gets the release notes for self.

The function returns the following values:

  • utf8: release notes.

func (*AboutWindow) ReleaseNotesVersion

func (self *AboutWindow) ReleaseNotesVersion() string

ReleaseNotesVersion gets the version described by the application's release notes.

The function returns the following values:

  • utf8: release notes version.

func (*AboutWindow) SetApplicationIcon

func (self *AboutWindow) SetApplicationIcon(applicationIcon string)

SetApplicationIcon sets the name of the application icon for self.

The icon is displayed at the top of the main page.

The function takes the following parameters:

  • applicationIcon: application icon name.

func (*AboutWindow) SetApplicationName

func (self *AboutWindow) SetApplicationName(applicationName string)

SetApplicationName sets the application name for self.

The name is displayed at the top of the main page.

The function takes the following parameters:

  • applicationName: application name.

func (*AboutWindow) SetArtists

func (self *AboutWindow) SetArtists(artists []string)

SetArtists sets the list of artists of the application.

It will be displayed on the Credits page.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:designers * aboutwindow:documenters * aboutwindow:translator-credits * aboutwindow.AddCreditSection * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • artists (optional): list of artists.

func (*AboutWindow) SetComments

func (self *AboutWindow) SetComments(comments string)

SetComments sets the comments about the application.

Comments will be shown on the Details page, above links.

Unlike gtk.AboutDialog:comments, this string can be long and detailed. It can also contain links and Pango markup.

The function takes the following parameters:

  • comments: comments.

func (*AboutWindow) SetCopyright

func (self *AboutWindow) SetCopyright(copyright string)

SetCopyright sets the copyright information for self.

This should be a short string of one or two lines, for example: © 2022 Example.

The copyright information will be displayed on the Legal page, before the application license.

aboutwindow.AddLegalSection can be used to add copyright information for the application dependencies or other components.

The function takes the following parameters:

  • copyright information.

func (*AboutWindow) SetDebugInfo

func (self *AboutWindow) SetDebugInfo(debugInfo string)

SetDebugInfo sets the debug information for self.

Debug information will be shown on the Troubleshooting page. It's intended to be attached to issue reports when reporting issues against the application.

AdwAboutWindow provides a quick way to save debug information to a file. When saving, aboutwindow:debug-info-filename would be used as the suggested filename.

Debug information cannot contain markup or links.

The function takes the following parameters:

  • debugInfo: debug information.

func (*AboutWindow) SetDebugInfoFilename

func (self *AboutWindow) SetDebugInfoFilename(filename string)

SetDebugInfoFilename sets the debug information filename for self.

It will be used as the suggested filename when saving debug information to a file.

See aboutwindow:debug-info.

The function takes the following parameters:

  • filename: debug info filename.

func (*AboutWindow) SetDesigners

func (self *AboutWindow) SetDesigners(designers []string)

SetDesigners sets the list of designers of the application.

It will be displayed on the Credits page.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:artists * aboutwindow:documenters * aboutwindow:translator-credits * aboutwindow.AddCreditSection * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • designers (optional): list of designers.

func (*AboutWindow) SetDeveloperName

func (self *AboutWindow) SetDeveloperName(developerName string)

SetDeveloperName sets the developer name for self.

The developer name is displayed on the main page, under the application name.

If the application is developed by multiple people, the developer name can be set to values like "AppName team", "AppName developers" or "The AppName project", and the individual contributors can be listed on the Credits page, with aboutwindow:developers and related properties.

The function takes the following parameters:

  • developerName: developer name.

func (*AboutWindow) SetDevelopers

func (self *AboutWindow) SetDevelopers(developers []string)

SetDevelopers sets the list of developers of the application.

It will be displayed on the Credits page.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:designers * aboutwindow:artists * aboutwindow:documenters * aboutwindow:translator-credits * aboutwindow.AddCreditSection * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • developers (optional): list of developers.

func (*AboutWindow) SetDocumenters

func (self *AboutWindow) SetDocumenters(documenters []string)

SetDocumenters sets the list of documenters of the application.

It will be displayed on the Credits page.

Each name may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:designers * aboutwindow:artists * aboutwindow:translator-credits * aboutwindow.AddCreditSection * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • documenters (optional): list of documenters.

func (*AboutWindow) SetIssueURL

func (self *AboutWindow) SetIssueURL(issueUrl string)

SetIssueURL sets the issue tracker URL for self.

The issue tracker link is displayed on the main page.

The function takes the following parameters:

  • issueUrl: issue tracker URL.

func (*AboutWindow) SetLicense

func (self *AboutWindow) SetLicense(license string)

SetLicense sets the license for self.

This can be used to set a custom text for the license if it can't be set via aboutwindow:license-type.

When set, aboutwindow:license-type will be set to GTK_LICENSE_CUSTOM.

The license text will be displayed on the Legal page, below the copyright information.

License text can contain Pango markup and links.

aboutwindow.AddLegalSection can be used to add license information for the application dependencies or other components.

The function takes the following parameters:

  • license: license.

func (*AboutWindow) SetLicenseType

func (self *AboutWindow) SetLicenseType(licenseType gtk.License)

SetLicenseType sets the license for self from a list of known licenses.

If the application's license is not in the list, aboutwindow:license can be used instead. The license type will be automatically set to GTK_LICENSE_CUSTOM in that case.

If license_type is GTK_LICENSE_UNKNOWN, no information will be displayed.

If license_type is different from GTK_LICENSE_CUSTOM. aboutwindow:license will be cleared out.

The license description will be displayed on the Legal page, below the copyright information.

aboutwindow.AddLegalSection can be used to add license information for the application dependencies or other components.

The function takes the following parameters:

  • licenseType: license type.

func (*AboutWindow) SetReleaseNotes

func (self *AboutWindow) SetReleaseNotes(releaseNotes string)

SetReleaseNotes sets the release notes for self.

Release notes are displayed on the the What's New page.

Release notes are formatted the same way as AppStream descriptions (https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).

The supported formatting options are:

* Paragraph (<p>) * Ordered list (<ol>), with list items (<li>) * Unordered list (<ul>), with list items (<li>)

Within paragraphs and list items, emphasis (<em>) and inline code (<code>) text styles are supported. The emphasis is rendered in italic, while inline code is shown in a monospaced font.

Any text outside paragraphs or list items is ignored.

Nested lists are not supported.

AdwAboutWindow displays the version above the release notes. If set, the aboutwindow:release-notes-version of the property will be used as the version; otherwise, aboutwindow:version is used.

The function takes the following parameters:

  • releaseNotes: release notes.

func (*AboutWindow) SetReleaseNotesVersion

func (self *AboutWindow) SetReleaseNotesVersion(version string)

SetReleaseNotesVersion sets the version described by the application's release notes.

The release notes version is displayed on the What's New page, above the release notes.

If not set, aboutwindow:version will be used instead.

For example, an application with the current version 2.0.2 might want to keep the release notes from 2.0.0, and set the release notes version accordingly.

See aboutwindow:release-notes.

The function takes the following parameters:

  • version: release notes version.

func (*AboutWindow) SetSupportURL

func (self *AboutWindow) SetSupportURL(supportUrl string)

SetSupportURL sets the URL of the support page for self.

The support page link is displayed on the main page.

The function takes the following parameters:

  • supportUrl: support page URL.

func (*AboutWindow) SetTranslatorCredits

func (self *AboutWindow) SetTranslatorCredits(translatorCredits string)

SetTranslatorCredits sets the translator credits string.

It will be displayed on the Credits page.

This string should be "translator-credits" or "translator_credits" and should be marked as translatable.

The string may contain email addresses and URLs, see the introduction for more details.

See also:

* aboutwindow:developers * aboutwindow:designers * aboutwindow:artists * aboutwindow:documenters * aboutwindow.AddCreditSection * aboutwindow.AddAcknowledgementSection.

The function takes the following parameters:

  • translatorCredits: translator credits.

func (*AboutWindow) SetVersion

func (self *AboutWindow) SetVersion(version string)

SetVersion sets the version for self.

The version is displayed on the main page.

If aboutwindow:release-notes-version is not set, the version will also be displayed above the release notes on the What's New page.

The function takes the following parameters:

  • version: version.

func (*AboutWindow) SetWebsite

func (self *AboutWindow) SetWebsite(website string)

SetWebsite sets the application website URL for self.

Website is displayed on the Details page, below comments, or on the main page if the Details page doesn't have any other content.

Applications can add other links below, see aboutwindow.AddLink.

The function takes the following parameters:

  • website URL.

func (*AboutWindow) SupportURL

func (self *AboutWindow) SupportURL() string

SupportURL gets the URL of the support page for self.

The function returns the following values:

  • utf8: support page URL.

func (*AboutWindow) TranslatorCredits

func (self *AboutWindow) TranslatorCredits() string

TranslatorCredits gets the translator credits string.

The function returns the following values:

  • utf8: translator credits string.

func (*AboutWindow) Version

func (self *AboutWindow) Version() string

Version gets the version for self.

The function returns the following values:

  • utf8: version.

func (*AboutWindow) Website

func (self *AboutWindow) Website() string

Website gets the application website URL for self.

The function returns the following values:

  • utf8: website URL.

type AboutWindowClass

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

AboutWindowClass: instance of this type is always passed by reference.

func (*AboutWindowClass) ParentClass

func (a *AboutWindowClass) ParentClass() *WindowClass

type AboutWindowOverrides

type AboutWindowOverrides struct {
}

AboutWindowOverrides contains methods that are overridable.

type ActionRow

type ActionRow struct {
	PreferencesRow
	// contains filtered or unexported fields
}

ActionRow: gtk.ListBoxRow used to present actions.

<picture> <source srcset="action-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="action-row.png" alt="action-row"> </picture>

The AdwActionRow widget can have a title, a subtitle and an icon. The row can receive additional widgets at its end, or prefix widgets at its start.

It is convenient to present a preference and its related actions.

AdwActionRow is unactivatable by default, giving it an activatable widget will automatically make it activatable, but unsetting it won't change the row's activatability.

AdwActionRow as GtkBuildable

The AdwActionRow implementation of the gtk.Buildable interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a <child> element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwActionRow has a main CSS node with name row.

It contains the subnode box.header for its main horizontal box, and box.title for the vertical box containing the title and subtitle labels.

It contains subnodes label.title and label.subtitle representing respectively the title label and subtitle label.

func NewActionRow

func NewActionRow() *ActionRow

NewActionRow creates a new AdwActionRow.

The function returns the following values:

  • actionRow: newly created AdwActionRow.

func (*ActionRow) ActivatableWidget

func (self *ActionRow) ActivatableWidget() gtk.Widgetter

ActivatableWidget gets the widget activated when self is activated.

The function returns the following values:

  • widget (optional): activatable widget for self.

func (*ActionRow) Activate

func (self *ActionRow) Activate()

Activate activates self.

func (*ActionRow) AddPrefix

func (self *ActionRow) AddPrefix(widget gtk.Widgetter)

AddPrefix adds a prefix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*ActionRow) AddSuffix

func (self *ActionRow) AddSuffix(widget gtk.Widgetter)

AddSuffix adds a suffix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*ActionRow) ConnectActivated

func (self *ActionRow) ConnectActivated(f func()) coreglib.SignalHandle

ConnectActivated: this signal is emitted after the row has been activated.

func (*ActionRow) IconName deprecated

func (self *ActionRow) IconName() string

IconName gets the icon name for self.

Deprecated: Use actionrow.AddPrefix to add an icon.

The function returns the following values:

  • utf8 (optional): icon name for self.

func (*ActionRow) Remove

func (self *ActionRow) Remove(widget gtk.Widgetter)

Remove removes a child from self.

The function takes the following parameters:

  • widget: child to be removed.

func (*ActionRow) SetActivatableWidget

func (self *ActionRow) SetActivatableWidget(widget gtk.Widgetter)

SetActivatableWidget sets the widget to activate when self is activated.

The row can be activated either by clicking on it, calling actionrow.Activate, or via mnemonics in the title. See the preferencesrow:use-underline property to enable mnemonics.

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

The function takes the following parameters:

  • widget (optional): target widget.

func (*ActionRow) SetIconName deprecated

func (self *ActionRow) SetIconName(iconName string)

SetIconName sets the icon name for self.

Deprecated: Use actionrow.AddPrefix to add an icon.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*ActionRow) SetSubtitle

func (self *ActionRow) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle for self.

The subtitle is interpreted as Pango markup unless preferencesrow:use-markup is set to FALSE.

The function takes the following parameters:

  • subtitle: subtitle.

func (*ActionRow) SetSubtitleLines

func (self *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.

The function takes the following parameters:

  • subtitleLines: number of lines at the end of which the subtitle label will be ellipsized.

func (*ActionRow) SetSubtitleSelectable

func (self *ActionRow) SetSubtitleSelectable(subtitleSelectable bool)

SetSubtitleSelectable sets whether the user can copy the subtitle from the label

See also gtk.Label:selectable.

The function takes the following parameters:

  • subtitleSelectable: TRUE if the user can copy the subtitle from the label.

func (*ActionRow) SetTitleLines

func (self *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.

The function takes the following parameters:

  • titleLines: number of lines at the end of which the title label will be ellipsized.

func (*ActionRow) Subtitle

func (self *ActionRow) Subtitle() string

Subtitle gets the subtitle for self.

The function returns the following values:

  • utf8 (optional): subtitle for self.

func (*ActionRow) SubtitleLines

func (self *ActionRow) SubtitleLines() int

SubtitleLines gets the number of lines at the end of which the subtitle label will be ellipsized.

The function returns the following values:

  • gint: number of lines at the end of which the subtitle label will be ellipsized.

func (*ActionRow) SubtitleSelectable

func (self *ActionRow) SubtitleSelectable() bool

SubtitleSelectable gets whether the user can copy the subtitle from the label.

The function returns the following values:

  • ok: whether the user can copy the subtitle from the label.

func (*ActionRow) TitleLines

func (self *ActionRow) TitleLines() int

TitleLines gets the number of lines at the end of which the title label will be ellipsized.

The function returns the following values:

  • gint: number of lines at the end of which the title label will be ellipsized.

type ActionRowClass

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

ActionRowClass: instance of this type is always passed by reference.

func (*ActionRowClass) ParentClass

func (a *ActionRowClass) ParentClass() *PreferencesRowClass

ParentClass: parent class.

type ActionRowOverrides

type ActionRowOverrides struct {
	// Activate activates self.
	Activate func()
}

ActionRowOverrides contains methods that are overridable.

type Animation

type Animation struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Animation: base class for animations.

AdwAnimation represents an animation on a widget. It has a target that provides a value to animate, and a state indicating whether the animation hasn't been started yet, is playing, paused or finished.

Currently there are two concrete animation types: timedanimation and springanimation.

AdwAnimation will automatically skip the animation if animation:widget is unmapped, or if gtk.Settings:gtk-enable-animations is FALSE.

The animation::done signal can be used to perform an action after the animation ends, for example hiding a widget after animating its gtk.Widget:opacity to 0.

AdwAnimation will be kept alive while the animation is playing. As such, it's safe to create an animation, start it and immediately unref it: A fire-and-forget animation:

static void
animation_cb (double    value,
              MyObject *self)
{
  // Do something with value
}

static void
my_object_animate (MyObject *self)
{
  AdwAnimationTarget *target =
    adw_callback_animation_target_new ((AdwAnimationTargetFunc) animation_cb,
                                       self, NULL);
  g_autoptr (AdwAnimation) animation =
    adw_timed_animation_new (widget, 0, 1, 250, target);

  adw_animation_play (animation);
}

If there's a chance the previous animation for the same target hasn't yet finished, the previous animation should be stopped first, or the existing AdwAnimation object can be reused.

func BaseAnimation

func BaseAnimation(obj Animationer) *Animation

BaseAnimation returns the underlying base object.

func (*Animation) ConnectDone

func (self *Animation) ConnectDone(f func()) coreglib.SignalHandle

ConnectDone: this signal is emitted when the animation has been completed, either on its own or via calling animation.Skip.

func (*Animation) FollowEnableAnimationsSetting

func (self *Animation) FollowEnableAnimationsSetting() bool

FollowEnableAnimationsSetting gets whether self should be skipped when animations are globally disabled.

The function returns the following values:

  • ok: whether to follow the global setting.

func (*Animation) Pause

func (self *Animation) Pause()

Pause pauses a playing animation for self.

Does nothing if the current state of self isn't ADW_ANIMATION_PLAYING.

Sets animation:state to ADW_ANIMATION_PAUSED.

func (*Animation) Play

func (self *Animation) Play()

Play starts the animation for self.

If the animation is playing, paused or has been completed, restarts it from the beginning. This allows to easily play an animation regardless of whether it's already playing or not.

Sets animation:state to ADW_ANIMATION_PLAYING.

The animation will be automatically skipped if animation:widget is unmapped, or if gtk.Settings:gtk-enable-animations is FALSE.

As such, it's not guaranteed that the animation will actually run. For example, when using glib.IdleAdd() and starting an animation immediately afterwards, it's entirely possible that the idle callback will run after the animation has already finished, and not while it's playing.

func (*Animation) Reset

func (self *Animation) Reset()

Reset resets the animation for self.

Sets animation:state to ADW_ANIMATION_IDLE.

func (*Animation) Resume

func (self *Animation) Resume()

Resume resumes a paused animation for self.

This function must only be used if the animation has been paused with animation.Pause.

Sets animation:state to ADW_ANIMATION_PLAYING.

func (*Animation) SetFollowEnableAnimationsSetting

func (self *Animation) SetFollowEnableAnimationsSetting(setting bool)

SetFollowEnableAnimationsSetting sets whether to skip self when animations are globally disabled.

The default behavior is to skip the animation. Set to FALSE to disable this behavior.

This can be useful for cases where animation is essential, like spinners, or in demo applications. Most other animations should keep it enabled.

See gtk.Settings:gtk-enable-animations.

The function takes the following parameters:

  • setting: whether to follow the global setting.

func (*Animation) SetTarget

func (self *Animation) SetTarget(target AnimationTargetter)

SetTarget sets the target self animates to target.

The function takes the following parameters:

  • target: animation target.

func (*Animation) Skip

func (self *Animation) Skip()

Skip skips the animation for self.

If the animation hasn't been started yet, is playing, or is paused, instantly skips the animation to the end and causes animation::done to be emitted.

Sets animation:state to ADW_ANIMATION_FINISHED.

func (*Animation) State

func (self *Animation) State() AnimationState

State gets the current value of self.

The state indicates whether self is currently playing, paused, finished or hasn't been started yet.

The function returns the following values:

  • animationState: animation value.

func (*Animation) Target

func (self *Animation) Target() AnimationTargetter

Target gets the target self animates.

The function returns the following values:

  • animationTarget: animation target.

func (*Animation) Value

func (self *Animation) Value() float64

Value gets the current value of self.

The function returns the following values:

  • gdouble: current value.

func (*Animation) Widget

func (self *Animation) Widget() gtk.Widgetter

Widget gets the widget self was created for.

It provides the frame clock for the animation. It's not strictly necessary for this widget to be same as the one being animated.

The widget must be mapped in order for the animation to work. If it's not mapped, or if it gets unmapped during an ongoing animation, the animation will be automatically skipped.

The function returns the following values:

  • widget: animation widget.

type AnimationState

type AnimationState C.gint

AnimationState describes the possible states of an animation.

The state can be controlled with animation.Play, animation.Pause, animation.Resume, animation.Reset and animation.Skip.

const (
	// AnimationIdle: animation hasn't started yet.
	AnimationIdle AnimationState = iota
	// AnimationPaused: animation has been paused.
	AnimationPaused
	// AnimationPlaying: animation is currently playing.
	AnimationPlaying
	// AnimationFinished: animation has finished.
	AnimationFinished
)

func (AnimationState) String

func (a AnimationState) String() string

String returns the name in string for AnimationState.

type AnimationTarget

type AnimationTarget struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

AnimationTarget represents a value animation can animate.

func BaseAnimationTarget

func BaseAnimationTarget(obj AnimationTargetter) *AnimationTarget

BaseAnimationTarget returns the underlying base object.

type AnimationTargetFunc

type AnimationTargetFunc func(value float64)

AnimationTargetFunc: prototype for animation targets based on user callbacks.

type AnimationTargetter

type AnimationTargetter interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

AnimationTargetter describes types inherited from class AnimationTarget.

To get the original type, the caller must assert this to an interface or another type.

type Animationer

type Animationer interface {
	coreglib.Objector
	// contains filtered or unexported methods
}

Animationer describes types inherited from class Animation.

To get the original type, the caller must assert this to an interface or another type.

type Application

type Application struct {
	gtk.Application
	// contains filtered or unexported fields
}

Application: base class for Adwaita applications.

AdwApplication handles library initialization by calling init in the default gio.Application::startup signal handler, in turn chaining up as required by gtk.Application. Therefore, any subclass of AdwApplication should always chain up its startup handler before using any Adwaita or GTK API.

Automatic Resources

AdwApplication will automatically load stylesheets located in the application's resource base path (see gio.Application.SetResourceBasePath(), if they're present.

They can be used to add custom styles to the application, as follows:

- style.css contains styles that are always present.

- style-dark.css contains styles only used when stylemanager:dark is TRUE.

- style-hc.css contains styles used when the system high contrast preference is enabled.

- style-hc-dark.css contains styles used when the system high contrast preference is enabled and stylemanager:dark is TRUE.

func NewApplication

func NewApplication(applicationId string, flags gio.ApplicationFlags) *Application

NewApplication creates a new AdwApplication.

If application_id is not NULL, then it must be valid. See gio.Application().IDIsValid.

If no application ID is given then some features (most notably application uniqueness) will be disabled.

The function takes the following parameters:

  • applicationId (optional): application ID.
  • flags: application flags.

The function returns the following values:

  • application: newly created AdwApplication.

func (*Application) StyleManager

func (self *Application) StyleManager() *StyleManager

StyleManager gets the style manager for self.

This is a convenience property allowing to access AdwStyleManager through property bindings or expressions.

The function returns the following values:

  • styleManager: style manager.

type ApplicationClass

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

ApplicationClass: instance of this type is always passed by reference.

func (*ApplicationClass) ParentClass

func (a *ApplicationClass) ParentClass() *gtk.ApplicationClass

ParentClass: parent class.

type ApplicationOverrides

type ApplicationOverrides struct {
}

ApplicationOverrides contains methods that are overridable.

type ApplicationWindow

type ApplicationWindow struct {
	gtk.ApplicationWindow
	// contains filtered or unexported fields
}

ApplicationWindow: freeform application window.

<picture> <source srcset="application-window-dark.png" media="(prefers-color-scheme: dark)"> <img src="application-window.png" alt="application-window"> </picture>

AdwApplicationWindow is a gtk.ApplicationWindow subclass providing the same features as window.

See window for details.

Example of an AdwApplicationWindow UI definition:

<object class="AdwApplicationWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar"/>
      </child>
      <property name="content">
        <!-- ... -->
      </property>
    </object>
  </property>
</object>

Using gtk.Application:menubar is not supported and may result in visual glitches.

func NewApplicationWindow

func NewApplicationWindow(app *gtk.Application) *ApplicationWindow

NewApplicationWindow creates a new AdwApplicationWindow for app.

The function takes the following parameters:

  • app: application instance.

The function returns the following values:

  • applicationWindow: newly created AdwApplicationWindow.

func (*ApplicationWindow) AddBreakpoint

func (self *ApplicationWindow) AddBreakpoint(breakpoint *Breakpoint)

AddBreakpoint adds breakpoint to self.

The function takes the following parameters:

  • breakpoint to add.

func (*ApplicationWindow) Content

func (self *ApplicationWindow) Content() gtk.Widgetter

Content gets the content widget of self.

This method should always be used instead of gtk.Window.GetChild().

The function returns the following values:

  • widget (optional): content widget of self.

func (*ApplicationWindow) CurrentBreakpoint

func (self *ApplicationWindow) CurrentBreakpoint() *Breakpoint

CurrentBreakpoint gets the current breakpoint.

The function returns the following values:

  • breakpoint (optional): current breakpoint.

func (*ApplicationWindow) SetContent

func (self *ApplicationWindow) SetContent(content gtk.Widgetter)

SetContent sets the content widget of self.

This method should always be used instead of gtk.Window.SetChild().

The function takes the following parameters:

  • content (optional) widget.

type ApplicationWindowClass

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

ApplicationWindowClass: instance of this type is always passed by reference.

func (*ApplicationWindowClass) ParentClass

func (a *ApplicationWindowClass) ParentClass() *gtk.ApplicationWindowClass

type ApplicationWindowOverrides

type ApplicationWindowOverrides struct {
}

ApplicationWindowOverrides contains methods that are overridable.

type Avatar

type Avatar struct {
	gtk.Widget
	// contains filtered or unexported fields
}

Avatar: widget displaying an image, with a generated fallback.

<picture> <source srcset="avatar-dark.png" media="(prefers-color-scheme: dark)"> <img src="avatar.png" alt="avatar"> </picture>

AdwAvatar is a widget that shows a round avatar.

AdwAvatar generates an avatar with the initials of the avatar:text on top of a colored background.

The color is picked based on the hash of the avatar:text.

If avatar:show-initials is set to FALSE, avatar:icon-name or avatar-default-symbolic is shown instead of the initials.

Use avatar:custom-image to set a custom image.

CSS nodes

AdwAvatar has a single CSS node with name avatar.

func NewAvatar

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

NewAvatar creates a new AdwAvatar.

The function takes the following parameters:

  • size of the avatar.
  • text (optional) used to get the initials and color.
  • showInitials: whether to use initials instead of an icon as fallback.

The function returns the following values:

  • avatar: newly created AdwAvatar.

func (*Avatar) CustomImage

func (self *Avatar) CustomImage() *gdk.Paintable

CustomImage gets the custom image paintable.

The function returns the following values:

  • paintable (optional): custom image.

func (*Avatar) DrawToTexture

func (self *Avatar) DrawToTexture(scaleFactor int) gdk.Texturer

DrawToTexture renders self into a gdk.Texture at scale_factor.

This can be used to export the fallback avatar.

The function takes the following parameters:

  • scaleFactor: scale factor.

The function returns the following values:

  • texture: texture.

func (*Avatar) IconName

func (self *Avatar) IconName() string

IconName gets the name of an icon to use as a fallback.

The function returns the following values:

  • utf8 (optional): icon name.

func (*Avatar) SetCustomImage

func (self *Avatar) SetCustomImage(customImage gdk.Paintabler)

SetCustomImage sets the custom image paintable.

Custom image is displayed instead of initials or icon.

The function takes the following parameters:

  • customImage (optional): custom image.

func (*Avatar) SetIconName

func (self *Avatar) SetIconName(iconName string)

SetIconName sets the name of an icon to use as a fallback.

If no name is set, avatar-default-symbolic will be used.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*Avatar) SetShowInitials

func (self *Avatar) SetShowInitials(showInitials bool)

SetShowInitials sets whether to use initials instead of an icon on the fallback avatar.

See avatar:icon-name for how to change the fallback icon.

The function takes the following parameters:

  • showInitials: whether to use initials instead of an icon as fallback.

func (*Avatar) SetSize

func (self *Avatar) SetSize(size int)

SetSize sets the size of the avatar.

The function takes the following parameters:

  • size of the avatar.

func (*Avatar) SetText

func (self *Avatar) SetText(text string)

SetText sets the text used to generate the fallback initials and color.

It's only used to generate the color if avatar:show-initials is FALSE.

The function takes the following parameters:

  • text (optional) used to get the initials and color.

func (*Avatar) ShowInitials

func (self *Avatar) ShowInitials() bool

ShowInitials gets whether initials are used instead of an icon on the fallback avatar.

The function returns the following values:

  • ok: whether initials are used instead of an icon as fallback.

func (*Avatar) Size

func (self *Avatar) Size() int

Size gets the size of the avatar.

The function returns the following values:

  • gint: size of the avatar.

func (*Avatar) Text

func (self *Avatar) Text() string

Text gets the text used to generate the fallback initials and color.

The function returns the following values:

  • utf8 (optional): text used to generate the fallback initials and color.

type AvatarClass

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

AvatarClass: instance of this type is always passed by reference.

func (*AvatarClass) ParentClass

func (a *AvatarClass) ParentClass() *gtk.WidgetClass

type AvatarOverrides

type AvatarOverrides struct {
}

AvatarOverrides contains methods that are overridable.

type Banner struct {
	gtk.Widget

	*coreglib.Object
	gtk.Actionable
	// contains filtered or unexported fields
}

Banner: bar with contextual information.

<picture> <source srcset="banner-dark.png" media="(prefers-color-scheme: dark)"> <img src="banner.png" alt="banner"> </picture>

Banners are hidden by default, use banner:revealed to show them.

Banners have a title, set with banner:title. Titles can be marked up with Pango markup, use banner:use-markup to enable it.

The title will be shown centered or left-aligned depending on available space.

Banners can optionally have a button with text on it, set through banner:button-label. The button can be used with a GAction, or with the banner::button-clicked signal.

CSS nodes

AdwBanner has a main CSS node with the name banner.

func NewBanner

func NewBanner(title string) *Banner

NewBanner creates a new AdwBanner.

The function takes the following parameters:

  • title: banner title.

The function returns the following values:

  • banner: newly created AdwBanner.

func (*Banner) ButtonLabel

func (self *Banner) ButtonLabel() string

ButtonLabel gets the button label for self.

The function returns the following values:

  • utf8 (optional): button label for self.

func (*Banner) ConnectButtonClicked

func (self *Banner) ConnectButtonClicked(f func()) coreglib.SignalHandle

ConnectButtonClicked: this signal is emitted after the action button has been clicked.

It can be used as an alternative to setting an action.

func (*Banner) Revealed

func (self *Banner) Revealed() bool

Revealed gets if a banner is revealed.

The function returns the following values:

  • ok: whether a banner is revealed.

func (*Banner) SetButtonLabel

func (self *Banner) SetButtonLabel(label string)

SetButtonLabel sets the button label for self.

If set to "" or NULL, the button won't be shown.

The button can be used with a GAction, or with the banner::button-clicked signal.

The function takes the following parameters:

  • label (optional): label.

func (*Banner) SetRevealed

func (self *Banner) SetRevealed(revealed bool)

SetRevealed sets whether a banner should be revealed.

The function takes the following parameters:

  • revealed: whether a banner should be revealed.

func (*Banner) SetTitle

func (self *Banner) SetTitle(title string)

SetTitle sets the title for this banner.

See also: banner:use-markup.

The function takes the following parameters:

  • title: title.

func (*Banner) SetUseMarkup

func (self *Banner) SetUseMarkup(useMarkup bool)

SetUseMarkup sets whether to use Pango markup for the banner title.

See also pango.ParseMarkup().

The function takes the following parameters:

  • useMarkup: whether to use markup.

func (*Banner) Title

func (self *Banner) Title() string

Title gets the title for self.

The function returns the following values:

  • utf8: title for self.

func (*Banner) UseMarkup

func (self *Banner) UseMarkup() bool

UseMarkup gets whether to use Pango markup for the banner title.

The function returns the following values:

  • ok: whether to use markup.

type BannerClass

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

BannerClass: instance of this type is always passed by reference.

func (*BannerClass) ParentClass

func (b *BannerClass) ParentClass() *gtk.WidgetClass

type BannerOverrides

type BannerOverrides struct {
}

BannerOverrides contains methods that are overridable.

type Bin

type Bin struct {
	gtk.Widget
	// contains filtered or unexported fields
}

Bin: widget with one child.

<picture> <source srcset="bin-dark.png" media="(prefers-color-scheme: dark)"> <img src="bin.png" alt="bin"> </picture>

The AdwBin widget has only one child, set with the bin:child property.

It is useful for deriving subclasses, since it provides common code needed for handling a single child widget.

func NewBin

func NewBin() *Bin

NewBin creates a new AdwBin.

The function returns the following values:

  • bin: new created AdwBin.

func (*Bin) Child

func (self *Bin) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*Bin) SetChild

func (self *Bin) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

type BinClass

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

BinClass: instance of this type is always passed by reference.

func (*BinClass) ParentClass

func (b *BinClass) ParentClass() *gtk.WidgetClass

type BinOverrides

type BinOverrides struct {
}

BinOverrides contains methods that are overridable.

type Breakpoint

type Breakpoint struct {
	*coreglib.Object

	gtk.Buildable
	// contains filtered or unexported fields
}

Breakpoint describes a breakpoint for window.

Breakpoints are used to create adaptive UI, allowing to change the layout depending on available size.

Breakpoint is a size threshold, specified by its condition, as well as one or more setters.

Each setter has a target object, a property and a value. When a breakpoint is applied, each setter sets the target property on their target object to the specified value, and reset it back to the original value when it's unapplied.

For more complicated scenarios, breakpoint::apply and breakpoint::unapply can be used instead.

Breakpoints can be used within window, applicationwindow or breakpointbin.

AdwBreakpoint as GtkBuildable:

AdwBreakpoint supports specifying its condition via the <condition> element. The contents of the element must be a string in a format accepted by breakpointcondition.Parse().

It also supports adding setters via the <setter> element. Each <setter> element must have the object attribute specifying the target object, and the property attribute specifying the property name. The contents of the element are used as the setter value.

For G_TYPE_OBJECT and G_TYPE_BOXED derived properties, empty contents are treated as NULL.

Setter values can be translated with the usual translatable, context and comments attributes.

Example of an AdwBreakpoint UI definition:

<object class="AdwBreakpoint">
  <condition>max-width: 400px</condition>
  <setter object="button" property="visible">True</setter>
  <setter object="box" property="orientation">vertical</setter>
  <setter object="page" property="title" translatable="yes">Example</setter>
</object>.

func NewBreakpoint

func NewBreakpoint(condition *BreakpointCondition) *Breakpoint

NewBreakpoint creates a new AdwBreakpoint with condition.

The function takes the following parameters:

  • condition: condition.

The function returns the following values:

  • breakpoint: newly created AdwBreakpoint.

func (*Breakpoint) AddSetter

func (self *Breakpoint) AddSetter(object glib.Objector, property string, value any)

AddSetter adds a setter to self.

The setter will automatically set property on object to value when applying the breakpoint, and set it back to its original value upon unapplying it.

Note that setting properties to their original values does not work for properties that have irreversible side effects. For example, changing gtk.Button:label while gtk.Button:icon-name is set will reset the icon. However, resetting the label will not set icon-name to its original value.

Use the breakpoint::apply and breakpoint::unapply signals for those properties instead.

The function takes the following parameters:

  • object: target object.
  • property: target property.
  • value to set.

func (*Breakpoint) AddSetterDirect

func (self *Breakpoint) AddSetterDirect(object *coreglib.Object, property string, value *coreglib.Value)

AddSetterDirect adds a setter to self.

The setter will automatically set property on object to value when applying the breakpoint, and set it back to its original value upon unapplying it.

Note that setting properties to their original values does not work for properties that have irreversible side effects. For example, changing gtk.Button:label while gtk.Button:icon-name is set will reset the icon. However, resetting the label will not set icon-name to its original value.

Use the breakpoint::apply and breakpoint::unapply signals for those properties instead, as follows:

static void
breakpoint_apply_cb (MyWidget *self)
{
  gtk_button_set_icon_name (self->button, "go-previous-symbolic");
}

static void
breakpoint_apply_cb (MyWidget *self)
{
  gtk_button_set_label (self->button, _("_Back"));
}

// ...

g_signal_connect_swapped (breakpoint, "apply",
                          G_CALLBACK (breakpoint_apply_cb), self);
g_signal_connect_swapped (breakpoint, "unapply",
                          G_CALLBACK (breakpoint_unapply_cb), self);.

The function takes the following parameters:

  • object: target object.
  • property: target property.
  • value to set.

func (*Breakpoint) AddSetters

func (self *Breakpoint) AddSetters(objects []*coreglib.Object, names []string, values []*coreglib.Value)

AddSetters adds n_setters setters to self.

This is a convenience function for adding multiple setters at once.

See breakpoint.AddSetter.

This function is meant to be used by language bindings.

The function takes the following parameters:

  • objects: setter target object.
  • names: setter target properties.
  • values: setter values.

func (*Breakpoint) Condition

func (self *Breakpoint) Condition() *BreakpointCondition

Condition gets the condition for self.

The function returns the following values:

  • breakpointCondition (optional): condition.

func (*Breakpoint) ConnectApply

func (self *Breakpoint) ConnectApply(f func()) coreglib.SignalHandle

ConnectApply is emitted when the breakpoint is applied.

This signal is emitted after the setters have been applied.

func (*Breakpoint) ConnectUnapply

func (self *Breakpoint) ConnectUnapply(f func()) coreglib.SignalHandle

ConnectUnapply is emitted when the breakpoint is unapplied.

This signal is emitted before resetting the setter values.

func (*Breakpoint) SetCondition

func (self *Breakpoint) SetCondition(condition *BreakpointCondition)

SetCondition sets the condition for self.

The function takes the following parameters:

  • condition (optional): new condition.

type BreakpointBin

type BreakpointBin struct {
	gtk.Widget
	// contains filtered or unexported fields
}

BreakpointBin: widget that changes layout based on available size.

<picture> <source srcset="breakpoint-bin-dark.png" media="(prefers-color-scheme: dark)"> <img src="breakpoint-bin.png" alt="breakpoint-bin"> </picture>

AdwBreakpointBin provides a way to use breakpoints without window or applicationwindow. It can be useful for limiting breakpoints to a single page and similar purposes. Most applications shouldn't need it.

AdwBreakpointBin is similar to bin. It has one child, set via the breakpointbin:child property.

When AdwBreakpointBin is resized, its child widget can rearrange its layout at specific thresholds.

The thresholds and layout changes are defined via breakpoint objects. They can be added using breakpointbin.AddBreakpoint.

Each breakpoint has a condition, specifying the bin's size and/or aspect ratio, and setters that automatically set object properties when that happens. The breakpoint::apply and breakpoint::unapply can be used instead for more complex scenarios.

Breakpoints are only allowed to modify widgets inside the AdwBreakpointBin, but not on the AdwBreakpointBin itself or any other widgets.

If multiple breakpoints can be used for the current size, the last one is always picked. The current breakpoint can be tracked using the breakpointbin:current-breakpoint property.

If none of the breakpoints can be used, that property will be set to NULL, and the original property values will be used instead.

Minimum Size

Adding a breakpoint to AdwBreakpointBin will result in it having no minimum size. The gtk.Widget:width-request and gtk.Widget:height-request properties must always be set when using breakpoints, indicating the smallest size you want to support.

The minimum size and breakpoint conditions must be carefully selected so that the child widget completely fits. If it doesn't, it will overflow and a warning message will be printed.

When choosing minimum size, consider translations and text scale factor changes. Make sure to leave enough space for text labels, and enable ellipsizing or wrapping if they might not fit.

For gtk.Label this can be done via gtk.Label:ellipsize, or via gtk.Label:wrap together with gtk.Label:wrap-mode.

For buttons, use gtk.Button:can-shrink, gtk.MenuButton:can-shrink, adw.SplitButton:can-shrink, or adw.ButtonContent:can-shrink.

Example

GtkWidget *bin, *child;
AdwBreakpoint *breakpoint;

bin = adw_breakpoint_bin_new ();
gtk_widget_set_size_request (bin, 150, 150);

child = gtk_label_new ("Wide");
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_widget_add_css_class (child, "title-1");
adw_breakpoint_bin_set_child (ADW_BREAKPOINT_BIN (bin), child);

breakpoint = adw_breakpoint_new (adw_breakpoint_condition_parse ("max-width: 200px"));
adw_breakpoint_add_setters (breakpoint,
                            G_OBJECT (child), "label", "Narrow",
                            NULL);
adw_breakpoint_bin_add_breakpoint (ADW_BREAKPOINT_BIN (bin), breakpoint);

The bin has a single label inside it, displaying "Wide". When the bin's width is smaller than or equal to 200px, it changes to "Narrow".

AdwBreakpointBin as GtkBuildable

AdwBreakpointBin allows adding AdwBreakpoint objects as children.

Example of an AdwBreakpointBin UI definition:

<object class="AdwBreakpointBin">
  <property name="width-request">150</property>
  <property name="height-request">150</property>
  <property name="child">
    <object class="GtkLabel" id="child">
      <property name="label">Wide</property>
      <property name="ellipsize">end</property>
      <style>
        <class name="title-1"/>
      </style>
    </object>
  </property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 200px</condition>
      <setter object="child" property="label">Narrow</setter>
    </object>
  </child>
</object>

See breakpoint documentation for details.

func NewBreakpointBin

func NewBreakpointBin() *BreakpointBin

NewBreakpointBin creates a new AdwBreakpointBin.

The function returns the following values:

  • breakpointBin: newly created AdwBreakpointBin.

func (*BreakpointBin) AddBreakpoint

func (self *BreakpointBin) AddBreakpoint(breakpoint *Breakpoint)

AddBreakpoint adds breakpoint to self.

The function takes the following parameters:

  • breakpoint to add.

func (*BreakpointBin) Child

func (self *BreakpointBin) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*BreakpointBin) CurrentBreakpoint

func (self *BreakpointBin) CurrentBreakpoint() *Breakpoint

CurrentBreakpoint gets the current breakpoint.

The function returns the following values:

  • breakpoint (optional): current breakpoint.

func (*BreakpointBin) SetChild

func (self *BreakpointBin) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

type BreakpointBinClass

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

BreakpointBinClass: instance of this type is always passed by reference.

func (*BreakpointBinClass) ParentClass

func (b *BreakpointBinClass) ParentClass() *gtk.WidgetClass

type BreakpointBinOverrides

type BreakpointBinOverrides struct {
}

BreakpointBinOverrides contains methods that are overridable.

type BreakpointClass

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

BreakpointClass: instance of this type is always passed by reference.

type BreakpointCondition

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

BreakpointCondition describes condition for an breakpoint.

An instance of this type is always passed by reference.

func BreakpointConditionParse

func BreakpointConditionParse(str string) *BreakpointCondition

BreakpointConditionParse parses a condition from a string.

Length conditions are specified as <type>: <value>[<unit>], where:

- <type> can be min-width, max-width, min-height or max-height

- <value> is a fractional number

- <unit> can be px, pt or sp

If the unit is omitted, px is assumed.

See breakpointcondition.NewLength.

Examples:

- min-width: 500px

- min-height: 400pt

- max-width: 100sp

- max-height: 500

Ratio conditions are specified as <type>: <width>[/<height>], where:

- <type> can be min-aspect-ratio or max-aspect-ratio

- <width> and <height> are integer numbers

See breakpointcondition.NewRatio.

The ratio is represented as <width> divided by <height>.

If <height> is omitted, it's assumed to be 1.

Examples:

- min-aspect-ratio: 4/3

- max-aspect-ratio: 1

The logical operators and, or can be used to compose a complex condition as follows:

- <condition> and <condition>: the condition is true when both <condition>s are true, same as when using breakpointcondition.NewAnd

- <condition> or <condition>: the condition is true when either of the <condition>s is true, same as when using breakpointcondition.NewOr

Examples:

- min-width: 400px and max-aspect-ratio: 4/3

- max-width: 360sp or max-width: 360px

Conditions can be further nested using parentheses, for example:

- min-width: 400px and (max-aspect-ratio: 4/3 or max-height: 400px)

If parentheses are omitted, the first operator takes priority.

The function takes the following parameters:

  • str: string specifying the condition.

The function returns the following values:

  • breakpointCondition: parsed condition.

func NewBreakpointConditionAnd

func NewBreakpointConditionAnd(condition1 *BreakpointCondition, condition2 *BreakpointCondition) *BreakpointCondition

NewBreakpointConditionAnd constructs a struct BreakpointCondition.

func NewBreakpointConditionLength

func NewBreakpointConditionLength(typ BreakpointConditionLengthType, value float64, unit LengthUnit) *BreakpointCondition

NewBreakpointConditionLength constructs a struct BreakpointCondition.

func NewBreakpointConditionOr

func NewBreakpointConditionOr(condition1 *BreakpointCondition, condition2 *BreakpointCondition) *BreakpointCondition

NewBreakpointConditionOr constructs a struct BreakpointCondition.

func NewBreakpointConditionRatio

func NewBreakpointConditionRatio(typ BreakpointConditionRatioType, width int, height int) *BreakpointCondition

NewBreakpointConditionRatio constructs a struct BreakpointCondition.

func (*BreakpointCondition) Copy

Copy copies self.

The function returns the following values:

  • breakpointCondition: copy of self.

func (*BreakpointCondition) String

func (self *BreakpointCondition) String() string

String returns a textual representation of self.

The returned string can be parsed by breakpointcondition.Parse().

The function returns the following values:

  • utf8: newly allocated text string.

type BreakpointConditionLengthType

type BreakpointConditionLengthType C.gint

BreakpointConditionLengthType describes length types for breakpointcondition.

See breakpointcondition.NewLength.

New values may be added to this enumeration over time.

const (
	// BreakpointConditionMinWidth: true if the width is greater than or equal
	// to the condition value.
	BreakpointConditionMinWidth BreakpointConditionLengthType = iota
	// BreakpointConditionMaxWidth: true if the width is less than or equal to
	// the condition value.
	BreakpointConditionMaxWidth
	// BreakpointConditionMinHeight: true if the height is greater than or equal
	// to the condition value.
	BreakpointConditionMinHeight
	// BreakpointConditionMaxHeight: true if the height is less than or equal to
	// the condition value.
	BreakpointConditionMaxHeight
)

func (BreakpointConditionLengthType) String

String returns the name in string for BreakpointConditionLengthType.

type BreakpointConditionRatioType

type BreakpointConditionRatioType C.gint

BreakpointConditionRatioType describes ratio types for breakpointcondition.

See breakpointcondition.NewRatio.

New values may be added to this enumeration over time.

const (
	// BreakpointConditionMinAspectRatio: true if the aspect ratio is greater
	// than or equal to the condition value.
	BreakpointConditionMinAspectRatio BreakpointConditionRatioType = iota
	// BreakpointConditionMaxAspectRatio: true if the aspect ratio is less than
	// or equal to the condition value.
	BreakpointConditionMaxAspectRatio
)

func (BreakpointConditionRatioType) String

String returns the name in string for BreakpointConditionRatioType.

type BreakpointOverrides

type BreakpointOverrides struct {
}

BreakpointOverrides contains methods that are overridable.

type ButtonContent

type ButtonContent struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ButtonContent: helper widget for creating buttons.

<picture> <source srcset="button-content-dark.png" media="(prefers-color-scheme: dark)"> <img src="button-content.png" alt="button-content"> </picture>

AdwButtonContent is a box-like widget with an icon and a label.

It's intended to be used as a direct child of gtk.Button, gtk.MenuButton or splitbutton, when they need to have both an icon and a label, as follows:

<object class="GtkButton">
  <property name="child">
    <object class="AdwButtonContent">
      <property name="icon-name">document-open-symbolic</property>
      <property name="label" translatable="yes">_Open</property>
      <property name="use-underline">True</property>
    </object>
  </property>
</object>

AdwButtonContent handles style classes and connecting the mnemonic to the button automatically.

CSS nodes

buttoncontent
├── image
╰── label

AdwButtonContent's CSS node is called buttoncontent. It contains the subnodes image and label.

When inside a GtkButton or AdwSplitButton, the button will receive the .image-text-button style class. When inside a GtkMenuButton, the internal GtkButton will receive it instead.

Accessibility

AdwButtonContent uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewButtonContent

func NewButtonContent() *ButtonContent

NewButtonContent creates a new AdwButtonContent.

The function returns the following values:

  • buttonContent: new created AdwButtonContent.

func (*ButtonContent) CanShrink

func (self *ButtonContent) CanShrink() bool

CanShrink gets whether the button can be smaller than the natural size of its contents.

The function returns the following values:

  • ok: whether the button can shrink.

func (*ButtonContent) IconName

func (self *ButtonContent) IconName() string

IconName gets the name of the displayed icon.

The function returns the following values:

  • utf8: icon name.

func (*ButtonContent) Label

func (self *ButtonContent) Label() string

Label gets the displayed label.

The function returns the following values:

  • utf8: label.

func (*ButtonContent) SetCanShrink

func (self *ButtonContent) SetCanShrink(canShrink bool)

SetCanShrink sets whether the button can be smaller than the natural size of its contents.

If set to TRUE, the label will ellipsize.

See gtk.Button.SetCanShrink().

The function takes the following parameters:

  • canShrink: whether the button can shrink.

func (*ButtonContent) SetIconName

func (self *ButtonContent) SetIconName(iconName string)

SetIconName sets the name of the displayed icon.

If empty, the icon is not shown.

The function takes the following parameters:

  • iconName: new icon name.

func (*ButtonContent) SetLabel

func (self *ButtonContent) SetLabel(label string)

SetLabel sets the displayed label.

The function takes the following parameters:

  • label: new label.

func (*ButtonContent) SetUseUnderline

func (self *ButtonContent) SetUseUnderline(useUnderline bool)

SetUseUnderline sets whether an underline in the text indicates a mnemonic.

The mnemonic can be used to activate the parent button.

See buttoncontent:label.

The function takes the following parameters:

  • useUnderline: whether an underline in the text indicates a mnemonic.

func (*ButtonContent) UseUnderline

func (self *ButtonContent) UseUnderline() bool

UseUnderline gets whether an underline in the text indicates a mnemonic.

The function returns the following values:

  • ok: whether an underline in the text indicates a mnemonic.

type ButtonContentClass

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

ButtonContentClass: instance of this type is always passed by reference.

func (*ButtonContentClass) ParentClass

func (b *ButtonContentClass) ParentClass() *gtk.WidgetClass

type ButtonContentOverrides

type ButtonContentOverrides struct {
}

ButtonContentOverrides contains methods that are overridable.

type CallbackAnimationTarget

type CallbackAnimationTarget struct {
	AnimationTarget
	// contains filtered or unexported fields
}

CallbackAnimationTarget: animationtarget that calls a given callback during the animation.

func NewCallbackAnimationTarget

func NewCallbackAnimationTarget(callback AnimationTargetFunc) *CallbackAnimationTarget

NewCallbackAnimationTarget creates a new AdwAnimationTarget that calls the given callback during the animation.

The function takes the following parameters:

  • callback to call.

The function returns the following values:

  • callbackAnimationTarget: newly created callback target.
type Carousel struct {
	gtk.Widget

	*coreglib.Object
	Swipeable
	gtk.Orientable
	// contains filtered or unexported fields
}

Carousel: paginated scrolling widget.

<picture> <source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"> <img src="carousel.png" alt="carousel"> </picture>

The AdwCarousel widget can be used to display a set of pages with swipe-based navigation between them.

carouselindicatordots and carouselindicatorlines can be used to provide page indicators for AdwCarousel.

CSS nodes

AdwCarousel has a single CSS node with name carousel.

func NewCarousel

func NewCarousel() *Carousel

NewCarousel creates a new AdwCarousel.

The function returns the following values:

  • carousel: newly created AdwCarousel.

func (*Carousel) AllowLongSwipes

func (self *Carousel) AllowLongSwipes() bool

AllowLongSwipes gets whether to allow swiping for more than one page at a time.

The function returns the following values:

  • ok: TRUE if long swipes are allowed.

func (*Carousel) AllowMouseDrag

func (self *Carousel) AllowMouseDrag() bool

AllowMouseDrag sets whether self can be dragged with mouse pointer.

The function returns the following values:

  • ok: whether self can be dragged with mouse pointer.

func (*Carousel) AllowScrollWheel

func (self *Carousel) AllowScrollWheel() bool

AllowScrollWheel gets whether self will respond to scroll wheel events.

The function returns the following values:

  • ok: TRUE if self will respond to scroll wheel events.

func (*Carousel) Append

func (self *Carousel) Append(child gtk.Widgetter)

Append appends child to self.

The function takes the following parameters:

  • child: widget to add.

func (*Carousel) ConnectPageChanged

func (self *Carousel) ConnectPageChanged(f func(index uint)) coreglib.SignalHandle

ConnectPageChanged: this signal is emitted after a page has been changed.

It can be used to implement "infinite scrolling" by amending the pages after every scroll. Note that an empty carousel is indicated by (int)index == -1.

func (*Carousel) Insert

func (self *Carousel) Insert(child gtk.Widgetter, position int)

Insert inserts child into self at position position.

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

The function takes the following parameters:

  • child: widget to add.
  • position to insert child at.

func (*Carousel) Interactive

func (self *Carousel) Interactive() bool

Interactive gets whether self can be navigated.

The function returns the following values:

  • ok: whether self can be navigated.

func (*Carousel) NPages

func (self *Carousel) NPages() uint

NPages gets the number of pages in self.

The function returns the following values:

  • guint: number of pages in self.

func (*Carousel) NthPage

func (self *Carousel) NthPage(n uint) gtk.Widgetter

NthPage gets the page at position n.

The function takes the following parameters:

  • n: index of the page.

The function returns the following values:

  • widget: page.

func (*Carousel) Position

func (self *Carousel) Position() float64

Position gets current scroll position in self, unitless.

1 matches 1 page. Use carousel.ScrollTo for changing it.

The function returns the following values:

  • gdouble: scroll position.

func (*Carousel) Prepend

func (self *Carousel) Prepend(child gtk.Widgetter)

Prepend prepends child to self.

The function takes the following parameters:

  • child: widget to add.

func (*Carousel) Remove

func (self *Carousel) Remove(child gtk.Widgetter)

Remove removes child from self.

The function takes the following parameters:

  • child: widget to remove.

func (*Carousel) Reorder

func (self *Carousel) Reorder(child gtk.Widgetter, position int)

Reorder moves child into position position.

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

The function takes the following parameters:

  • child: widget to add.
  • position to move child to.

func (*Carousel) RevealDuration

func (self *Carousel) RevealDuration() uint

RevealDuration gets the page reveal duration, in milliseconds.

The function returns the following values:

  • guint: duration.

func (*Carousel) ScrollParams

func (self *Carousel) ScrollParams() *SpringParams

ScrollParams gets the scroll animation spring parameters for self.

The function returns the following values:

  • springParams: animation parameters.

func (*Carousel) ScrollTo

func (self *Carousel) ScrollTo(widget gtk.Widgetter, animate bool)

ScrollTo scrolls to widget.

If animate is TRUE, the transition will be animated.

The function takes the following parameters:

  • widget: child of self.
  • animate: whether to animate the transition.

func (*Carousel) SetAllowLongSwipes

func (self *Carousel) SetAllowLongSwipes(allowLongSwipes bool)

SetAllowLongSwipes sets whether to allow swiping for more than one page at a time.

If allow_long_swipes is FALSE, each swipe can only move to the adjacent pages.

The function takes the following parameters:

  • allowLongSwipes: whether to allow long swipes.

func (*Carousel) SetAllowMouseDrag

func (self *Carousel) SetAllowMouseDrag(allowMouseDrag bool)

SetAllowMouseDrag sets whether self can be dragged with mouse pointer.

If allow_mouse_drag is FALSE, dragging is only available on touch.

The function takes the following parameters:

  • allowMouseDrag: whether self can be dragged with mouse pointer.

func (*Carousel) SetAllowScrollWheel

func (self *Carousel) SetAllowScrollWheel(allowScrollWheel bool)

SetAllowScrollWheel sets whether self will respond to scroll wheel events.

If allow_scroll_wheel is FALSE, wheel events will be ignored.

The function takes the following parameters:

  • allowScrollWheel: whether self will respond to scroll wheel events.

func (*Carousel) SetInteractive

func (self *Carousel) SetInteractive(interactive bool)

SetInteractive sets whether self can be navigated.

This can be used to temporarily disable the carousel to only allow navigating it in a certain state.

The function takes the following parameters:

  • interactive: whether self can be navigated.

func (*Carousel) SetRevealDuration

func (self *Carousel) SetRevealDuration(revealDuration uint)

SetRevealDuration sets the page reveal duration, in milliseconds.

Reveal duration is used when animating adding or removing pages.

The function takes the following parameters:

  • revealDuration: new reveal duration value.

func (*Carousel) SetScrollParams

func (self *Carousel) SetScrollParams(params *SpringParams)

SetScrollParams sets the scroll animation spring parameters for self.

The default value is equivalent to:

adw_spring_params_new (1, 0.5, 500).

The function takes the following parameters:

  • params: new parameters.

func (*Carousel) SetSpacing

func (self *Carousel) SetSpacing(spacing uint)

SetSpacing sets spacing between pages in pixels.

The function takes the following parameters:

  • spacing: new spacing value.

func (*Carousel) Spacing

func (self *Carousel) Spacing() uint

Spacing gets spacing between pages in pixels.

The function returns the following values:

  • guint: spacing between pages.

type CarouselClass

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

CarouselClass: instance of this type is always passed by reference.

func (*CarouselClass) ParentClass

func (c *CarouselClass) ParentClass() *gtk.WidgetClass

type CarouselIndicatorDots

type CarouselIndicatorDots struct {
	gtk.Widget

	*coreglib.Object
	gtk.Orientable
	// contains filtered or unexported fields
}

CarouselIndicatorDots dots indicator for carousel.

<picture> <source srcset="carousel-indicator-dots-dark.png" media="(prefers-color-scheme: dark)"> <img src="carousel-indicator-dots.png" alt="carousel-indicator-dots"> </picture>

The AdwCarouselIndicatorDots widget shows a set of dots for each page of a given carousel. The dot representing the carousel's active page is larger and more opaque than the others, the transition to the active and inactive state is gradual to match the carousel's position.

See also carouselindicatorlines.

CSS nodes

AdwCarouselIndicatorDots has a single CSS node with name carouselindicatordots.

func NewCarouselIndicatorDots

func NewCarouselIndicatorDots() *CarouselIndicatorDots

NewCarouselIndicatorDots creates a new AdwCarouselIndicatorDots.

The function returns the following values:

  • carouselIndicatorDots: newly created AdwCarouselIndicatorDots.

func (*CarouselIndicatorDots) Carousel

func (self *CarouselIndicatorDots) Carousel() *Carousel

Carousel gets the displayed carousel.

The function returns the following values:

  • carousel (optional): displayed carousel.

func (*CarouselIndicatorDots) SetCarousel

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

SetCarousel sets the displayed carousel.

The function takes the following parameters:

  • carousel (optional): carousel.

type CarouselIndicatorDotsClass

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

CarouselIndicatorDotsClass: instance of this type is always passed by reference.

func (*CarouselIndicatorDotsClass) ParentClass

func (c *CarouselIndicatorDotsClass) ParentClass() *gtk.WidgetClass

type CarouselIndicatorDotsOverrides

type CarouselIndicatorDotsOverrides struct {
}

CarouselIndicatorDotsOverrides contains methods that are overridable.

type CarouselIndicatorLines

type CarouselIndicatorLines struct {
	gtk.Widget

	*coreglib.Object
	gtk.Orientable
	// contains filtered or unexported fields
}

CarouselIndicatorLines lines indicator for carousel.

<picture> <source srcset="carousel-indicator-dots-lines.png" media="(prefers-color-scheme: dark)"> <img src="carousel-indicator-lines.png" alt="carousel-indicator-lines"> </picture>

The AdwCarouselIndicatorLines widget shows a set of lines for each page of a given carousel. The carousel's active page is shown as another line that moves between them to match the carousel's position.

See also carouselindicatordots.

CSS nodes

AdwCarouselIndicatorLines has a single CSS node with name carouselindicatorlines.

func NewCarouselIndicatorLines

func NewCarouselIndicatorLines() *CarouselIndicatorLines

NewCarouselIndicatorLines creates a new AdwCarouselIndicatorLines.

The function returns the following values:

  • carouselIndicatorLines: newly created AdwCarouselIndicatorLines.

func (*CarouselIndicatorLines) Carousel

func (self *CarouselIndicatorLines) Carousel() *Carousel

Carousel gets the displayed carousel.

The function returns the following values:

  • carousel (optional): displayed carousel.

func (*CarouselIndicatorLines) SetCarousel

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

SetCarousel sets the displayed carousel.

The function takes the following parameters:

  • carousel (optional): carousel.

type CarouselIndicatorLinesClass

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

CarouselIndicatorLinesClass: instance of this type is always passed by reference.

func (*CarouselIndicatorLinesClass) ParentClass

func (c *CarouselIndicatorLinesClass) ParentClass() *gtk.WidgetClass

type CarouselIndicatorLinesOverrides

type CarouselIndicatorLinesOverrides struct {
}

CarouselIndicatorLinesOverrides contains methods that are overridable.

type CarouselOverrides

type CarouselOverrides struct {
}

CarouselOverrides contains methods that are overridable.

type CenteringPolicy

type CenteringPolicy C.gint

CenteringPolicy describes title centering behavior of a headerbar widget.

const (
	// CenteringPolicyLoose: keep the title centered when possible.
	CenteringPolicyLoose CenteringPolicy = iota
	// CenteringPolicyStrict: keep the title centered at all cost.
	CenteringPolicyStrict
)

func (CenteringPolicy) String

func (c CenteringPolicy) String() string

String returns the name in string for CenteringPolicy.

type Clamp

type Clamp struct {
	gtk.Widget

	*coreglib.Object
	gtk.Orientable
	// contains filtered or unexported fields
}

Clamp: widget constraining its child to a given size.

<picture> <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-wide.png" alt="clamp-wide"> </picture> <picture> <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-narrow.png" alt="clamp-narrow"> </picture>

The AdwClamp widget constrains the size of the widget it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the child from its minimum to its maximum size is eased out for a smooth transition.

If the child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.

AdwClamp can scale with the text scale factor, use the clamplayout:unit property to enable that behavior.

CSS nodes

AdwClamp has a single CSS node with name clamp.

func NewClamp

func NewClamp() *Clamp

NewClamp creates a new AdwClamp.

The function returns the following values:

  • clamp: newly created AdwClamp.

func (*Clamp) Child

func (self *Clamp) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*Clamp) MaximumSize

func (self *Clamp) MaximumSize() int

MaximumSize gets the maximum size allocated to the child.

The function returns the following values:

  • gint: maximum size to allocate to the child.

func (*Clamp) SetChild

func (self *Clamp) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

func (*Clamp) SetMaximumSize

func (self *Clamp) SetMaximumSize(maximumSize int)

SetMaximumSize sets the maximum size allocated to the child.

It is the width if the clamp is horizontal, or the height if it is vertical.

The function takes the following parameters:

  • maximumSize: maximum size.

func (*Clamp) SetTighteningThreshold

func (self *Clamp) SetTighteningThreshold(tighteningThreshold int)

SetTighteningThreshold sets the size above which the child is clamped.

Starting from this size, the clamp will tighten its grip on the child, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the child will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the child, the child will be allocated all the size up to the maximum. If the threshold is lower than the minimum size to allocate to the child, that size will be used as the tightening threshold.

Effectively, tightening the grip on the child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

The function takes the following parameters:

  • tighteningThreshold: tightening threshold.

func (*Clamp) SetUnit

func (self *Clamp) SetUnit(unit LengthUnit)

SetUnit sets the length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

The function takes the following parameters:

  • unit: length unit.

func (*Clamp) TighteningThreshold

func (self *Clamp) TighteningThreshold() int

TighteningThreshold gets the size above which the child is clamped.

The function returns the following values:

  • gint: size above which the child is clamped.

func (*Clamp) Unit

func (self *Clamp) Unit() LengthUnit

Unit gets the length unit for maximum size and tightening threshold.

The function returns the following values:

  • lengthUnit: length unit.

type ClampClass

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

ClampClass: instance of this type is always passed by reference.

func (*ClampClass) ParentClass

func (c *ClampClass) ParentClass() *gtk.WidgetClass

type ClampLayout

type ClampLayout struct {
	gtk.LayoutManager

	*coreglib.Object
	gtk.Orientable
	// contains filtered or unexported fields
}

ClampLayout: layout manager constraining its children to a given size.

<picture> <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-wide.png" alt="clamp-wide"> </picture> <picture> <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-narrow.png" alt="clamp-narrow"> </picture>

AdwClampLayout constraints the size of the widgets it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the children from their minimum to their maximum size is eased out for a smooth transition.

If a child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.

AdwClampLayout can scale with the text scale factor, use the clamplayout:unit property to enable that behavior.

func NewClampLayout

func NewClampLayout() *ClampLayout

NewClampLayout creates a new AdwClampLayout.

The function returns the following values:

  • clampLayout: newly created AdwClampLayout.

func (*ClampLayout) MaximumSize

func (self *ClampLayout) MaximumSize() int

MaximumSize gets the maximum size allocated to the children.

The function returns the following values:

  • gint: maximum size to allocate to the children.

func (*ClampLayout) SetMaximumSize

func (self *ClampLayout) SetMaximumSize(maximumSize int)

SetMaximumSize sets the maximum size allocated to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

The function takes the following parameters:

  • maximumSize: maximum size.

func (*ClampLayout) SetTighteningThreshold

func (self *ClampLayout) SetTighteningThreshold(tighteningThreshold int)

SetTighteningThreshold sets the size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

The function takes the following parameters:

  • tighteningThreshold: tightening threshold.

func (*ClampLayout) SetUnit

func (self *ClampLayout) SetUnit(unit LengthUnit)

SetUnit sets the length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

The function takes the following parameters:

  • unit: length unit.

func (*ClampLayout) TighteningThreshold

func (self *ClampLayout) TighteningThreshold() int

TighteningThreshold gets the size above which the children are clamped.

The function returns the following values:

  • gint: size above which the children are clamped.

func (*ClampLayout) Unit

func (self *ClampLayout) Unit() LengthUnit

Unit gets the length unit for maximum size and tightening threshold.

The function returns the following values:

  • lengthUnit: length unit.

type ClampLayoutClass

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

ClampLayoutClass: instance of this type is always passed by reference.

func (*ClampLayoutClass) ParentClass

func (c *ClampLayoutClass) ParentClass() *gtk.LayoutManagerClass

type ClampLayoutOverrides

type ClampLayoutOverrides struct {
}

ClampLayoutOverrides contains methods that are overridable.

type ClampOverrides

type ClampOverrides struct {
}

ClampOverrides contains methods that are overridable.

type ClampScrollable

type ClampScrollable struct {
	gtk.Widget

	*coreglib.Object
	gtk.Orientable
	gtk.Scrollable
	// contains filtered or unexported fields
}

ClampScrollable: scrollable clamp.

AdwClampScrollable is a variant of clamp that implements the gtk.Scrollable interface.

The primary use case for AdwClampScrollable is clamping gtk.ListView.

func NewClampScrollable

func NewClampScrollable() *ClampScrollable

NewClampScrollable creates a new AdwClampScrollable.

The function returns the following values:

  • clampScrollable: newly created AdwClampScrollable.

func (*ClampScrollable) Child

func (self *ClampScrollable) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*ClampScrollable) MaximumSize

func (self *ClampScrollable) MaximumSize() int

MaximumSize gets the maximum size allocated to the child.

The function returns the following values:

  • gint: maximum size to allocate to the child.

func (*ClampScrollable) SetChild

func (self *ClampScrollable) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

func (*ClampScrollable) SetMaximumSize

func (self *ClampScrollable) SetMaximumSize(maximumSize int)

SetMaximumSize sets the maximum size allocated to the child.

It is the width if the clamp is horizontal, or the height if it is vertical.

The function takes the following parameters:

  • maximumSize: maximum size.

func (*ClampScrollable) SetTighteningThreshold

func (self *ClampScrollable) SetTighteningThreshold(tighteningThreshold int)

SetTighteningThreshold sets the size above which the child is clamped.

Starting from this size, the clamp will tighten its grip on the child, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum width, the child will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the child, the child will be allocated all the width up to the maximum. If the threshold is lower than the minimum size to allocate to the child, that size will be used as the tightening threshold.

Effectively, tightening the grip on the child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

The function takes the following parameters:

  • tighteningThreshold: tightening threshold.

func (*ClampScrollable) SetUnit

func (self *ClampScrollable) SetUnit(unit LengthUnit)

SetUnit sets the length unit for maximum size and tightening threshold.

Allows the sizes to vary depending on the text scale factor.

The function takes the following parameters:

  • unit: length unit.

func (*ClampScrollable) TighteningThreshold

func (self *ClampScrollable) TighteningThreshold() int

TighteningThreshold gets the size above which the child is clamped.

The function returns the following values:

  • gint: size above which the child is clamped.

func (*ClampScrollable) Unit

func (self *ClampScrollable) Unit() LengthUnit

Unit gets the length unit for maximum size and tightening threshold.

The function returns the following values:

  • lengthUnit: length unit.

type ClampScrollableClass

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

ClampScrollableClass: instance of this type is always passed by reference.

func (*ClampScrollableClass) ParentClass

func (c *ClampScrollableClass) ParentClass() *gtk.WidgetClass

type ClampScrollableOverrides

type ClampScrollableOverrides struct {
}

ClampScrollableOverrides contains methods that are overridable.

type ColorScheme

type ColorScheme C.gint

ColorScheme: application color schemes for stylemanager:color-scheme.

const (
	// ColorSchemeDefault: inherit the parent color-scheme. When set on the
	// AdwStyleManager returned by stylemanager.GetDefault(), it's equivalent to
	// ADW_COLOR_SCHEME_PREFER_LIGHT.
	ColorSchemeDefault ColorScheme = iota
	// ColorSchemeForceLight always use light appearance.
	ColorSchemeForceLight
	// ColorSchemePreferLight: use light appearance unless the system prefers
	// dark colors.
	ColorSchemePreferLight
	// ColorSchemePreferDark: use dark appearance unless the system prefers
	// prefers light colors.
	ColorSchemePreferDark
	// ColorSchemeForceDark always use dark appearance.
	ColorSchemeForceDark
)

func (ColorScheme) String

func (c ColorScheme) String() string

String returns the name in string for ColorScheme.

type ComboRow

type ComboRow struct {
	ActionRow
	// contains filtered or unexported fields
}

ComboRow: gtk.ListBoxRow used to choose from a list of items.

<picture> <source srcset="combo-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="combo-row.png" alt="combo-row"> </picture>

The AdwComboRow widget allows the user to choose from a list of valid choices. The row displays the selected choice. When activated, the row displays a popover which allows the user to make a new choice.

Example of an AdwComboRow UI definition:

<object class="AdwComboRow">
  <property name="title" translatable="yes">Combo Row</property>
  <property name="model">
    <object class="GtkStringList">
      <items>
        <item translatable="yes">Foo</item>
        <item translatable="yes">Bar</item>
        <item translatable="yes">Baz</item>
      </items>
    </object>
  </property>
</object>

The comborow:selected and comborow:selected-item properties can be used to keep track of the selected item and react to their changes.

AdwComboRow mirrors gtk.DropDown, see that widget for details.

AdwComboRow is gtk.ListBoxRow:activatable if a model is set.

CSS nodes

AdwComboRow has a main CSS node with name row and the .combo style class.

Its popover has the node named popover with the .menu style class, it contains a gtk.ScrolledWindow, which in turn contains a gtk.ListView, both are accessible via their regular nodes.

Accessibility

AdwComboRow uses the GTK_ACCESSIBLE_ROLE_COMBO_BOX role.

func NewComboRow

func NewComboRow() *ComboRow

NewComboRow creates a new AdwComboRow.

The function returns the following values:

  • comboRow: newly created AdwComboRow.

func (*ComboRow) EnableSearch

func (self *ComboRow) EnableSearch() bool

EnableSearch gets whether search is enabled.

If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

Search requires comborow:expression to be set.

The function returns the following values:

  • ok: whether the popup includes a search entry.

func (*ComboRow) Expression

func (self *ComboRow) Expression() gtk.Expressioner

Expression gets the expression used to obtain strings from items.

The function returns the following values:

  • expression (optional) used to obtain strings from items.

func (*ComboRow) Factory

func (self *ComboRow) Factory() *gtk.ListItemFactory

Factory gets the factory for populating list items.

The function returns the following values:

  • listItemFactory (optional): factory in use.

func (*ComboRow) ListFactory

func (self *ComboRow) ListFactory() *gtk.ListItemFactory

ListFactory gets the factory for populating list items in the popup.

The function returns the following values:

  • listItemFactory (optional): factory in use.

func (*ComboRow) Model

func (self *ComboRow) Model() *gio.ListModel

Model gets the model that provides the displayed items.

The function returns the following values:

  • listModel (optional): model in use.

func (*ComboRow) Selected

func (self *ComboRow) Selected() uint

Selected gets the position of the selected item.

The function returns the following values:

  • guint: position of the selected item, or gtk.INVALIDLISTPOSITION if no item is selected.

func (*ComboRow) SelectedItem

func (self *ComboRow) SelectedItem() *coreglib.Object

SelectedItem gets the selected item.

The function returns the following values:

  • object (optional): selected item.

func (*ComboRow) SetEnableSearch

func (self *ComboRow) SetEnableSearch(enableSearch bool)

SetEnableSearch sets whether to enable search.

If set to TRUE, a search entry will be shown in the popup that allows to search for items in the list.

Search requires comborow:expression to be set.

The function takes the following parameters:

  • enableSearch: whether to enable search.

func (*ComboRow) SetExpression

func (self *ComboRow) SetExpression(expression gtk.Expressioner)

SetExpression sets the expression used to obtain strings from items.

The expression must have a value type of G_TYPE_STRING.

It's used to bind strings to labels produced by the default factory if comborow:factory is not set, or when comborow:use-subtitle is set to TRUE.

The function takes the following parameters:

  • expression (optional): expression.

func (*ComboRow) SetFactory

func (self *ComboRow) SetFactory(factory *gtk.ListItemFactory)

SetFactory sets the factory for populating list items.

This factory is always used for the item in the row. It is also used for items in the popup unless comborow:list-factory is set.

The function takes the following parameters:

  • factory (optional) to use.

func (*ComboRow) SetListFactory

func (self *ComboRow) SetListFactory(factory *gtk.ListItemFactory)

SetListFactory sets the factory for populating list items in the popup.

If this is not set, comborow:factory is used.

The function takes the following parameters:

  • factory (optional) to use.

func (*ComboRow) SetModel

func (self *ComboRow) SetModel(model gio.ListModeller)

SetModel sets the model that provides the displayed items.

The function takes the following parameters:

  • model (optional) to use.

func (*ComboRow) SetSelected

func (self *ComboRow) SetSelected(position uint)

SetSelected selects the item at the given position.

The function takes the following parameters:

  • position of the item to select, or gtk.INVALIDLISTPOSITION.

func (*ComboRow) SetUseSubtitle

func (self *ComboRow) SetUseSubtitle(useSubtitle bool)

SetUseSubtitle sets whether to use the current value as the subtitle.

If you use a custom list item factory, you will need to give the row a name conversion expression with comborow:expression.

If set to TRUE, you should not access actionrow:subtitle.

The subtitle is interpreted as Pango markup if preferencesrow:use-markup is set to TRUE.

The function takes the following parameters:

  • useSubtitle: whether to use the current value as the subtitle.

func (*ComboRow) UseSubtitle

func (self *ComboRow) UseSubtitle() bool

UseSubtitle gets whether to use the current value as the subtitle.

The function returns the following values:

  • ok: whether to use the current value as the subtitle.

type ComboRowClass

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

ComboRowClass: instance of this type is always passed by reference.

func (*ComboRowClass) ParentClass

func (c *ComboRowClass) ParentClass() *ActionRowClass

ParentClass: parent class.

type ComboRowOverrides

type ComboRowOverrides struct {
}

ComboRowOverrides contains methods that are overridable.

type Easing

type Easing C.gint

Easing describes the available easing functions for use with timedanimation.

New values may be added to this enumeration over time.

const (
	// Linear: linear tweening.
	Linear Easing = iota
	// EaseInQuad: quadratic tweening.
	EaseInQuad
	// EaseOutQuad: quadratic tweening, inverse of ADW_EASE_IN_QUAD.
	EaseOutQuad
	// EaseInOutQuad: quadratic tweening, combining ADW_EASE_IN_QUAD and
	// ADW_EASE_OUT_QUAD.
	EaseInOutQuad
	// EaseInCubic: cubic tweening.
	EaseInCubic
	// EaseOutCubic: cubic tweening, inverse of ADW_EASE_IN_CUBIC.
	EaseOutCubic
	// EaseInOutCubic: cubic tweening, combining ADW_EASE_IN_CUBIC and
	// ADW_EASE_OUT_CUBIC.
	EaseInOutCubic
	// EaseInQuart: quartic tweening.
	EaseInQuart
	// EaseOutQuart: quartic tweening, inverse of ADW_EASE_IN_QUART.
	EaseOutQuart
	// EaseInOutQuart: quartic tweening, combining ADW_EASE_IN_QUART and
	// ADW_EASE_OUT_QUART.
	EaseInOutQuart
	// EaseInQuint: quintic tweening.
	EaseInQuint
	// EaseOutQuint: quintic tweening, inverse of ADW_EASE_IN_QUINT.
	EaseOutQuint
	// EaseInOutQuint: quintic tweening, combining ADW_EASE_IN_QUINT and
	// ADW_EASE_OUT_QUINT.
	EaseInOutQuint
	// EaseInSine: sine wave tweening.
	EaseInSine
	// EaseOutSine: sine wave tweening, inverse of ADW_EASE_IN_SINE.
	EaseOutSine
	// EaseInOutSine: sine wave tweening, combining ADW_EASE_IN_SINE and
	// ADW_EASE_OUT_SINE.
	EaseInOutSine
	// EaseInExpo: exponential tweening.
	EaseInExpo
	// EaseOutExpo: exponential tweening, inverse of ADW_EASE_IN_EXPO.
	EaseOutExpo
	// EaseInOutExpo: exponential tweening, combining ADW_EASE_IN_EXPO and
	// ADW_EASE_OUT_EXPO.
	EaseInOutExpo
	// EaseInCirc: circular tweening.
	EaseInCirc
	// EaseOutCirc: circular tweening, inverse of ADW_EASE_IN_CIRC.
	EaseOutCirc
	// EaseInOutCirc: circular tweening, combining ADW_EASE_IN_CIRC and
	// ADW_EASE_OUT_CIRC.
	EaseInOutCirc
	// EaseInElastic: elastic tweening, with offshoot on start.
	EaseInElastic
	// EaseOutElastic: elastic tweening, with offshoot on end, inverse of
	// ADW_EASE_IN_ELASTIC.
	EaseOutElastic
	// EaseInOutElastic: elastic tweening, with offshoot on both ends, combining
	// ADW_EASE_IN_ELASTIC and ADW_EASE_OUT_ELASTIC.
	EaseInOutElastic
	// EaseInBack: overshooting cubic tweening, with backtracking on start.
	EaseInBack
	// EaseOutBack: overshooting cubic tweening, with backtracking on end,
	// inverse of ADW_EASE_IN_BACK.
	EaseOutBack
	// EaseInOutBack: overshooting cubic tweening, with backtracking on both
	// ends, combining ADW_EASE_IN_BACK and ADW_EASE_OUT_BACK.
	EaseInOutBack
	// EaseInBounce: exponentially decaying parabolic (bounce) tweening,
	// on start.
	EaseInBounce
	// EaseOutBounce: exponentially decaying parabolic (bounce) tweening,
	// with bounce on end, inverse of ADW_EASE_IN_BOUNCE.
	EaseOutBounce
	// EaseInOutBounce: exponentially decaying parabolic (bounce) tweening,
	// with bounce on both ends, combining ADW_EASE_IN_BOUNCE and
	// ADW_EASE_OUT_BOUNCE.
	EaseInOutBounce
)

func (Easing) String

func (e Easing) String() string

String returns the name in string for Easing.

type EntryRow

type EntryRow struct {
	PreferencesRow

	*coreglib.Object
	gtk.EditableTextWidget
	// contains filtered or unexported fields
}

EntryRow: gtk.ListBoxRow with an embedded text entry.

<picture> <source srcset="entry-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="entry-row.png" alt="entry-row"> </picture>

AdwEntryRow has a title that doubles as placeholder text. It shows an icon indicating that it's editable and can receive additional widgets before or after the editable part.

If entryrow:show-apply-button is set to TRUE, AdwEntryRow can show an apply button when editing its contents. This can be useful if changing its contents can result in an expensive operation, such as network activity.

AdwEntryRow provides only minimal API and should be used with the gtk.Editable API.

See also passwordentryrow.

AdwEntryRow as GtkBuildable

The AdwEntryRow implementation of the gtk.Buildable interface supports adding a child at its end by specifying “suffix” or omitting the “type” attribute of a <child> element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwEntryRow has a single CSS node with name row and the .entry style class.

func NewEntryRow

func NewEntryRow() *EntryRow

NewEntryRow creates a new AdwEntryRow.

The function returns the following values:

  • entryRow: newly created AdwEntryRow.

func (*EntryRow) ActivatesDefault

func (self *EntryRow) ActivatesDefault() bool

ActivatesDefault gets whether activating the embedded entry can activate the default widget.

The function returns the following values:

  • ok: whether to activate the default widget.

func (*EntryRow) AddPrefix

func (self *EntryRow) AddPrefix(widget gtk.Widgetter)

AddPrefix adds a prefix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*EntryRow) AddSuffix

func (self *EntryRow) AddSuffix(widget gtk.Widgetter)

AddSuffix adds a suffix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*EntryRow) Attributes

func (self *EntryRow) Attributes() *pango.AttrList

Attributes gets Pango attributes applied to the text of the embedded entry.

The function returns the following values:

  • attrList (optional): list of attributes.

func (*EntryRow) ConnectApply

func (self *EntryRow) ConnectApply(f func()) coreglib.SignalHandle

ConnectApply is emitted when the apply button is pressed.

See entryrow:show-apply-button.

func (*EntryRow) ConnectEntryActivated

func (self *EntryRow) ConnectEntryActivated(f func()) coreglib.SignalHandle

ConnectEntryActivated is emitted when the embedded entry is activated.

func (*EntryRow) EnableEmojiCompletion

func (self *EntryRow) EnableEmojiCompletion() bool

EnableEmojiCompletion gets whether to suggest emoji replacements on self.

The function returns the following values:

  • ok: whether or not emoji completion is enabled.

func (*EntryRow) GrabFocusWithoutSelecting

func (self *EntryRow) GrabFocusWithoutSelecting() bool

GrabFocusWithoutSelecting causes self to have keyboard focus without selecting the text.

See gtk.Text.GrabFocusWithoutSelecting() for more information.

The function returns the following values:

  • ok: whether the focus is now inside self.

func (*EntryRow) InputHints

func (self *EntryRow) InputHints() gtk.InputHints

InputHints gets the additional input hints of self.

The function returns the following values:

  • inputHints: input hints.

func (*EntryRow) InputPurpose

func (self *EntryRow) InputPurpose() gtk.InputPurpose

InputPurpose gets the input purpose of self.

The function returns the following values:

  • inputPurpose: input purpose.

func (*EntryRow) Remove

func (self *EntryRow) Remove(widget gtk.Widgetter)

Remove removes a child from self.

The function takes the following parameters:

  • widget: child to be removed.

func (*EntryRow) SetActivatesDefault

func (self *EntryRow) SetActivatesDefault(activates bool)

SetActivatesDefault sets whether activating the embedded entry can activate the default widget.

The function takes the following parameters:

  • activates: whether to activate the default widget.

func (*EntryRow) SetAttributes

func (self *EntryRow) SetAttributes(attributes *pango.AttrList)

SetAttributes sets Pango attributes to apply to the text of the embedded entry.

The pango.Attribute's start_index and end_index must refer to the gtk.EntryBuffer text, i.e. without the preedit string.

The function takes the following parameters:

  • attributes (optional): list of attributes.

func (*EntryRow) SetEnableEmojiCompletion

func (self *EntryRow) SetEnableEmojiCompletion(enableEmojiCompletion bool)

SetEnableEmojiCompletion sets whether to suggest emoji replacements on self.

Emoji replacement is done with :-delimited names, like :heart:.

The function takes the following parameters:

  • enableEmojiCompletion: whether emoji completion should be enabled or not.

func (*EntryRow) SetInputHints

func (self *EntryRow) SetInputHints(hints gtk.InputHints)

SetInputHints: set additional input hints for self.

Input hints allow input methods to fine-tune their behavior.

See also: adwentryrow:input-purpose.

The function takes the following parameters:

  • hints: hints.

func (*EntryRow) SetInputPurpose

func (self *EntryRow) SetInputPurpose(purpose gtk.InputPurpose)

SetInputPurpose sets the input purpose of self.

The input purpose can be used by input methods to adjust their behavior.

The function takes the following parameters:

  • purpose: purpose.

func (*EntryRow) SetShowApplyButton

func (self *EntryRow) SetShowApplyButton(showApplyButton bool)

SetShowApplyButton sets whether self can show the apply button.

When set to TRUE, typing text in the entry will reveal an apply button. Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and emit the entryrow::apply signal.

This is useful if changing the entry contents can trigger an expensive operation, e.g. network activity, to avoid triggering it after typing every character.

The function takes the following parameters:

  • showApplyButton: whether to show the apply button.

func (*EntryRow) ShowApplyButton

func (self *EntryRow) ShowApplyButton() bool

ShowApplyButton gets whether self can show the apply button.

The function returns the following values:

  • ok: whether to show the apply button.

type EntryRowClass

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

EntryRowClass: instance of this type is always passed by reference.

func (*EntryRowClass) ParentClass

func (e *EntryRowClass) ParentClass() *PreferencesRowClass

ParentClass: parent class.

type EntryRowOverrides

type EntryRowOverrides struct {
}

EntryRowOverrides contains methods that are overridable.

type EnumListItem

type EnumListItem struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

EnumListItem: AdwEnumListItem is the type of items in a enumlistmodel.

func (*EnumListItem) Name

func (self *EnumListItem) Name() string

Name gets the enum value name.

The function returns the following values:

  • utf8: enum value name.

func (*EnumListItem) Nick

func (self *EnumListItem) Nick() string

Nick gets the enum value nick.

The function returns the following values:

  • utf8: enum value nick.

func (*EnumListItem) Value

func (self *EnumListItem) Value() int

Value gets the enum value.

The function returns the following values:

  • gint: enum value.

type EnumListItemClass

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

EnumListItemClass: instance of this type is always passed by reference.

type EnumListItemOverrides

type EnumListItemOverrides struct {
}

EnumListItemOverrides contains methods that are overridable.

type EnumListModel

type EnumListModel struct {
	*coreglib.Object

	gio.ListModel
	// contains filtered or unexported fields
}

EnumListModel: gio.ListModel representing values of a given enum.

AdwEnumListModel contains objects of type enumlistitem.

func NewEnumListModel

func NewEnumListModel(enumType coreglib.Type) *EnumListModel

NewEnumListModel creates a new AdwEnumListModel for enum_type.

The function takes the following parameters:

  • enumType: type of the enum to construct the model from.

The function returns the following values:

  • enumListModel: newly created AdwEnumListModel.

func (*EnumListModel) EnumType

func (self *EnumListModel) EnumType() coreglib.Type

EnumType gets the type of the enum represented by self.

The function returns the following values:

  • gType: enum type.

func (*EnumListModel) FindPosition

func (self *EnumListModel) FindPosition(value int) uint

FindPosition finds the position of a given enum value in self.

If the value is not found, GTK_INVALID_LIST_POSITION is returned.

The function takes the following parameters:

  • value: enum value.

The function returns the following values:

type EnumListModelClass

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

EnumListModelClass: instance of this type is always passed by reference.

type EnumListModelOverrides

type EnumListModelOverrides struct {
}

EnumListModelOverrides contains methods that are overridable.

type ExpanderRow

type ExpanderRow struct {
	PreferencesRow
	// contains filtered or unexported fields
}

ExpanderRow: gtk.ListBoxRow used to reveal widgets.

<picture> <source srcset="expander-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="expander-row.png" alt="expander-row"> </picture>

The AdwExpanderRow widget allows the user to reveal or hide widgets below it. It also allows the user to enable the expansion of the row, allowing to disable all that the row contains.

AdwExpanderRow as GtkBuildable

The AdwExpanderRow implementation of the gtk.Buildable interface supports adding a child as an suffix widget by specifying “suffix” as the “type” attribute of a <child> element.

It also supports adding it as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwExpanderRow has a main CSS node with name row and the .expander style class. It has the .empty style class when it contains no children.

It contains the subnodes row.header for its main embedded row, list.nested for the list it can expand, and image.expander-row-arrow for its arrow.

func NewExpanderRow

func NewExpanderRow() *ExpanderRow

NewExpanderRow creates a new AdwExpanderRow.

The function returns the following values:

  • expanderRow: newly created AdwExpanderRow.

func (*ExpanderRow) AddAction deprecated

func (self *ExpanderRow) AddAction(widget gtk.Widgetter)

AddAction adds an action widget to self.

Deprecated: Use expanderrow.AddSuffix to add a suffix.

The function takes the following parameters:

  • widget: widget.

func (*ExpanderRow) AddPrefix

func (self *ExpanderRow) AddPrefix(widget gtk.Widgetter)

AddPrefix adds a prefix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*ExpanderRow) AddRow

func (self *ExpanderRow) AddRow(child gtk.Widgetter)

AddRow adds a widget to self.

The widget will appear in the expanding list below self.

The function takes the following parameters:

  • child: widget.

func (*ExpanderRow) AddSuffix

func (self *ExpanderRow) AddSuffix(widget gtk.Widgetter)

AddSuffix adds an suffix widget to self.

The function takes the following parameters:

  • widget: widget.

func (*ExpanderRow) EnableExpansion

func (self *ExpanderRow) EnableExpansion() bool

EnableExpansion gets whether the expansion of self is enabled.

The function returns the following values:

  • ok: whether the expansion of self is enabled.

func (*ExpanderRow) Expanded

func (self *ExpanderRow) Expanded() bool

Expanded gets whether self is expanded.

The function returns the following values:

  • ok: whether self is expanded.

func (*ExpanderRow) IconName deprecated

func (self *ExpanderRow) IconName() string

IconName gets the icon name for self.

Deprecated: Use expanderrow.AddPrefix to add an icon.

The function returns the following values:

  • utf8 (optional): icon name for self.

func (*ExpanderRow) Remove

func (self *ExpanderRow) Remove(child gtk.Widgetter)

The function takes the following parameters:

func (*ExpanderRow) SetEnableExpansion

func (self *ExpanderRow) SetEnableExpansion(enableExpansion bool)

SetEnableExpansion sets whether the expansion of self is enabled.

The function takes the following parameters:

  • enableExpansion: whether to enable the expansion.

func (*ExpanderRow) SetExpanded

func (self *ExpanderRow) SetExpanded(expanded bool)

SetExpanded sets whether self is expanded.

The function takes the following parameters:

  • expanded: whether to expand the row.

func (*ExpanderRow) SetIconName deprecated

func (self *ExpanderRow) SetIconName(iconName string)

SetIconName sets the icon name for self.

Deprecated: Use expanderrow.AddPrefix to add an icon.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*ExpanderRow) SetShowEnableSwitch

func (self *ExpanderRow) SetShowEnableSwitch(showEnableSwitch bool)

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

The function takes the following parameters:

  • showEnableSwitch: whether to show the switch enabling the expansion.

func (*ExpanderRow) SetSubtitle

func (self *ExpanderRow) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle for self.

The subtitle is interpreted as Pango markup unless preferencesrow:use-markup is set to FALSE.

The function takes the following parameters:

  • subtitle: subtitle.

func (*ExpanderRow) SetSubtitleLines

func (self *ExpanderRow) 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.

The function takes the following parameters:

  • subtitleLines: number of lines at the end of which the subtitle label will be ellipsized.

func (*ExpanderRow) SetTitleLines

func (self *ExpanderRow) 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.

The function takes the following parameters:

  • titleLines: number of lines at the end of which the title label will be ellipsized.

func (*ExpanderRow) ShowEnableSwitch

func (self *ExpanderRow) ShowEnableSwitch() bool

ShowEnableSwitch gets whether the switch enabling the expansion of self is visible.

The function returns the following values:

  • ok: whether the switch enabling the expansion is visible.

func (*ExpanderRow) Subtitle

func (self *ExpanderRow) Subtitle() string

Subtitle gets the subtitle for self.

The function returns the following values:

  • utf8: subtitle for self.

func (*ExpanderRow) SubtitleLines

func (self *ExpanderRow) SubtitleLines() bool

SubtitleLines gets the number of lines at the end of which the subtitle label will be ellipsized.

The function returns the following values:

  • ok: number of lines at the end of which the subtitle label will be ellipsized.

func (*ExpanderRow) TitleLines

func (self *ExpanderRow) TitleLines() bool

TitleLines gets the number of lines at the end of which the title label will be ellipsized.

The function returns the following values:

  • ok: number of lines at the end of which the title label will be ellipsized.

type ExpanderRowClass

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

ExpanderRowClass: instance of this type is always passed by reference.

func (*ExpanderRowClass) ParentClass

func (e *ExpanderRowClass) ParentClass() *PreferencesRowClass

ParentClass: parent class.

type ExpanderRowOverrides

type ExpanderRowOverrides struct {
}

ExpanderRowOverrides contains methods that are overridable.

type Flap deprecated

type Flap struct {
	gtk.Widget

	*coreglib.Object
	Swipeable
	gtk.Orientable
	// contains filtered or unexported fields
}

Flap: adaptive container acting like a box or an overlay.

<picture> <source srcset="flap-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="flap-wide.png" alt="flap-wide"> </picture> <picture> <source srcset="flap-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="flap-narrow.png" alt="flap-narrow"> </picture>

The AdwFlap widget can display its children like a gtk.Box does or like a gtk.Overlay does, according to the flap:fold-policy value.

AdwFlap has at most three children: flap:content, flap:flap and flap:separator. Content is the primary child, flap is displayed next to it when unfolded, or overlays it when folded. Flap can be shown or hidden by changing the flap:reveal-flap value, as well as via swipe gestures if flap:swipe-to-open and/or flap:swipe-to-close are set to TRUE.

Optionally, a separator can be provided, which would be displayed between the content and the flap when there's no shadow to separate them, depending on the transition type.

flap:flap is transparent by default; add the .background (style-classes.html#background) style class to it if this is unwanted.

If flap:modal is set to TRUE, content becomes completely inaccessible when the flap is revealed while folded.

The position of the flap and separator children relative to the content is determined by orientation, as well as the flap:flap-position value.

Folding the flap will automatically hide the flap widget, and unfolding it will automatically reveal it. If this behavior is not desired, the flap:locked property can be used to override it.

Common use cases include sidebars, header bars that need to be able to overlap the window content (for example, in fullscreen mode) and bottom sheets.

AdwFlap as GtkBuildable

The AdwFlap implementation of the gtk.Buildable interface supports setting the flap child by specifying “flap” as the “type” attribute of a <child> element, and separator by specifying “separator”. Specifying “content” child type or omitting it results in setting the content child.

CSS nodes

AdwFlap has a single CSS node with name flap. The node will get the style classes .folded when it is folded, and .unfolded when it's not.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

func NewFlap deprecated

func NewFlap() *Flap

NewFlap creates a new AdwFlap.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • flap: newly created AdwFlap.

func (*Flap) Content deprecated

func (self *Flap) Content() gtk.Widgetter

Content gets the content widget for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • widget (optional): content widget for self.

func (*Flap) Flap deprecated

func (self *Flap) Flap() gtk.Widgetter

Flap gets the flap widget for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • widget (optional): flap widget for self.

func (*Flap) FlapPosition deprecated

func (self *Flap) FlapPosition() gtk.PackType

FlapPosition gets the flap position for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • packType: flap position for self.

func (*Flap) FoldDuration deprecated

func (self *Flap) FoldDuration() uint

FoldDuration gets the fold transition animation duration for self, in milliseconds.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • guint: fold transition duration.

func (*Flap) FoldPolicy deprecated

func (self *Flap) FoldPolicy() FlapFoldPolicy

FoldPolicy gets the fold policy for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • flapFoldPolicy: fold policy for self.

func (*Flap) FoldThresholdPolicy deprecated

func (self *Flap) FoldThresholdPolicy() FoldThresholdPolicy

FoldThresholdPolicy gets the fold threshold policy for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

func (*Flap) Folded deprecated

func (self *Flap) Folded() bool

Folded gets whether self is currently folded.

See flap:fold-policy.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if self is currently folded.

func (*Flap) Locked deprecated

func (self *Flap) Locked() bool

Locked gets whether self is locked.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if self is locked.

func (*Flap) Modal deprecated

func (self *Flap) Modal() bool

Modal gets whether self is modal.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if self is modal.

func (*Flap) RevealFlap deprecated

func (self *Flap) RevealFlap() bool

RevealFlap gets whether the flap widget is revealed for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if the flap widget is revealed.

func (*Flap) RevealParams deprecated

func (self *Flap) RevealParams() *SpringParams

RevealParams gets the reveal animation spring parameters for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • springParams: reveal animation parameters.

func (*Flap) RevealProgress deprecated

func (self *Flap) RevealProgress() float64

RevealProgress gets the current reveal progress for self.

0 means fully hidden, 1 means fully revealed.

See flap:reveal-flap.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • gdouble: current reveal progress for self.

func (*Flap) Separator deprecated

func (self *Flap) Separator() gtk.Widgetter

Separator gets the separator widget for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • widget (optional): separator widget for self.

func (*Flap) SetContent deprecated

func (self *Flap) SetContent(content gtk.Widgetter)

SetContent sets the content widget for self.

It's always displayed when unfolded, and partially visible when folded.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • content (optional) widget.

func (*Flap) SetFlap deprecated

func (self *Flap) SetFlap(flap gtk.Widgetter)

SetFlap sets the flap widget for self.

It's only visible when flap:reveal-progress is greater than 0.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • flap (optional) widget.

func (*Flap) SetFlapPosition deprecated

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

SetFlapPosition sets the flap position for self.

If it's set to GTK_PACK_START, the flap is displayed before the content, if GTK_PACK_END, it's displayed after the content.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • position: new value.

func (*Flap) SetFoldDuration deprecated

func (self *Flap) SetFoldDuration(duration uint)

SetFoldDuration sets the fold transition animation duration for self, in milliseconds.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • duration: new duration, in milliseconds.

func (*Flap) SetFoldPolicy deprecated

func (self *Flap) SetFoldPolicy(policy FlapFoldPolicy)

SetFoldPolicy sets the fold policy for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • policy: fold policy.

func (*Flap) SetFoldThresholdPolicy deprecated

func (self *Flap) SetFoldThresholdPolicy(policy FoldThresholdPolicy)

SetFoldThresholdPolicy sets the fold threshold policy for self.

If set to ADW_FOLD_THRESHOLD_POLICY_MINIMUM, flap will only fold when the children cannot fit anymore. With ADW_FOLD_THRESHOLD_POLICY_NATURAL, it will fold as soon as children don't get their natural size.

This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately folding.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • policy to use.

func (*Flap) SetLocked deprecated

func (self *Flap) SetLocked(locked bool)

SetLocked sets whether self is locked.

If FALSE, folding 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.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • locked: new value.

func (*Flap) SetModal deprecated

func (self *Flap) SetModal(modal bool)

SetModal sets whether self is modal.

If TRUE, clicking the content widget while flap is revealed, as well as pressing the <kbd>Esc</kbd> key, will close the flap. If FALSE, clicks are passed through to the content widget.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • modal: whether self is modal.

func (*Flap) SetRevealFlap deprecated

func (self *Flap) SetRevealFlap(revealFlap bool)

SetRevealFlap sets whether the flap widget is revealed for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • revealFlap: whether to reveal the flap widget.

func (*Flap) SetRevealParams deprecated

func (self *Flap) SetRevealParams(params *SpringParams)

SetRevealParams sets the reveal animation spring parameters for self.

The default value is equivalent to:

adw_spring_params_new (1, 0.5, 500)

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • params: new parameters.

func (*Flap) SetSeparator deprecated

func (self *Flap) SetSeparator(separator gtk.Widgetter)

SetSeparator sets the separator widget for self.

It's displayed between content and flap when there's no shadow to display. When exactly it's visible depends on the flap:transition-type value.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • separator (optional) widget.

func (*Flap) SetSwipeToClose deprecated

func (self *Flap) SetSwipeToClose(swipeToClose bool)

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

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

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • swipeToClose: whether self can be closed with a swipe gesture.

func (*Flap) SetSwipeToOpen deprecated

func (self *Flap) SetSwipeToOpen(swipeToOpen bool)

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

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

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • swipeToOpen: whether self can be opened with a swipe gesture.

func (*Flap) SetTransitionType deprecated

func (self *Flap) SetTransitionType(transitionType FlapTransitionType)

SetTransitionType sets the type of animation used for reveal and fold transitions in self.

flap:flap is transparent by default, which means the content will be seen through it with ADW_FLAP_TRANSITION_TYPE_OVER transitions; add the .background (style-classes.html#background) style class to it if this is unwanted.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function takes the following parameters:

  • transitionType: new transition type.

func (*Flap) SwipeToClose deprecated

func (self *Flap) SwipeToClose() bool

SwipeToClose gets whether self can be closed with a swipe gesture.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if self can be closed with a swipe gesture.

func (*Flap) SwipeToOpen deprecated

func (self *Flap) SwipeToOpen() bool

SwipeToOpen gets whether self can be opened with a swipe gesture.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • ok: TRUE if self can be opened with a swipe gesture.

func (*Flap) TransitionType deprecated

func (self *Flap) TransitionType() FlapTransitionType

TransitionType gets the type of animation used for reveal and fold transitions in self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

The function returns the following values:

  • flapTransitionType: current transition type of self.

type FlapClass

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

FlapClass: instance of this type is always passed by reference.

func (*FlapClass) ParentClass

func (f *FlapClass) ParentClass() *gtk.WidgetClass

type FlapFoldPolicy deprecated

type FlapFoldPolicy C.gint

FlapFoldPolicy describes the possible folding behavior of a flap widget.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

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

func (FlapFoldPolicy) String

func (f FlapFoldPolicy) String() string

String returns the name in string for FlapFoldPolicy.

type FlapOverrides

type FlapOverrides struct {
}

FlapOverrides contains methods that are overridable.

type FlapTransitionType deprecated

type FlapTransitionType C.gint

FlapTransitionType describes transitions types of a flap widget.

It determines the type of animation when transitioning between children in a flap widget, as well as which areas can be swiped via flap:swipe-to-open and flap:swipe-to-close.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwflap).

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

func (FlapTransitionType) String

func (f FlapTransitionType) String() string

String returns the name in string for FlapTransitionType.

type FoldThresholdPolicy deprecated

type FoldThresholdPolicy C.gint

FoldThresholdPolicy determines when flap and leaflet will fold.

Deprecated: Stop using AdwLeaflet and AdwFlap.

const (
	// FoldThresholdPolicyMinimum: folding is based on the minimum size.
	FoldThresholdPolicyMinimum FoldThresholdPolicy = iota
	// FoldThresholdPolicyNatural: folding is based on the natural size.
	FoldThresholdPolicyNatural
)

func (FoldThresholdPolicy) String

func (f FoldThresholdPolicy) String() string

String returns the name in string for FoldThresholdPolicy.

type HeaderBar

type HeaderBar struct {
	gtk.Widget
	// contains filtered or unexported fields
}

HeaderBar: title bar widget.

<picture> <source srcset="header-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="header-bar.png" alt="header-bar"> </picture>

AdwHeaderBar is similar to gtk.HeaderBar, but provides additional features compared to it. Refer to GtkHeaderBar for details. It is typically used as a top bar within toolbarview.

Navigation View Integration

When placed inside an navigationpage, AdwHeaderBar will display the page title instead of window title.

When used together with navigationview or navigationsplitview, it will also display a back button that can be used to go back to the previous page. The button also has a context menu, allowing to pop multiple pages at once, potentially across multiple navigation views. In rare scenarios, set headerbar:show-back-button to FALSE to disable the back button if it's unwanted (e.g. in an extra header bar on the same page).

Split View Integration

When placed inside AdwNavigationSplitView or AdwOverlaySplitView, AdwHeaderBar will automatically hide the title buttons other than at the edges of the window.

Centering Policy

headerbar:centering-policy allows to enforce strict centering of the title widget. This can be useful for entries inside clamp.

Title Buttons

Unlike GtkHeaderBar, AdwHeaderBar allows to toggle title button visibility for each side individually, using the headerbar:show-start-title-buttons and headerbar:show-end-title-buttons properties.

CSS nodes

headerbar
╰── windowhandle
    ╰── box
        ├── widget
        │   ╰── box.start
        │       ├── windowcontrols.start
        │       ├── widget
        │       │   ╰── [button.back]
        │       ╰── [other children]
        ├── widget
        │   ╰── [Title Widget]
        ╰── widget
            ╰── box.end
                ├── [other children]
                ╰── windowcontrols.end

AdwHeaderBar's CSS node is called headerbar. It contains a windowhandle subnode, which contains a box subnode, which contains three widget subnodes at the start, center and end of the header bar. The start and end subnotes contain a box subnode with the .start and .end style classes respectively, and the center node contains a node that represents the title.

Each of the boxes contains a windowcontrols subnode, see gtk.WindowControls for details, as well as other children.

When headerbar:show-back-button is TRUE, the start box also contains a node with the name widget that contains a node with the name button and .back style class.

Accessibility

AdwHeaderBar uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewHeaderBar

func NewHeaderBar() *HeaderBar

NewHeaderBar creates a new AdwHeaderBar.

The function returns the following values:

  • headerBar: newly created AdwHeaderBar.

func (*HeaderBar) CenteringPolicy

func (self *HeaderBar) CenteringPolicy() CenteringPolicy

CenteringPolicy gets the policy for aligning the center widget.

The function returns the following values:

  • centeringPolicy: centering policy.

func (*HeaderBar) DecorationLayout

func (self *HeaderBar) DecorationLayout() string

DecorationLayout gets the decoration layout for self.

The function returns the following values:

  • utf8 (optional): decoration layout.

func (*HeaderBar) PackEnd

func (self *HeaderBar) PackEnd(child gtk.Widgetter)

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

The function takes the following parameters:

  • child: widget to be added to self.

func (*HeaderBar) PackStart

func (self *HeaderBar) PackStart(child gtk.Widgetter)

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

The function takes the following parameters:

  • child: widget to be added to self.

func (*HeaderBar) Remove

func (self *HeaderBar) Remove(child gtk.Widgetter)

Remove removes a child from self.

The child must have been added with headerbar.PackStart, headerbar.PackEnd or headerbar:title-widget.

The function takes the following parameters:

  • child to remove.

func (*HeaderBar) SetCenteringPolicy

func (self *HeaderBar) SetCenteringPolicy(centeringPolicy CenteringPolicy)

SetCenteringPolicy sets the policy for aligning the center widget.

The function takes the following parameters:

  • centeringPolicy: centering policy.

func (*HeaderBar) SetDecorationLayout

func (self *HeaderBar) SetDecorationLayout(layout string)

SetDecorationLayout sets the decoration layout for self.

If this property is not set, the gtk.Settings:gtk-decoration-layout setting is used.

The format of the string is button names, separated by commas. A colon separates the buttons that should appear at the start from those at the end. Recognized button names are minimize, maximize, close and icon (the window icon).

For example, “icon:minimize,maximize,close” specifies an icon at the start, and minimize, maximize and close buttons at the end.

The function takes the following parameters:

  • layout (optional): decoration layout.

func (*HeaderBar) SetShowBackButton

func (self *HeaderBar) SetShowBackButton(showBackButton bool)

SetShowBackButton sets whether self can show the back button.

The back button will never be shown unless the header bar is placed inside an navigationview. Usually, there is no reason to set it to FALSE.

The function takes the following parameters:

  • showBackButton: whether to show the back button.

func (*HeaderBar) SetShowEndTitleButtons

func (self *HeaderBar) SetShowEndTitleButtons(setting bool)

SetShowEndTitleButtons sets whether to show title buttons at the end of self.

See headerbar:show-start-title-buttons for the other side.

Which buttons are actually shown and where is determined by the headerbar:decoration-layout property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

The function takes the following parameters:

  • setting: TRUE to show standard title buttons.

func (*HeaderBar) SetShowStartTitleButtons

func (self *HeaderBar) SetShowStartTitleButtons(setting bool)

SetShowStartTitleButtons sets whether to show title buttons at the start of self.

See headerbar:show-end-title-buttons for the other side.

Which buttons are actually shown and where is determined by the headerbar:decoration-layout property, and by the state of the window (e.g. a close button will not be shown if the window can't be closed).

The function takes the following parameters:

  • setting: TRUE to show standard title buttons.

func (*HeaderBar) SetShowTitle

func (self *HeaderBar) SetShowTitle(showTitle bool)

SetShowTitle sets whether the title widget should be shown.

The function takes the following parameters:

  • showTitle: whether the title widget is visible.

func (*HeaderBar) SetTitleWidget

func (self *HeaderBar) SetTitleWidget(titleWidget gtk.Widgetter)

SetTitleWidget sets the title widget for self.

When set to NULL, the header bar will display the title of the window it is contained in.

To use a different title, use windowtitle:

<object class="AdwHeaderBar">
  <property name="title-widget">
    <object class="AdwWindowTitle">
      <property name="title" translatable="yes">Title</property>
    </object>
  </property>
</object>.

The function takes the following parameters:

  • titleWidget (optional): widget to use for a title.

func (*HeaderBar) ShowBackButton

func (self *HeaderBar) ShowBackButton() bool

ShowBackButton gets whether self can show the back button.

The function returns the following values:

  • ok: whether to show the back button.

func (*HeaderBar) ShowEndTitleButtons

func (self *HeaderBar) ShowEndTitleButtons() bool

ShowEndTitleButtons gets whether to show title buttons at the end of self.

The function returns the following values:

  • ok: TRUE if title buttons at the end are shown.

func (*HeaderBar) ShowStartTitleButtons

func (self *HeaderBar) ShowStartTitleButtons() bool

ShowStartTitleButtons gets whether to show title buttons at the start of self.

The function returns the following values:

  • ok: TRUE if title buttons at the start are shown.

func (*HeaderBar) ShowTitle

func (self *HeaderBar) ShowTitle() bool

ShowTitle gets whether the title widget should be shown.

The function returns the following values:

  • ok: whether the title widget should be shown.

func (*HeaderBar) TitleWidget

func (self *HeaderBar) TitleWidget() gtk.Widgetter

TitleWidget gets the title widget widget of self.

The function returns the following values:

  • widget (optional): title widget.

type HeaderBarClass

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

HeaderBarClass: instance of this type is always passed by reference.

func (*HeaderBarClass) ParentClass

func (h *HeaderBarClass) ParentClass() *gtk.WidgetClass

type HeaderBarOverrides

type HeaderBarOverrides struct {
}

HeaderBarOverrides contains methods that are overridable.

type Leaflet deprecated

type Leaflet struct {
	gtk.Widget

	*coreglib.Object
	Swipeable
	gtk.Orientable
	// contains filtered or unexported fields
}

Leaflet: adaptive container acting like a box or a stack.

<picture> <source srcset="leaflet-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="leaflet-wide.png" alt="leaflet-wide"> </picture> <picture> <source srcset="leaflet-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="leaflet-narrow.png" alt="leaflet-narrow"> </picture>

The AdwLeaflet widget can display its children like a gtk.Box does or like a gtk.Stack does, adapting to size changes by switching between the two modes.

When there is enough space the children are displayed side by side, otherwise only one is displayed and the leaflet is said to be “folded”. The threshold is dictated by the preferred minimum sizes of the children. When a leaflet is folded, the children can be navigated using swipe gestures.

The “over” and “under” transition types stack the children one on top of the other, while the “slide” transition puts the children side by side. While navigating to a child on the side or below can be performed by swiping the current child away, navigating to an upper child requires dragging it from the edge where it resides. This doesn't affect non-dragging swipes.

CSS nodes

AdwLeaflet has a single CSS node with name leaflet. The node will get the style classes .folded when it is folded, .unfolded when it's not, or none if it hasn't computed its fold yet.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

func NewLeaflet deprecated

func NewLeaflet() *Leaflet

NewLeaflet creates a new AdwLeaflet.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • leaflet: new created AdwLeaflet.

func (*Leaflet) AdjacentChild deprecated

func (self *Leaflet) AdjacentChild(direction NavigationDirection) gtk.Widgetter

AdjacentChild finds the previous or next navigatable child.

This will be the same child leaflet.Navigate or swipe gestures will navigate to.

If there's no child to navigate to, NULL will be returned instead.

See leafletpage:navigatable.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • direction: direction.

The function returns the following values:

  • widget (optional) previous or next child.

func (*Leaflet) Append deprecated

func (self *Leaflet) Append(child gtk.Widgetter) *LeafletPage

Append adds a child to self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • leafletPage: leafletpage for child.

func (*Leaflet) CanNavigateBack deprecated

func (self *Leaflet) CanNavigateBack() bool

CanNavigateBack gets whether gestures and shortcuts for navigating backward are enabled.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether gestures and shortcuts are enabled.

func (*Leaflet) CanNavigateForward deprecated

func (self *Leaflet) CanNavigateForward() bool

CanNavigateForward gets whether gestures and shortcuts for navigating forward are enabled.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether gestures and shortcuts are enabled.

func (*Leaflet) CanUnfold deprecated

func (self *Leaflet) CanUnfold() bool

CanUnfold gets whether self can unfold.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether self can unfold.

func (*Leaflet) ChildByName deprecated

func (self *Leaflet) ChildByName(name string) gtk.Widgetter

ChildByName finds the child of self with name.

Returns NULL if there is no child with this name.

See leafletpage:name.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • name of the child to find.

The function returns the following values:

  • widget (optional): requested child of self.

func (*Leaflet) ChildTransitionParams deprecated

func (self *Leaflet) ChildTransitionParams() *SpringParams

ChildTransitionParams gets the child transition spring parameters for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • springParams: child transition parameters.

func (*Leaflet) ChildTransitionRunning deprecated

func (self *Leaflet) ChildTransitionRunning() bool

ChildTransitionRunning gets whether a child transition is currently running for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether a transition is currently running.

func (*Leaflet) FoldThresholdPolicy deprecated

func (self *Leaflet) FoldThresholdPolicy() FoldThresholdPolicy

FoldThresholdPolicy gets the fold threshold policy for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

func (*Leaflet) Folded deprecated

func (self *Leaflet) Folded() bool

Folded gets whether self is folded.

The leaflet will be folded if the size allocated to it is smaller than the sum of the minimum or natural sizes of the children (see leaflet:fold-threshold-policy), it will be unfolded otherwise.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether self is folded.

func (*Leaflet) Homogeneous deprecated

func (self *Leaflet) Homogeneous() bool

Homogeneous gets whether self is homogeneous.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether self is homogeneous.

func (*Leaflet) InsertChildAfter deprecated

func (self *Leaflet) InsertChildAfter(child, sibling gtk.Widgetter) *LeafletPage

InsertChildAfter inserts child in the position after sibling in the list of children.

If sibling is NULL, inserts child at the first position.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child: widget to insert.
  • sibling (optional) after which to insert child.

The function returns the following values:

  • leafletPage: leafletpage for child.

func (*Leaflet) ModeTransitionDuration deprecated

func (self *Leaflet) ModeTransitionDuration() uint

ModeTransitionDuration gets the mode transition animation duration for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • guint: mode transition duration, in milliseconds.

func (*Leaflet) Navigate deprecated

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

Navigate navigates to the previous or next child.

The child must have the leafletpage:navigatable property set to TRUE, otherwise it will be skipped.

This will be the same child as returned by leaflet.GetAdjacentChild or navigated to via swipe gestures.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • direction: direction.

The function returns the following values:

  • ok: whether the visible child was changed.

func (*Leaflet) Page deprecated

func (self *Leaflet) Page(child gtk.Widgetter) *LeafletPage

Page returns the leafletpage object for child.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child of self.

The function returns the following values:

  • leafletPage: page object for child.

func (*Leaflet) Pages deprecated

func (self *Leaflet) Pages() *gtk.SelectionModel

Pages returns a gio.ListModel that contains the pages of the leaflet.

This can be used to keep an up-to-date view. The model also implements gtk.SelectionModel and can be used to track and change the visible page.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • selectionModel: GtkSelectionModel for the leaflet's children.

func (*Leaflet) Prepend deprecated

func (self *Leaflet) Prepend(child gtk.Widgetter) *LeafletPage

Prepend inserts child at the first position in self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child: widget to prepend.

The function returns the following values:

  • leafletPage: leafletpage for child.

func (*Leaflet) Remove deprecated

func (self *Leaflet) Remove(child gtk.Widgetter)

Remove removes a child widget from self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child to remove.

func (*Leaflet) ReorderChildAfter deprecated

func (self *Leaflet) ReorderChildAfter(child, sibling gtk.Widgetter)

ReorderChildAfter moves child to the position after sibling in the list of children.

If sibling is NULL, moves child to the first position.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • child: widget to move, must be a child of self.
  • sibling (optional) to move child after.

func (*Leaflet) SetCanNavigateBack deprecated

func (self *Leaflet) SetCanNavigateBack(canNavigateBack bool)

SetCanNavigateBack sets whether gestures and shortcuts for navigating backward are enabled.

The supported gestures are:

- One-finger swipe on touchscreens

- Horizontal scrolling on touchpads (usually two-finger swipe)

- Back/forward mouse buttons

The keyboard back/forward keys are also supported, as well as the <kbd>Alt</kbd>+<kbd>←</kbd> shortcut for horizontal orientation, or <kbd>Alt</kbd>+<kbd>↑</kbd> for vertical orientation.

If the orientation is horizontal, for right-to-left locales, gestures and shortcuts are reversed.

Only children that have leafletpage:navigatable set to TRUE can be navigated to.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • canNavigateBack: new value.

func (*Leaflet) SetCanNavigateForward deprecated

func (self *Leaflet) SetCanNavigateForward(canNavigateForward bool)

SetCanNavigateForward sets whether gestures and shortcuts for navigating forward are enabled.

The supported gestures are:

- One-finger swipe on touchscreens

- Horizontal scrolling on touchpads (usually two-finger swipe)

- Back/forward mouse buttons

The keyboard back/forward keys are also supported, as well as the <kbd>Alt</kbd>+<kbd>→</kbd> shortcut for horizontal orientation, or <kbd>Alt</kbd>+<kbd>↓</kbd> for vertical orientation.

If the orientation is horizontal, for right-to-left locales, gestures and shortcuts are reversed.

Only children that have leafletpage:navigatable set to TRUE can be navigated to.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • canNavigateForward: new value.

func (*Leaflet) SetCanUnfold deprecated

func (self *Leaflet) SetCanUnfold(canUnfold bool)

SetCanUnfold sets whether self can unfold.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • canUnfold: whether self can unfold.

func (*Leaflet) SetChildTransitionParams deprecated

func (self *Leaflet) SetChildTransitionParams(params *SpringParams)

SetChildTransitionParams sets the child transition spring parameters for self.

The default value is equivalent to:

adw_spring_params_new (1, 0.5, 500)

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • params: new parameters.

func (*Leaflet) SetFoldThresholdPolicy deprecated

func (self *Leaflet) SetFoldThresholdPolicy(policy FoldThresholdPolicy)

SetFoldThresholdPolicy sets the fold threshold policy for self.

If set to ADW_FOLD_THRESHOLD_POLICY_MINIMUM, it will only fold when the children cannot fit anymore. With ADW_FOLD_THRESHOLD_POLICY_NATURAL, it will fold as soon as children don't get their natural size.

This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately folding.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • policy to use.

func (*Leaflet) SetHomogeneous deprecated

func (self *Leaflet) SetHomogeneous(homogeneous bool)

SetHomogeneous sets self to be homogeneous or not.

If set to FALSE, different children can have different size along the opposite orientation.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • homogeneous: whether to make self homogeneous.

func (*Leaflet) SetModeTransitionDuration deprecated

func (self *Leaflet) SetModeTransitionDuration(duration uint)

SetModeTransitionDuration sets the mode transition animation duration for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • duration: new duration, in milliseconds.

func (*Leaflet) SetTransitionType deprecated

func (self *Leaflet) SetTransitionType(transition LeafletTransitionType)

SetTransitionType sets the type of animation used for transitions between modes and children.

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.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • transition: new transition type.

func (*Leaflet) SetVisibleChild deprecated

func (self *Leaflet) SetVisibleChild(visibleChild gtk.Widgetter)

SetVisibleChild sets the widget currently visible when the leaflet is folded.

The transition is determined by leaflet:transition-type and leaflet:child-transition-params. The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • visibleChild: new child.

func (*Leaflet) SetVisibleChildName deprecated

func (self *Leaflet) SetVisibleChildName(name string)

SetVisibleChildName makes the child with the name name visible.

See leaflet:visible-child.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • name of a child.

func (*Leaflet) TransitionType deprecated

func (self *Leaflet) TransitionType() LeafletTransitionType

TransitionType gets the type of animation used for transitions between modes and children.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • leafletTransitionType: current transition type of self.

func (*Leaflet) VisibleChild deprecated

func (self *Leaflet) VisibleChild() gtk.Widgetter

VisibleChild gets the widget currently visible when the leaflet is folded.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • widget (optional): visible child.

func (*Leaflet) VisibleChildName deprecated

func (self *Leaflet) VisibleChildName() string

VisibleChildName gets the name of the currently visible child widget.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • utf8 (optional): name of the visible child.

type LeafletClass

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

LeafletClass: instance of this type is always passed by reference.

func (*LeafletClass) ParentClass

func (l *LeafletClass) ParentClass() *gtk.WidgetClass

type LeafletOverrides

type LeafletOverrides struct {
}

LeafletOverrides contains methods that are overridable.

type LeafletPage deprecated

type LeafletPage struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

LeafletPage: auxiliary class used by leaflet.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

func (*LeafletPage) Child deprecated

func (self *LeafletPage) Child() gtk.Widgetter

Child gets the leaflet child to which self belongs.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • widget: child to which self belongs.

func (*LeafletPage) Name deprecated

func (self *LeafletPage) Name() string

Name gets the name of self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • utf8 (optional): name of self.

func (*LeafletPage) Navigatable deprecated

func (self *LeafletPage) Navigatable() bool

Navigatable gets whether the child can be navigated to when folded.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function returns the following values:

  • ok: whether self can be navigated to when folded.

func (*LeafletPage) SetName deprecated

func (self *LeafletPage) SetName(name string)

SetName sets the name of the self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • name (optional): new value to set.

func (*LeafletPage) SetNavigatable deprecated

func (self *LeafletPage) SetNavigatable(navigatable bool)

SetNavigatable sets whether self can be navigated to when folded.

If FALSE, the child will be ignored by leaflet.GetAdjacentChild, leaflet.Navigate, and swipe gestures.

This can be used used to prevent switching to widgets like separators.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

The function takes the following parameters:

  • navigatable: whether self can be navigated to when folded.

type LeafletPageClass

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

LeafletPageClass: instance of this type is always passed by reference.

type LeafletPageOverrides

type LeafletPageOverrides struct {
}

LeafletPageOverrides contains methods that are overridable.

type LeafletTransitionType deprecated

type LeafletTransitionType C.gint

LeafletTransitionType describes the possible transitions in a leaflet widget.

New values may be added to this enumeration over time.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwleaflet).

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 = iota
	// 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
	// LeafletTransitionTypeSlide: slide from left, right, up or down according
	// to the orientation, text direction and the children order.
	LeafletTransitionTypeSlide
)

func (LeafletTransitionType) String

func (l LeafletTransitionType) String() string

String returns the name in string for LeafletTransitionType.

type LengthUnit

type LengthUnit C.gint

LengthUnit describes length units.

| Unit | Regular Text | Large Text | | ---- | ------------ | ---------- | | 1px | 1px | 1px | | 1pt | 1.333333px | 1.666667px | | 1sp | 1px | 1.25px |

New values may be added to this enumeration over time.

const (
	// LengthUnitPx: pixels.
	LengthUnitPx LengthUnit = iota
	// LengthUnitPt: points, changes with text scale factor.
	LengthUnitPt
	// LengthUnitSp: scale independent pixels, changes with text scale factor.
	LengthUnitSp
)

func (LengthUnit) String

func (l LengthUnit) String() string

String returns the name in string for LengthUnit.

type MessageDialog

type MessageDialog struct {
	gtk.Window
	// contains filtered or unexported fields
}

MessageDialog: dialog presenting a message or a question.

<picture> <source srcset="message-dialog-dark.png" media="(prefers-color-scheme: dark)"> <img src="message-dialog.png" alt="message-dialog"> </picture>

Message dialogs have a heading, a body, an optional child widget, and one or multiple responses, each presented as a button.

Each response has a unique string ID, and a button label. Additionally, each response can be enabled or disabled, and can have a suggested or destructive appearance.

When one of the responses is activated, or the dialog is closed, the messagedialog::response signal will be emitted. This signal is detailed, and the detail, as well as the response parameter will be set to the ID of the activated response, or to the value of the messagedialog:close-response property if the dialog had been closed without activating any of the responses.

Response buttons can be presented horizontally or vertically depending on available space.

When a response is activated, AdwMessageDialog is closed automatically.

An example of using a message dialog:

GtkWidget *dialog;

dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);

adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
                                _("A file named “s” already exists. Do you want to replace it?"),
                                filename);

adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
                                  "cancel",  _("_Cancel"),
                                  "replace", _("_Replace"),
                                  NULL);

adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);

adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");

g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self);

gtk_window_present (GTK_WINDOW (dialog));

Async API

AdwMessageDialog can also be used via the messagedialog.Choose method. This API follows the GIO async pattern, and the result can be obtained by calling messagedialog.ChooseFinish, for example:

static void
dialog_cb (AdwMessageDialog *dialog,
           GAsyncResult     *result,
           MyWindow         *self)
{
  const char *response = adw_message_dialog_choose_finish (dialog, result);

  // ...
}

static void
show_dialog (MyWindow *self)
{
  GtkWidget *dialog;

  dialog = adw_message_dialog_new (GTK_WINDOW (self), _("Replace File?"), NULL);

  adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
                                  _("A file named “s” already exists. Do you want to replace it?"),
                                  filename);

  adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
                                    "cancel",  _("_Cancel"),
                                    "replace", _("_Replace"),
                                    NULL);

  adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);

  adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
  adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");

  adw_message_dialog_choose (ADW_MESSAGE_DIALOG (dialog), NULL, (GAsyncReadyCallback) dialog_cb, self);
}

AdwMessageDialog as GtkBuildable

AdwMessageDialog supports adding responses in UI definitions by via the <responses> element that may contain multiple <response> elements, each respresenting a response.

Each of the <response> elements must have the id attribute specifying the response ID. The contents of the element are used as the response label.

Response labels can be translated with the usual translatable, context and comments attributes.

The <response> elements can also have enabled and/or appearance attributes. See messagedialog.SetResponseEnabled and messagedialog.SetResponseAppearance for details.

Example of an AdwMessageDialog UI definition:

<object class="AdwMessageDialog" id="dialog">
  <property name="heading" translatable="yes">Save Changes?</property>
  <property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property>
  <property name="default-response">save</property>
  <property name="close-response">cancel</property>
  <signal name="response" handler="response_cb"/>
  <responses>
    <response id="cancel" translatable="yes">_Cancel</response>
    <response id="discard" translatable="yes" appearance="destructive">_Discard</response>
    <response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response>
  </responses>
</object>

Accessibility

AdwMessageDialog uses the GTK_ACCESSIBLE_ROLE_DIALOG role.

func NewMessageDialog

func NewMessageDialog(parent *gtk.Window, heading, body string) *MessageDialog

NewMessageDialog creates a new AdwMessageDialog.

heading and body can be set to NULL. This can be useful if they need to be formatted or use markup. In that case, set them to NULL and call messagedialog.FormatBody or similar methods afterwards:

GtkWidget *dialog;

dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
                                _("A file named “s” already exists.  Do you want to replace it?"),
                                filename);.

The function takes the following parameters:

  • parent (optional): transient parent.
  • heading (optional): heading.
  • body (optional) text.

The function returns the following values:

  • messageDialog: newly created AdwMessageDialog.

func (*MessageDialog) AddResponse

func (self *MessageDialog) AddResponse(id, label string)

AddResponse adds a response with id and label to self.

Responses are represented as buttons in the dialog.

Response ID must be unique. It will be used in messagedialog::response to tell which response had been activated, as well as to inspect and modify the response later.

An embedded underline in label indicates a mnemonic.

messagedialog.SetResponseLabel can be used to change the response label after it had been added.

messagedialog.SetResponseEnabled and messagedialog.SetResponseAppearance can be used to customize the responses further.

The function takes the following parameters:

  • id: response ID.
  • label: response label.

func (*MessageDialog) Body

func (self *MessageDialog) Body() string

Body gets the body text of self.

The function returns the following values:

  • utf8: body of self.

func (*MessageDialog) BodyUseMarkup

func (self *MessageDialog) BodyUseMarkup() bool

BodyUseMarkup gets whether the body text of self includes Pango markup.

The function returns the following values:

  • ok: whether self uses markup for body text.

func (*MessageDialog) ChooseFinish

func (self *MessageDialog) ChooseFinish(result gio.AsyncResulter) string

ChooseFinish finishes the messagedialog.Choose call and returns the response ID.

The function takes the following parameters:

  • result: GAsyncResult.

The function returns the following values:

  • utf8: ID of the response that was selected, or messagedialog:close-response if the call was cancelled.

func (*MessageDialog) CloseResponse

func (self *MessageDialog) CloseResponse() string

CloseResponse gets the ID of the close response of self.

The function returns the following values:

  • utf8: close response ID.

func (*MessageDialog) ConnectResponse

func (self *MessageDialog) ConnectResponse(f func(response string)) coreglib.SignalHandle

ConnectResponse: this signal is emitted when the dialog is closed.

response will be set to the response ID of the button that had been activated.

if the dialog was closed by pressing <kbd>Escape</kbd> or with a system action, response will be set to the value of messagedialog:close-response.

func (*MessageDialog) DefaultResponse

func (self *MessageDialog) DefaultResponse() string

DefaultResponse gets the ID of the default response of self.

The function returns the following values:

  • utf8 (optional): default response ID.

func (*MessageDialog) ExtraChild

func (self *MessageDialog) ExtraChild() gtk.Widgetter

ExtraChild gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*MessageDialog) HasResponse

func (self *MessageDialog) HasResponse(response string) bool

HasResponse gets whether self has a response with the ID response.

The function takes the following parameters:

  • response ID.

The function returns the following values:

  • ok: whether self has a response with the ID response.

func (*MessageDialog) Heading

func (self *MessageDialog) Heading() string

Heading gets the heading of self.

The function returns the following values:

  • utf8 (optional): heading of self.

func (*MessageDialog) HeadingUseMarkup

func (self *MessageDialog) HeadingUseMarkup() bool

HeadingUseMarkup gets whether the heading of self includes Pango markup.

The function returns the following values:

  • ok: whether self uses markup for heading.

func (*MessageDialog) Response

func (self *MessageDialog) Response(response string)

Response emits the messagedialog::response signal with the given response ID.

Used to indicate that the user has responded to the dialog in some way.

The function takes the following parameters:

  • response ID.

func (*MessageDialog) ResponseAppearance

func (self *MessageDialog) ResponseAppearance(response string) ResponseAppearance

ResponseAppearance gets the appearance of response.

See messagedialog.SetResponseAppearance.

The function takes the following parameters:

  • response ID.

The function returns the following values:

  • responseAppearance: appearance of response.

func (*MessageDialog) ResponseEnabled

func (self *MessageDialog) ResponseEnabled(response string) bool

ResponseEnabled gets whether response is enabled.

See messagedialog.SetResponseEnabled.

The function takes the following parameters:

  • response ID.

The function returns the following values:

  • ok: whether response is enabled.

func (*MessageDialog) ResponseLabel

func (self *MessageDialog) ResponseLabel(response string) string

ResponseLabel gets the label of response.

See messagedialog.SetResponseLabel.

The function takes the following parameters:

  • response ID.

The function returns the following values:

  • utf8: label of response.

func (*MessageDialog) SetBody

func (self *MessageDialog) SetBody(body string)

SetBody sets the body text of self.

The function takes the following parameters:

  • body of self.

func (*MessageDialog) SetBodyUseMarkup

func (self *MessageDialog) SetBodyUseMarkup(useMarkup bool)

SetBodyUseMarkup sets whether the body text of self includes Pango markup.

See pango.ParseMarkup().

The function takes the following parameters:

  • useMarkup: whether to use markup for body text.

func (*MessageDialog) SetCloseResponse

func (self *MessageDialog) SetCloseResponse(response string)

SetCloseResponse sets the ID of the close response of self.

It will be passed to messagedialog::response if the window is closed by pressing <kbd>Escape</kbd> or with a system action.

It doesn't have to correspond to any of the responses in the dialog.

The default close response is close.

The function takes the following parameters:

  • response: close response ID.

func (*MessageDialog) SetDefaultResponse

func (self *MessageDialog) SetDefaultResponse(response string)

SetDefaultResponse sets the ID of the default response of self.

If set, pressing <kbd>Enter</kbd> will activate the corresponding button.

If set to NULL or to a non-existent response ID, pressing <kbd>Enter</kbd> will do nothing.

The function takes the following parameters:

  • response (optional): default response ID.

func (*MessageDialog) SetExtraChild

func (self *MessageDialog) SetExtraChild(child gtk.Widgetter)

SetExtraChild sets the child widget of self.

The child widget is displayed below the heading and body.

The function takes the following parameters:

  • child (optional) widget.

func (*MessageDialog) SetHeading

func (self *MessageDialog) SetHeading(heading string)

SetHeading sets the heading of self.

The function takes the following parameters:

  • heading (optional) of self.

func (*MessageDialog) SetHeadingUseMarkup

func (self *MessageDialog) SetHeadingUseMarkup(useMarkup bool)

SetHeadingUseMarkup sets whether the heading of self includes Pango markup.

See pango.ParseMarkup().

The function takes the following parameters:

  • useMarkup: whether to use markup for heading.

func (*MessageDialog) SetResponseAppearance

func (self *MessageDialog) SetResponseAppearance(response string, appearance ResponseAppearance)

SetResponseAppearance sets the appearance for response.

<picture> <source srcset="message-dialog-appearance-dark.png" media="(prefers-color-scheme: dark)"> <img src="message-dialog-appearance.png" alt="message-dialog-appearance"> </picture>

Use ADW_RESPONSE_SUGGESTED to mark important responses such as the affirmative action, like the Save button in the example.

Use ADW_RESPONSE_DESTRUCTIVE to draw attention to the potentially damaging consequences of using response. This appearance acts as a warning to the user. The Discard button in the example is using this appearance.

The default appearance is ADW_RESPONSE_DEFAULT.

Negative responses like Cancel or Close should use the default appearance.

The function takes the following parameters:

  • response ID.
  • appearance for response.

func (*MessageDialog) SetResponseEnabled

func (self *MessageDialog) SetResponseEnabled(response string, enabled bool)

SetResponseEnabled sets whether response is enabled.

If response is not enabled, the corresponding button will have gtk.Widget:sensitive set to FALSE and it can't be activated as a default response.

response can still be used as messagedialog:close-response while it's not enabled.

Responses are enabled by default.

The function takes the following parameters:

  • response ID.
  • enabled: whether to enable response.

func (*MessageDialog) SetResponseLabel

func (self *MessageDialog) SetResponseLabel(response, label string)

SetResponseLabel sets the label of response to label.

Labels are displayed on the dialog buttons. An embedded underline in label indicates a mnemonic.

The function takes the following parameters:

  • response ID.
  • label of response.

type MessageDialogClass

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

MessageDialogClass: instance of this type is always passed by reference.

func (*MessageDialogClass) ParentClass

func (m *MessageDialogClass) ParentClass() *gtk.WindowClass

type MessageDialogOverrides

type MessageDialogOverrides struct {
	// Response emits the messagedialog::response signal with the given response
	// ID.
	//
	// Used to indicate that the user has responded to the dialog in some way.
	//
	// The function takes the following parameters:
	//
	//   - response ID.
	//
	Response func(response string)
}

MessageDialogOverrides contains methods that are overridable.

type NavigationDirection C.gint

NavigationDirection describes the direction of a swipe navigation gesture.

const (
	// NavigationDirectionBack corresponds to start or top, depending on
	// orientation and text direction.
	NavigationDirectionBack NavigationDirection = iota
	// NavigationDirectionForward corresponds to end or bottom, depending on
	// orientation and text direction.
	NavigationDirectionForward
)
func (n NavigationDirection) String() string

String returns the name in string for NavigationDirection.

type NavigationPage struct {
	gtk.Widget
	// contains filtered or unexported fields
}

NavigationPage: page within navigationview or navigationsplitview.

Each page has a child widget, a title and optionally a tag.

The navigationpage::showing, navigationpage::shown, navigationpage::hiding and navigationpage::hidden signals can be used to track the page's visibility within its AdwNavigationView.

Header Bar Integration

When placed inside AdwNavigationPage, headerbar will display the page title instead of window title.

When used together with navigationview, it will also display a back button that can be used to go back to the previous page. Set headerbar:show-back-button to FALSE to disable that behavior if it's unwanted.

CSS Nodes

AdwNavigationPage has a single CSS node with name navigation-view-page.

Accessibility

AdwNavigationPage uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewNavigationPage

func NewNavigationPage(child gtk.Widgetter, title string) *NavigationPage

NewNavigationPage creates a new AdwNavigationPage.

The function takes the following parameters:

  • child widget.
  • title: page title.

The function returns the following values:

  • navigationPage: new created AdwNavigationPage.

func NewNavigationPageWithTag

func NewNavigationPageWithTag(child gtk.Widgetter, title, tag string) *NavigationPage

NewNavigationPageWithTag creates a new AdwNavigationPage with provided tag.

The function takes the following parameters:

  • child widget.
  • title: page title.
  • tag: page tag.

The function returns the following values:

  • navigationPage: new created AdwNavigationPage.
func (self *NavigationPage) CanPop() bool

CanPop gets whether self can be popped from navigation stack.

The function returns the following values:

  • ok: whether the page can be popped from navigation stack.
func (self *NavigationPage) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.
func (self *NavigationPage) ConnectHidden(f func()) coreglib.SignalHandle

ConnectHidden is emitted when the navigation view transition has been completed and the page is fully hidden.

It will always be preceded by navigationpage::hiding or navigationpage::showing.

func (self *NavigationPage) ConnectHiding(f func()) coreglib.SignalHandle

ConnectHiding is emitted when the page starts hiding at the beginning of the navigation view transition.

It will always be followed by navigationpage::hidden or navigationpage::shown.

func (self *NavigationPage) ConnectShowing(f func()) coreglib.SignalHandle

ConnectShowing is emitted when the page shows at the beginning of the navigation view transition.

It will always be followed by navigationpage::shown or navigationpage::hidden.

func (self *NavigationPage) ConnectShown(f func()) coreglib.SignalHandle

ConnectShown is emitted when the navigation view transition has been completed and the page is fully shown.

It will always be preceded by navigationpage::showing or navigationpage::hiding.

func (self *NavigationPage) SetCanPop(canPop bool)

SetCanPop sets whether self can be popped from navigation stack.

Set it to FALSE to disable shortcuts and gestures, as well as remove the back button from headerbar.

Manually calling navigationview.Pop or using the navigation.pop action will still work.

See headerbar:show-back-button for removing only the back button, but not shortcuts.

The function takes the following parameters:

  • canPop: whether the page can be popped from navigation stack.
func (self *NavigationPage) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.
func (self *NavigationPage) SetTag(tag string)

SetTag sets the tag for self.

The tag can be used to retrieve the page with navigationview.FindPage, as well as with navigationview.PushByTag, navigationview.PopToTag or navigationview.ReplaceWithTags.

Tags must be unique within each navigationview.

The tag also must be set to use the navigation.push action.

The function takes the following parameters:

  • tag (optional): page tag.
func (self *NavigationPage) SetTitle(title string)

SetTitle sets the title of self.

It's displayed in headerbar instead of the window title, and used as the tooltip on the next page's back button, as well as by screen reader.

The function takes the following parameters:

  • title: title.
func (self *NavigationPage) Tag() string

Tag gets the tag of self.

The function returns the following values:

  • utf8 (optional): page tag.
func (self *NavigationPage) Title() string

Title gets the title of self.

The function returns the following values:

  • utf8: title of self.
type NavigationPageClass struct {
	// contains filtered or unexported fields
}

NavigationPageClass: instance of this type is always passed by reference.

func (n *NavigationPageClass) ParentClass() *gtk.WidgetClass
type NavigationPageOverrides struct {
	// Hidden: called when the navigation view transition has been completed and
	// the page is fully hidden.
	Hidden func()
	// Hiding: called when the page starts hiding at the beginning of the
	// navigation view transition.
	Hiding func()
	// Showing: called when the page shows at the beginning of the navigation
	// view transition.
	Showing func()
	// Shown: called when the navigation view transition has been completed and
	// the page is fully shown.
	Shown func()
}

NavigationPageOverrides contains methods that are overridable.

type NavigationSplitView struct {
	gtk.Widget
	// contains filtered or unexported fields
}

NavigationSplitView: widget presenting sidebar and content side by side or as a navigation view.

<picture> <source srcset="navigation-split-view-dark.png" media="(prefers-color-scheme: dark)"> <img src="navigation-split-view.png" alt="navigation-split-view"> </picture> <picture> <source srcset="navigation-split-view-collapsed-dark.png" media="(prefers-color-scheme: dark)"> <img src="navigation-split-view-collapsed.png" alt="navigation-split-view-collapsed"> </picture>

AdwNavigationSplitView has two navigationpage children: sidebar and content, and displays them side by side.

When navigationsplitview:collapsed is set to TRUE, it instead puts both children inside an navigationview. The navigationsplitview:show-content controls which child is visible while collapsed.

See also overlaysplitview.

AdwNavigationSplitView is typically used together with an breakpoint setting the collapsed property to TRUE on small widths, as follows:

<object class="AdwWindow">
  <property name="width-request">280</property>
  <property name="height-request">200</property>
  <property name="default-width">800</property>
  <property name="default-height">800</property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 400sp</condition>
      <setter object="split_view" property="collapsed">True</setter>
    </object>
  </child>
  <property name="content">
    <object class="AdwNavigationSplitView" id="split_view">
      <property name="sidebar">
        <object class="AdwNavigationPage">
          <property name="title" translatable="yes">Sidebar</property>
          <property name="child">
            <!-- ... -->
          </property>
        </object>
      </property>
      <property name="content">
        <object class="AdwNavigationPage">
          <property name="title" translatable="yes">Content</property>
          <property name="child">
            <!-- ... -->
          </property>
        </object>
      </property>
    </object>
  </property>
</object>

Sizing

When not collapsed, AdwNavigationSplitView changes the sidebar width depending on its own width.

If possible, it tries to allocate a fraction of the total width, controlled with the navigationsplitview:sidebar-width-fraction property.

The sidebar also has minimum and maximum sizes, controlled with the navigationsplitview:min-sidebar-width and navigationsplitview:max-sidebar-width properties.

The minimum and maximum sizes are using the length unit specified with the navigationsplitview:sidebar-width-unit.

By default, sidebar is using 25% of the total width, with 180sp as the minimum size and 280sp as the maximum size.

Header Bar Integration

When used inside AdwNavigationSplitView, headerbar will automatically hide the window buttons in the middle.

When collapsed, it also displays a back button for the content widget, as well as the page titles. See navigationview documentation for details.

Actions

AdwNavigationSplitView defines the same actions as AdwNavigationView, but they can be used even when the split view is not collapsed:

- navigation.push takes a string parameter specifying the tag of the page to push. If it matches the tag of the content widget, it sets navigationsplitview:show-content to TRUE.

- navigation.pop doesn't take any parameters and sets navigationsplitview:show-content to FALSE.

AdwNavigationSplitView as GtkBuildable

The AdwNavigationSplitView implementation of the gtk.Buildable interface supports setting the sidebar widget by specifying “sidebar” as the “type” attribute of a <child> element, Specifying “content” child type or omitting it results in setting the content widget.

CSS nodes

AdwNavigationSplitView has a single CSS node with the name navigation-split-view.

When collapsed, it contains a child node with the name navigation-view containing both children.

navigation-split-view
╰── navigation-view
    ├── [sidebar child]
    ╰── [content child]

When not collapsed, it contains two nodes with the name widget, one with the .sidebar-pane style class, the other one with .content-view style class, containing the sidebar and content children respectively.

navigation-split-view
├── widget.sidebar-pane
│   ╰── [sidebar child]
╰── widget.content-pane
    ╰── [content child]

Accessibility

AdwNavigationSplitView uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewNavigationSplitView

func NewNavigationSplitView() *NavigationSplitView

NewNavigationSplitView creates a new AdwNavigationSplitView.

The function returns the following values:

  • navigationSplitView: newly created AdwNavigationSplitView.
func (self *NavigationSplitView) Collapsed() bool

Collapsed gets whether self is collapsed.

The function returns the following values:

  • ok: whether self is collapsed.
func (self *NavigationSplitView) Content() *NavigationPage

Content sets the content widget for self.

The function returns the following values:

  • navigationPage (optional): content widget.
func (self *NavigationSplitView) MaxSidebarWidth() float64

MaxSidebarWidth gets the maximum sidebar width for self.

The function returns the following values:

  • gdouble: maximum width.
func (self *NavigationSplitView) MinSidebarWidth() float64

MinSidebarWidth gets the minimum sidebar width for self.

The function returns the following values:

  • gdouble: minimum width.
func (self *NavigationSplitView) SetCollapsed(collapsed bool)

SetCollapsed sets whether self is collapsed.

When collapsed, the children are put inside an navigationview, otherwise they are displayed side by side.

The navigationsplitview:show-content controls which child is visible while collapsed.

The function takes the following parameters:

  • collapsed: whether self is collapsed.
func (self *NavigationSplitView) SetContent(content *NavigationPage)

SetContent sets the content widget for self.

The function takes the following parameters:

  • content (optional) widget.
func (self *NavigationSplitView) SetMaxSidebarWidth(width float64)

SetMaxSidebarWidth sets the maximum sidebar width for self.

Maximum width is affected by navigationsplitview:sidebar-width-unit.

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

The function takes the following parameters:

  • width: maximum width.
func (self *NavigationSplitView) SetMinSidebarWidth(width float64)

SetMinSidebarWidth sets the minimum sidebar width for self.

Minimum width is affected by navigationsplitview:sidebar-width-unit.

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

The function takes the following parameters:

  • width: minimum width.
func (self *NavigationSplitView) SetShowContent(showContent bool)

SetShowContent sets which page is visible when self is collapsed.

If set to TRUE, the content widget will be the visible page when navigationsplitview:collapsed is TRUE; otherwise the sidebar widget will be visible.

If the split view is already collapsed, the visible page changes immediately.

The function takes the following parameters:

  • showContent: whether to show content when collapsed.
func (self *NavigationSplitView) SetSidebar(sidebar *NavigationPage)

SetSidebar sets the sidebar widget for self.

The function takes the following parameters:

  • sidebar (optional) widget.
func (self *NavigationSplitView) SetSidebarWidthFraction(fraction float64)

SetSidebarWidthFraction sets the preferred sidebar width as a fraction of the total width of self.

The preferred width is additionally limited by navigationsplitview:min-sidebar-width and navigationsplitview:max-sidebar-width.

The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

The function takes the following parameters:

  • fraction: preferred width fraction.
func (self *NavigationSplitView) SetSidebarWidthUnit(unit LengthUnit)

SetSidebarWidthUnit sets the length unit for minimum and maximum sidebar widths.

See navigationsplitview:min-sidebar-width and navigationsplitview:max-sidebar-width.

The function takes the following parameters:

  • unit: length unit.
func (self *NavigationSplitView) ShowContent() bool

ShowContent gets which page is visible when self is collapsed.

The function returns the following values:

  • ok: whether to show content when collapsed.
func (self *NavigationSplitView) Sidebar() *NavigationPage

Sidebar gets the sidebar widget for self.

The function returns the following values:

  • navigationPage (optional): sidebar widget.
func (self *NavigationSplitView) SidebarWidthFraction() float64

SidebarWidthFraction gets the preferred sidebar width fraction for self.

The function returns the following values:

  • gdouble: preferred width fraction.
func (self *NavigationSplitView) SidebarWidthUnit() LengthUnit

SidebarWidthUnit gets the length unit for minimum and maximum sidebar widths.

The function returns the following values:

  • lengthUnit: length unit.
type NavigationSplitViewClass struct {
	// contains filtered or unexported fields
}

NavigationSplitViewClass: instance of this type is always passed by reference.

func (n *NavigationSplitViewClass) ParentClass() *gtk.WidgetClass
type NavigationSplitViewOverrides struct {
}

NavigationSplitViewOverrides contains methods that are overridable.

type NavigationView struct {
	gtk.Widget

	*coreglib.Object
	Swipeable
	// contains filtered or unexported fields
}

NavigationView: page-based navigation container.

<picture> <source srcset="navigation-view-dark.png" media="(prefers-color-scheme: dark)"> <img src="navigation-view.png" alt="navigation-view"> </picture>

AdwNavigationView presents one child at a time, similar to gtk.Stack.

AdwNavigationView can only contain navigationpage children.

It maintains a navigation stack that can be controlled with navigationview.Push and navigationview.Pop. The whole navigation stack can also be replaced using navigationview.Replace.

AdwNavigationView allows to manage pages statically or dynamically.

Static pages can be added using the navigationview.Add method. The AdwNavigationView will keep a reference to these pages, but they aren't accessible to the user until navigationview.Push is called (except for the first page, which is pushed automatically). Use the navigationview.Remove method to remove them. This is useful for applications that have a small number of unique pages and just need navigation between them.

Dynamic pages are automatically destroyed once they are popped off the navigation stack. To add a page like this, push it using the navigationview.Push method without calling navigationview.Add first.

Tags

Static pages, as well as any pages in the navigation stack, can be accessed by their navigationpage:tag. For example, navigationview.PushByTag can be used to push a static page that's not in the navigation stack without having to keep a reference to it manually.

Header Bar Integration

When used inside AdwNavigationView, headerbar will automatically display a back button that can be used to go back to the previous page when possible. The button also has a context menu, allowing to pop multiple pages at once, potentially across multiple navigation views.

Set headerbar:show-back-button to FALSE to disable this behavior if it's unwanted.

AdwHeaderBar will also display the title of the AdwNavigationPage it's placed into, so most applications shouldn't need to customize it at all.

Shortcuts and Gestures

AdwNavigationView supports the following shortcuts for going to the previous page:

- <kbd>Escape</kbd> (unless navigationview:pop-on-escape is set to FALSE)

- <kbd>Alt</kbd>+<kbd>←</kbd>

- Back mouse button

Additionally, it supports interactive gestures:

- One-finger swipe towards the right on touchscreens

- Scrolling towards the right on touchpads (usually two-finger swipe)

These gestures have transitions enabled regardless of the navigationview:animate-transitions value.

Applications can also enable shortcuts for pushing another page onto the navigation stack via connecting to the navigationview::get-next-page signal, in that case the following shortcuts are supported:

- <kbd>Alt</kbd>+<kbd>→</kbd>

- Forward mouse button

- Swipe/scrolling towards the left

For right-to-left locales, the gestures and shortcuts are reversed.

navigationpage:can-pop can be used to disable them, along with the header bar back buttons.

Actions

AdwNavigationView defines actions for controlling the navigation stack. actions for controlling the navigation stack:

- navigation.push takes a string parameter specifying the tag of the page to push, and is equivalent to calling navigationview.PushByTag.

- navigation.pop doesn't take any parameters and pops the current page from the navigation stack, equivalent to calling navigationview.Pop.

AdwNavigationView as GtkBuildable

AdwNavigationView allows to add pages as children, equivalent to using the navigationview.Add method.

Example of an AdwNavigationView UI definition:

<object class="AdwNavigationView">
  <child>
    <object class="AdwNavigationPage">
      <property name="title" translatable="yes">Page 1</property>
      <property name="child">
        <object class="AdwToolbarView">
          <child type="top">
            <object class="AdwHeaderBar"/>
          </child>
          <property name="content">
            <object class="GtkButton">
              <property name="label" translatable="yes">Open Page 2</property>
              <property name="halign">center</property>
              <property name="valign">center</property>
              <property name="action-name">navigation.push</property>
              <property name="action-target">'page-2'</property>
              <style>
                <class name="pill"/>
               </style>
            </object>
          </property>
        </object>
      </property>
    </object>
  </child>
  <child>
    <object class="AdwNavigationPage">
      <property name="title" translatable="yes">Page 2</property>
      <property name="tag">page-2</property>
      <property name="child">
        <object class="AdwToolbarView">
          <child type="top">
            <object class="AdwHeaderBar"/>
          </child>
          <property name="content">
            <!-- ... -->
          </property>
        </object>
      </property>
    </object>
  </child>
</object>

<picture> <source srcset="navigation-view-example-dark.png" media="(prefers-color-scheme: dark)"> <img src="navigation-view-example.png" alt="navigation-view-example"> </picture>

CSS nodes

AdwNavigationView has a single CSS node with the name navigation-view.

Accessibility

AdwNavigationView uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewNavigationView

func NewNavigationView() *NavigationView

NewNavigationView creates a new AdwNavigationView.

The function returns the following values:

  • navigationView: new created AdwNavigationView.
func (self *NavigationView) Add(page *NavigationPage)

Add: permanently adds page to self.

Any page that has been added will stay in self even after being popped from the navigation stack.

Adding a page while no page is visible will automatically push it to the navigation stack.

See navigationview.Remove.

The function takes the following parameters:

  • page to add.
func (self *NavigationView) AnimateTransitions() bool

AnimateTransitions gets whether self animates page transitions.

The function returns the following values:

  • ok: whether to animate page transitions.
func (self *NavigationView) ConnectGetNextPage(f func() (navigationPage *NavigationPage)) coreglib.SignalHandle

ConnectGetNextPage is emitted when a push shortcut or a gesture is triggered.

To support the push shortcuts and gestures, the application is expected to return the page to push in the handler.

This signal can be emitted multiple times for the gestures, for example when the gesture is cancelled by the user. As such, the application must not make any irreversible changes in the handler, such as removing the page from a forward stack.

Instead, it should be done in the navigationview::pushed handler.

func (self *NavigationView) ConnectPopped(f func(page *NavigationPage)) coreglib.SignalHandle

ConnectPopped is emitted after page has been popped from the navigation stack.

See navigationview.Pop.

When using navigationview.PopToPage or navigationview.PopToTag, this signal is emitted for each of the popped pages.

func (self *NavigationView) ConnectPushed(f func()) coreglib.SignalHandle

ConnectPushed is emitted after a page has been pushed to the navigation stack.

See navigationview.Push.

func (self *NavigationView) ConnectReplaced(f func()) coreglib.SignalHandle

ConnectReplaced is emitted after the navigation stack has been replaced.

See navigationview.Replace.

func (self *NavigationView) FindPage(tag string) *NavigationPage

FindPage finds a page in self by its tag.

See navigationpage:tag.

The function takes the following parameters:

  • tag: page tag.

The function returns the following values:

  • navigationPage (optional): page with the given tag.
func (self *NavigationView) NavigationStack() *gio.ListModel

NavigationStack returns a gio.ListModel that contains the pages in navigation stack.

The pages are sorted from root page to visible page.

This can be used to keep an up-to-date view.

The function returns the following values:

  • listModel: list model for the navigation stack.
func (self *NavigationView) Pop() bool

Pop pops the visible page from the navigation stack.

Does nothing if the navigation stack contains less than two pages.

If navigationview.Add hasn't been called, the page is automatically removed.

navigationview::popped will be emitted for the current visible page.

See navigationview.PopToPage and navigationview.PopToTag.

The function returns the following values:

  • ok: TRUE if a page has been popped.
func (self *NavigationView) PopOnEscape() bool

PopOnEscape gets whether pressing Escape pops the current page on self.

The function returns the following values:

  • ok: whether to pop the current page.
func (self *NavigationView) PopToPage(page *NavigationPage) bool

PopToPage pops pages from the navigation stack until page is visible.

page must be in the navigation stack.

If navigationview.Add hasn't been called for any of the popped pages, they are automatically removed.

navigationview::popped will be be emitted for each of the popped pages.

See navigationview.Pop and navigationview.PopToTag.

The function takes the following parameters:

  • page to pop to.

The function returns the following values:

  • ok: TRUE if any pages have been popped.
func (self *NavigationView) PopToTag(tag string) bool

PopToTag pops pages from the navigation stack until page with the tag tag is visible.

The page must be in the navigation stack.

If navigationview.Add hasn't been called for any of the popped pages, they are automatically removed.

navigationview::popped will be emitted for each of the popped pages.

See navigationview.PopToPage and navigationpage:tag.

The function takes the following parameters:

  • tag: page tag.

The function returns the following values:

  • ok: TRUE if any pages have been popped.
func (self *NavigationView) PreviousPage(page *NavigationPage) *NavigationPage

PreviousPage gets the previous page for page.

If page is in the navigation stack, returns the page popping page will reveal.

If page is the root page or is not in the navigation stack, returns NULL.

The function takes the following parameters:

  • page in self.

The function returns the following values:

  • navigationPage (optional) previous page.
func (self *NavigationView) Push(page *NavigationPage)

Push pushes page onto the navigation stack.

If navigationview.Add hasn't been called, the page is automatically removed once it's popped.

navigationview::popped will be emitted for page.

See navigationview.PushByTag.

The function takes the following parameters:

  • page to push.
func (self *NavigationView) PushByTag(tag string)

PushByTag pushes the page with the tag tag onto the navigation stack.

If navigationview.Add hasn't been called, the page is automatically removed once it's popped.

navigationview::popped will be emitted for pushed page.

See navigationview.Push and navigationpage:tag.

The function takes the following parameters:

  • tag: page tag.
func (self *NavigationView) Remove(page *NavigationPage)

Remove removes page from self.

If page is currently in the navigation stack, it will be removed once it's popped. Otherwise, it's removed immediately.

See navigationview.Add.

The function takes the following parameters:

  • page to remove.
func (self *NavigationView) Replace(pages []*NavigationPage)

Replace replaces the current navigation stack with pages.

The last page becomes the visible page.

Replacing the navigation stack has no animation.

If navigationview.Add hasn't been called for any pages that are no longer in the navigation stack, they are automatically removed.

n_pages can be 0, in that case no page will be visible after calling this method. This can be useful for removing all pages from self.

The navigationview::replaced signal will be emitted.

See navigationview.ReplaceWithTags.

The function takes the following parameters:

  • pages: new navigation stack.
func (self *NavigationView) ReplaceWithTags(tags []string)

ReplaceWithTags replaces the current navigation stack with pages with the tags tags.

The last page becomes the visible page.

Replacing the navigation stack has no animation.

If navigationview.Add hasn't been called for any pages that are no longer in the navigation stack, they are automatically removed.

n_tags can be 0, in that case no page will be visible after calling this method. This can be useful for removing all pages from self.

The navigationview::replaced signal will be emitted.

See navigationview.Replace and navigationpage:tag.

The function takes the following parameters:

  • tags of the pages in the navigation stack.
func (self *NavigationView) SetAnimateTransitions(animateTransitions bool)

SetAnimateTransitions sets whether self should animate page transitions.

Gesture-based transitions are always animated.

The function takes the following parameters:

  • animateTransitions: whether to animate page transitions.
func (self *NavigationView) SetPopOnEscape(popOnEscape bool)

SetPopOnEscape sets whether pressing Escape pops the current page on self.

Applications using AdwNavigationView to implement a browser may want to disable it.

The function takes the following parameters:

  • popOnEscape: whether to pop the current page when pressing Escape.
func (self *NavigationView) VisiblePage() *NavigationPage

VisiblePage gets the currently visible page in self.

The function returns the following values:

  • navigationPage (optional): currently visible page.
type NavigationViewClass struct {
	// contains filtered or unexported fields
}

NavigationViewClass: instance of this type is always passed by reference.

func (n *NavigationViewClass) ParentClass() *gtk.WidgetClass
type NavigationViewOverrides struct {
}

NavigationViewOverrides contains methods that are overridable.

type OverlaySplitView

type OverlaySplitView struct {
	gtk.Widget

	*coreglib.Object
	Swipeable
	// contains filtered or unexported fields
}

OverlaySplitView: widget presenting sidebar and content side by side or as an overlay.

<picture> <source srcset="overlay-split-view-dark.png" media="(prefers-color-scheme: dark)"> <img src="overlay-split-view.png" alt="overlay-split-view"> </picture> <picture> <source srcset="overlay-split-view-collapsed-dark.png" media="(prefers-color-scheme: dark)"> <img src="overlay-split-view-collapsed.png" alt="overlay-split-view-collapsed"> </picture>

AdwOverlaySplitView has two children: sidebar and content, and displays them side by side.

When overlaysplitview:collapsed is set to TRUE, the sidebar is instead shown as an overlay above the content widget.

The sidebar can be hidden or shown using the overlaysplitview:show-sidebar property.

Sidebar can be displayed before or after the content, this can be controlled with the overlaysplitview:sidebar-position property.

Collapsing the split view automatically hides the sidebar widget, and uncollapsing it shows the sidebar. If this behavior is not desired, the overlaysplitview:pin-sidebar property can be used to override it.

AdwOverlaySplitView supports an edge swipe gesture for showing the sidebar, and a swipe from the sidebar for hiding it. Gestures are only supported on touchscreen, but not touchpad. Gestures can be controlled with the overlaysplitview:enable-show-gesture and overlaysplitview:enable-hide-gesture properties.

See also navigationsplitview.

AdwOverlaySplitView is typically used together with an breakpoint setting the collapsed property to TRUE on small widths, as follows:

<object class="AdwWindow">
  <property name="width-request">360</property>
  <property name="height-request">200</property>
  <property name="default-width">800</property>
  <property name="default-height">800</property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 400sp</condition>
      <setter object="split_view" property="collapsed">True</setter>
    </object>
  </child>
  <property name="content">
    <object class="AdwOverlaySplitView" id="split_view">
      <property name="sidebar">
        <!-- ... -->
      </property>
      <property name="content">
        <!-- ... -->
      </property>
    </object>
  </property>
</object>

AdwOverlaySplitView is often used for implementing the utility pane (https://developer.gnome.org/hig/patterns/containers/utility-panes.html) pattern.

Sizing

When not collapsed, AdwOverlaySplitView changes the sidebar width depending on its own width.

If possible, it tries to allocate a fraction of the total width, controlled with the overlaysplitview:sidebar-width-fraction property.

The sidebar also has minimum and maximum sizes, controlled with the overlaysplitview:min-sidebar-width and overlaysplitview:max-sidebar-width properties.

The minimum and maximum sizes are using the length unit specified with the overlaysplitview:sidebar-width-unit.

By default, sidebar is using 25% of the total width, with 180sp as the minimum size and 280sp as the maximum size.

When collapsed, the preferred width fraction is ignored and the sidebar uses overlaysplitview:max-sidebar-width when possible.

Header Bar Integration

When used inside AdwOverlaySplitView, headerbar will automatically hide the window buttons in the middle.

AdwOverlaySplitView as GtkBuildable

The AdwOverlaySplitView implementation of the gtk.Buildable interface supports setting the sidebar widget by specifying “sidebar” as the “type” attribute of a <child> element, Specifying “content” child type or omitting it results in setting the content widget.

CSS nodes

AdwOverlaySplitView has a single CSS node with the name overlay-split-view.

It contains two nodes with the name widget, containing the sidebar and content children.

When not collapsed, they have the .sidebar-view and .content-view style classes respectively.

overlay-split-view
├── widget.sidebar-pane
│   ╰── [sidebar child]
╰── widget.content-pane
    ╰── [content child]

When collapsed, the one containing the sidebar child has the .background style class and the other one has no style classes.

overlay-split-view
├── widget.background
│   ╰── [sidebar child]
╰── widget
    ╰── [content child]

Accessibility

AdwOverlaySplitView uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewOverlaySplitView

func NewOverlaySplitView() *OverlaySplitView

NewOverlaySplitView creates a new AdwOverlaySplitView.

The function returns the following values:

  • overlaySplitView: newly created AdwOverlaySplitView.

func (*OverlaySplitView) Collapsed

func (self *OverlaySplitView) Collapsed() bool

Collapsed gets whether self is collapsed.

The function returns the following values:

  • ok: whether self is collapsed.

func (*OverlaySplitView) Content

func (self *OverlaySplitView) Content() gtk.Widgetter

Content gets the content widget for self.

The function returns the following values:

  • widget (optional): content widget for self.

func (*OverlaySplitView) EnableHideGesture

func (self *OverlaySplitView) EnableHideGesture() bool

EnableHideGesture gets whether self can be closed with a swipe gesture.

The function returns the following values:

  • ok: TRUE if self can be closed with a swipe gesture.

func (*OverlaySplitView) EnableShowGesture

func (self *OverlaySplitView) EnableShowGesture() bool

EnableShowGesture gets whether self can be opened with an edge swipe gesture.

The function returns the following values:

  • ok: TRUE if self can be opened with a swipe gesture.

func (*OverlaySplitView) MaxSidebarWidth

func (self *OverlaySplitView) MaxSidebarWidth() float64

MaxSidebarWidth gets the maximum sidebar width for self.

The function returns the following values:

  • gdouble: maximum width.

func (*OverlaySplitView) MinSidebarWidth

func (self *OverlaySplitView) MinSidebarWidth() float64

MinSidebarWidth gets the minimum sidebar width for self.

The function returns the following values:

  • gdouble: minimum width.

func (*OverlaySplitView) PINSidebar

func (self *OverlaySplitView) PINSidebar() bool

PINSidebar gets whether the sidebar widget is pinned for self.

The function returns the following values:

  • ok: whether if the sidebar widget is pinned.

func (*OverlaySplitView) SetCollapsed

func (self *OverlaySplitView) SetCollapsed(collapsed bool)

SetCollapsed sets whether self view is collapsed.

When collapsed, the sidebar widget is presented as an overlay above the content widget, otherwise they are displayed side by side.

The function takes the following parameters:

  • collapsed: whether self is collapsed.

func (*OverlaySplitView) SetContent

func (self *OverlaySplitView) SetContent(content gtk.Widgetter)

SetContent sets the content widget for self.

The function takes the following parameters:

  • content (optional) widget.

func (*OverlaySplitView) SetEnableHideGesture

func (self *OverlaySplitView) SetEnableHideGesture(enableHideGesture bool)

SetEnableHideGesture sets whether self can be closed with a swipe gesture.

Only touchscreen swipes are supported.

The function takes the following parameters:

  • enableHideGesture: whether self can be closed with a swipe gesture.

func (*OverlaySplitView) SetEnableShowGesture

func (self *OverlaySplitView) SetEnableShowGesture(enableShowGesture bool)

SetEnableShowGesture sets whether self can be opened with an edge swipe gesture.

Only touchscreen swipes are supported.

The function takes the following parameters:

  • enableShowGesture: whether self can be opened with a swipe gesture.

func (*OverlaySplitView) SetMaxSidebarWidth

func (self *OverlaySplitView) SetMaxSidebarWidth(width float64)

SetMaxSidebarWidth sets the maximum sidebar width for self.

Maximum width is affected by overlaysplitview:sidebar-width-unit.

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

The function takes the following parameters:

  • width: maximum width.

func (*OverlaySplitView) SetMinSidebarWidth

func (self *OverlaySplitView) SetMinSidebarWidth(width float64)

SetMinSidebarWidth sets the minimum sidebar width for self.

Minimum width is affected by overlaysplitview:sidebar-width-unit.

The sidebar widget can still be allocated with larger width if its own minimum width exceeds it.

The function takes the following parameters:

  • width: minimum width.

func (*OverlaySplitView) SetPINSidebar

func (self *OverlaySplitView) SetPINSidebar(pinSidebar bool)

SetPINSidebar sets whether the sidebar widget is pinned for self.

By default, collapsing self automatically hides the sidebar widget, and uncollapsing it shows the sidebar. If set to TRUE, sidebar visibility never changes on its own.

The function takes the following parameters:

  • pinSidebar: whether to pin the sidebar widget.

func (*OverlaySplitView) SetShowSidebar

func (self *OverlaySplitView) SetShowSidebar(showSidebar bool)

SetShowSidebar sets whether the sidebar widget is shown for self.

The function takes the following parameters:

  • showSidebar: whether to show the sidebar widget.

func (*OverlaySplitView) SetSidebar

func (self *OverlaySplitView) SetSidebar(sidebar gtk.Widgetter)

SetSidebar sets the sidebar widget for self.

The function takes the following parameters:

  • sidebar (optional) widget.

func (*OverlaySplitView) SetSidebarPosition

func (self *OverlaySplitView) SetSidebarPosition(position gtk.PackType)

SetSidebarPosition sets the sidebar position for self.

If it's set to GTK_PACK_START, the sidebar is displayed before the content, if GTK_PACK_END, it's displayed after the content.

The function takes the following parameters:

  • position: new position.

func (*OverlaySplitView) SetSidebarWidthFraction

func (self *OverlaySplitView) SetSidebarWidthFraction(fraction float64)

SetSidebarWidthFraction sets the preferred sidebar width as a fraction of the total width of self.

The preferred width is additionally limited by overlaysplitview:min-sidebar-width and overlaysplitview:max-sidebar-width.

The sidebar widget can be allocated with larger width if its own minimum width exceeds the preferred width.

The function takes the following parameters:

  • fraction: preferred width fraction.

func (*OverlaySplitView) SetSidebarWidthUnit

func (self *OverlaySplitView) SetSidebarWidthUnit(unit LengthUnit)

SetSidebarWidthUnit sets the length unit for minimum and maximum sidebar widths.

See overlaysplitview:min-sidebar-width and overlaysplitview:max-sidebar-width.

The function takes the following parameters:

  • unit: length unit.

func (*OverlaySplitView) ShowSidebar

func (self *OverlaySplitView) ShowSidebar() bool

ShowSidebar gets whether the sidebar widget is shown for self.

The function returns the following values:

  • ok: TRUE if the sidebar widget is shown.

func (*OverlaySplitView) Sidebar

func (self *OverlaySplitView) Sidebar() gtk.Widgetter

Sidebar gets the sidebar widget for self.

The function returns the following values:

  • widget (optional): sidebar widget for self.

func (*OverlaySplitView) SidebarPosition

func (self *OverlaySplitView) SidebarPosition() gtk.PackType

SidebarPosition gets the sidebar position for self.

The function returns the following values:

  • packType: sidebar position for self.

func (*OverlaySplitView) SidebarWidthFraction

func (self *OverlaySplitView) SidebarWidthFraction() float64

SidebarWidthFraction gets the preferred sidebar width fraction for self.

The function returns the following values:

  • gdouble: preferred width fraction.

func (*OverlaySplitView) SidebarWidthUnit

func (self *OverlaySplitView) SidebarWidthUnit() LengthUnit

SidebarWidthUnit gets the length unit for minimum and maximum sidebar widths.

The function returns the following values:

  • lengthUnit: length unit.

type OverlaySplitViewClass

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

OverlaySplitViewClass: instance of this type is always passed by reference.

func (*OverlaySplitViewClass) ParentClass

func (o *OverlaySplitViewClass) ParentClass() *gtk.WidgetClass

type OverlaySplitViewOverrides

type OverlaySplitViewOverrides struct {
}

OverlaySplitViewOverrides contains methods that are overridable.

type PasswordEntryRow

type PasswordEntryRow struct {
	EntryRow
	// contains filtered or unexported fields
}

PasswordEntryRow: entryrow tailored for entering secrets.

<picture> <source srcset="password-entry-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="password-entry-row.png" alt="password-entry-row"> </picture>

It does not show its contents in clear text, does not allow to copy it to the clipboard, and shows a warning when Caps Lock is engaged. If the underlying platform allows it, AdwPasswordEntryRow will also place the text in a non-pageable memory area, to avoid it being written out to disk by the operating system.

It offer a way to reveal the contents in clear text.

CSS Nodes

AdwPasswordEntryRow has a single CSS node with name row that carries .entry and .password style classes.

func NewPasswordEntryRow

func NewPasswordEntryRow() *PasswordEntryRow

NewPasswordEntryRow creates a new AdwPasswordEntryRow.

The function returns the following values:

  • passwordEntryRow: newly created AdwPasswordEntryRow.

type PasswordEntryRowClass

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

PasswordEntryRowClass: instance of this type is always passed by reference.

func (*PasswordEntryRowClass) ParentClass

func (p *PasswordEntryRowClass) ParentClass() *EntryRowClass

type PasswordEntryRowOverrides

type PasswordEntryRowOverrides struct {
}

PasswordEntryRowOverrides contains methods that are overridable.

type PreferencesGroup

type PreferencesGroup struct {
	gtk.Widget
	// contains filtered or unexported fields
}

PreferencesGroup: group of preference rows.

<picture> <source srcset="preferences-group-dark.png" media="(prefers-color-scheme: dark)"> <img src="preferences-group.png" alt="preferences-group"> </picture>

An AdwPreferencesGroup represents a group or tightly related preferences, which in turn are represented by preferencesrow.

To summarize the role of the preferences it gathers, a group can have both a title and a description. The title will be used by preferenceswindow to let the user look for a preference.

AdwPreferencesGroup as GtkBuildable

The AdwPreferencesGroup implementation of the gtk.Buildable interface supports adding preferencesrows to the list by omitting "type". If "type" is omitted and the widget isn't a preferencesrow the child is added to a box below the list.

When the "type" attribute of a child is header-suffix, the child is set as the suffix on the end of the title and description.

CSS nodes

AdwPreferencesGroup has a single CSS node with name preferencesgroup.

Accessibility

AdwPreferencesGroup uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewPreferencesGroup

func NewPreferencesGroup() *PreferencesGroup

NewPreferencesGroup creates a new AdwPreferencesGroup.

The function returns the following values:

  • preferencesGroup: newly created AdwPreferencesGroup.

func (*PreferencesGroup) Add

func (self *PreferencesGroup) Add(child gtk.Widgetter)

Add adds a child to self.

The function takes the following parameters:

  • child: widget to add.

func (*PreferencesGroup) Description

func (self *PreferencesGroup) Description() string

Description gets the description of self.

The function returns the following values:

  • utf8 (optional): description of self.

func (*PreferencesGroup) HeaderSuffix

func (self *PreferencesGroup) HeaderSuffix() gtk.Widgetter

HeaderSuffix gets the suffix for self's header.

The function returns the following values:

  • widget (optional): suffix for self's header.

func (*PreferencesGroup) Remove

func (self *PreferencesGroup) Remove(child gtk.Widgetter)

Remove removes a child from self.

The function takes the following parameters:

  • child to remove.

func (*PreferencesGroup) SetDescription

func (self *PreferencesGroup) SetDescription(description string)

SetDescription sets the description for self.

The function takes the following parameters:

  • description (optional): description.

func (*PreferencesGroup) SetHeaderSuffix

func (self *PreferencesGroup) SetHeaderSuffix(suffix gtk.Widgetter)

SetHeaderSuffix sets the suffix for self's header.

Displayed above the list, next to the title and description.

Suffixes are commonly used to show a button or a spinner for the whole group.

The function takes the following parameters:

  • suffix (optional) to set.

func (*PreferencesGroup) SetTitle

func (self *PreferencesGroup) SetTitle(title string)

SetTitle sets the title for self.

The function takes the following parameters:

  • title: title.

func (*PreferencesGroup) Title

func (self *PreferencesGroup) Title() string

Title gets the title of self.

The function returns the following values:

  • utf8: title of self.

type PreferencesGroupClass

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

PreferencesGroupClass: instance of this type is always passed by reference.

func (*PreferencesGroupClass) ParentClass

func (p *PreferencesGroupClass) ParentClass() *gtk.WidgetClass

ParentClass: parent class.

type PreferencesGroupOverrides

type PreferencesGroupOverrides struct {
}

PreferencesGroupOverrides contains methods that are overridable.

type PreferencesPage

type PreferencesPage struct {
	gtk.Widget
	// contains filtered or unexported fields
}

PreferencesPage: page from preferenceswindow.

<picture> <source srcset="preferences-page-dark.png" media="(prefers-color-scheme: dark)"> <img src="preferences-page.png" alt="preferences-page"> </picture>

The AdwPreferencesPage widget gathers preferences groups into a single page of a preferences window.

CSS nodes

AdwPreferencesPage has a single CSS node with name preferencespage.

Accessibility

AdwPreferencesPage uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewPreferencesPage

func NewPreferencesPage() *PreferencesPage

NewPreferencesPage creates a new AdwPreferencesPage.

The function returns the following values:

  • preferencesPage: newly created AdwPreferencesPage.

func (*PreferencesPage) Add

func (self *PreferencesPage) Add(group *PreferencesGroup)

Add adds a preferences group to self.

The function takes the following parameters:

  • group to add.

func (*PreferencesPage) Description

func (self *PreferencesPage) Description() string

Description gets the description of self.

The function returns the following values:

  • utf8: description of self.

func (*PreferencesPage) IconName

func (self *PreferencesPage) IconName() string

IconName gets the icon name for self.

The function returns the following values:

  • utf8 (optional): icon name for self.

func (*PreferencesPage) Name

func (self *PreferencesPage) Name() string

Name gets the name of self.

The function returns the following values:

  • utf8 (optional): name of self.

func (*PreferencesPage) Remove

func (self *PreferencesPage) Remove(group *PreferencesGroup)

Remove removes a group from self.

The function takes the following parameters:

  • group to remove.

func (*PreferencesPage) ScrollToTop

func (self *PreferencesPage) ScrollToTop()

ScrollToTop scrolls the scrolled window of self to the top.

func (*PreferencesPage) SetDescription

func (self *PreferencesPage) SetDescription(description string)

SetDescription sets the description of self.

The description is displayed at the top of the page.

The function takes the following parameters:

  • description: description.

func (*PreferencesPage) SetIconName

func (self *PreferencesPage) SetIconName(iconName string)

SetIconName sets the icon name for self.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*PreferencesPage) SetName

func (self *PreferencesPage) SetName(name string)

SetName sets the name of self.

The function takes the following parameters:

  • name (optional): name.

func (*PreferencesPage) SetTitle

func (self *PreferencesPage) SetTitle(title string)

SetTitle sets the title of self.

The function takes the following parameters:

  • title: title.

func (*PreferencesPage) SetUseUnderline

func (self *PreferencesPage) SetUseUnderline(useUnderline bool)

SetUseUnderline sets whether an embedded underline in the title indicates a mnemonic.

The function takes the following parameters:

  • useUnderline: TRUE if underlines in the text indicate mnemonics.

func (*PreferencesPage) Title

func (self *PreferencesPage) Title() string

Title gets the title of self.

The function returns the following values:

  • utf8: title of self.

func (*PreferencesPage) UseUnderline

func (self *PreferencesPage) UseUnderline() bool

UseUnderline gets whether an embedded underline in the title indicates a mnemonic.

The function returns the following values:

  • ok: whether an embedded underline in the title indicates a mnemonic.

type PreferencesPageClass

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

PreferencesPageClass: instance of this type is always passed by reference.

func (*PreferencesPageClass) ParentClass

func (p *PreferencesPageClass) ParentClass() *gtk.WidgetClass

ParentClass: parent class.

type PreferencesPageOverrides

type PreferencesPageOverrides struct {
}

PreferencesPageOverrides contains methods that are overridable.

type PreferencesRow

type PreferencesRow struct {
	gtk.ListBoxRow
	// contains filtered or unexported fields
}

PreferencesRow: gtk.ListBoxRow used to present preferences.

The AdwPreferencesRow widget has a title that preferenceswindow will use to let the user look for a preference. It doesn't present the title in any way and lets you present the preference as you please.

actionrow and its derivatives are convenient to use as preference rows as they take care of presenting the preference's title while letting you compose the inputs of the preference around it.

func NewPreferencesRow

func NewPreferencesRow() *PreferencesRow

NewPreferencesRow creates a new AdwPreferencesRow.

The function returns the following values:

  • preferencesRow: newly created AdwPreferencesRow.

func (*PreferencesRow) SetTitle

func (self *PreferencesRow) SetTitle(title string)

SetTitle sets the title of the preference represented by self.

The title is interpreted as Pango markup unless preferencesrow:use-markup is set to FALSE.

The function takes the following parameters:

  • title: title.

func (*PreferencesRow) SetTitleSelectable

func (self *PreferencesRow) SetTitleSelectable(titleSelectable bool)

SetTitleSelectable sets whether the user can copy the title from the label

See also gtk.Label:selectable.

The function takes the following parameters:

  • titleSelectable: TRUE if the user can copy the title from the label.

func (*PreferencesRow) SetUseMarkup

func (self *PreferencesRow) SetUseMarkup(useMarkup bool)

SetUseMarkup sets whether to use Pango markup for the title label.

Subclasses may also use it for other labels, such as subtitle.

See also pango.ParseMarkup().

The function takes the following parameters:

  • useMarkup: whether to use markup.

func (*PreferencesRow) SetUseUnderline

func (self *PreferencesRow) SetUseUnderline(useUnderline bool)

SetUseUnderline sets whether an embedded underline in the title indicates a mnemonic.

The function takes the following parameters:

  • useUnderline: TRUE if underlines in the text indicate mnemonics.

func (*PreferencesRow) Title

func (self *PreferencesRow) Title() string

Title gets the title of the preference represented by self.

The function returns the following values:

  • utf8: title.

func (*PreferencesRow) TitleSelectable

func (self *PreferencesRow) TitleSelectable() bool

TitleSelectable gets whether the user can copy the title from the label.

The function returns the following values:

  • ok: whether the user can copy the title from the label.

func (*PreferencesRow) UseMarkup

func (self *PreferencesRow) UseMarkup() bool

UseMarkup gets whether to use Pango markup for the title label.

The function returns the following values:

  • ok: whether to use markup.

func (*PreferencesRow) UseUnderline

func (self *PreferencesRow) UseUnderline() bool

UseUnderline gets whether an embedded underline in the title indicates a mnemonic.

The function returns the following values:

  • ok: whether an embedded underline in the title indicates a mnemonic.

type PreferencesRowClass

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

PreferencesRowClass: instance of this type is always passed by reference.

func (*PreferencesRowClass) ParentClass

func (p *PreferencesRowClass) ParentClass() *gtk.ListBoxRowClass

ParentClass: parent class.

type PreferencesRowOverrides

type PreferencesRowOverrides struct {
}

PreferencesRowOverrides contains methods that are overridable.

type PreferencesWindow

type PreferencesWindow struct {
	Window
	// contains filtered or unexported fields
}

PreferencesWindow: window to present an application's preferences.

<picture> <source srcset="preferences-window-dark.png" media="(prefers-color-scheme: dark)"> <img src="preferences-window.png" alt="preferences-window"> </picture>

The AdwPreferencesWindow widget presents an application's preferences gathered into pages and groups. The preferences are searchable by the user.

CSS nodes

AdwPreferencesWindow has a main CSS node with the name window and the style class .preferences.

func NewPreferencesWindow

func NewPreferencesWindow() *PreferencesWindow

NewPreferencesWindow creates a new AdwPreferencesWindow.

The function returns the following values:

  • preferencesWindow: newly created AdwPreferencesWindow.

func (*PreferencesWindow) Add

func (self *PreferencesWindow) Add(page *PreferencesPage)

Add adds a preferences page to self.

The function takes the following parameters:

  • page to add.

func (*PreferencesWindow) AddToast

func (self *PreferencesWindow) AddToast(toast *Toast)

AddToast displays toast.

See toastoverlay.AddToast.

The function takes the following parameters:

  • toast: toast.

func (*PreferencesWindow) CanNavigateBack deprecated

func (self *PreferencesWindow) CanNavigateBack() bool

CanNavigateBack gets whether gestures and shortcuts for closing subpages are enabled.

Deprecated: Use navigationpage.GetCanPop instead.

The function returns the following values:

  • ok: whether gestures and shortcuts are enabled.

func (*PreferencesWindow) CloseSubpage deprecated

func (self *PreferencesWindow) CloseSubpage()

CloseSubpage closes the current subpage.

If there is no presented subpage, this does nothing.

Deprecated: Use preferenceswindow.PopSubpage instead.

func (*PreferencesWindow) PopSubpage

func (self *PreferencesWindow) PopSubpage() bool

PopSubpage: pop the visible page from the subpage stack of self.

The function returns the following values:

  • ok: TRUE if a page has been popped.

func (*PreferencesWindow) PresentSubpage deprecated

func (self *PreferencesWindow) PresentSubpage(subpage gtk.Widgetter)

PresentSubpage sets subpage as the window's subpage and opens it.

The transition can be cancelled by the user, in which case visible child will change back to the previously visible child.

Deprecated: Use preferenceswindow.PushSubpage instead.

The function takes the following parameters:

  • subpage: subpage.

func (*PreferencesWindow) PushSubpage

func (self *PreferencesWindow) PushSubpage(page *NavigationPage)

PushSubpage pushes page onto the subpage stack of self.

The page will be automatically removed when popped.

The function takes the following parameters:

  • page: subpage.

func (*PreferencesWindow) Remove

func (self *PreferencesWindow) Remove(page *PreferencesPage)

Remove removes a page from self.

The function takes the following parameters:

  • page to remove.

func (*PreferencesWindow) SearchEnabled

func (self *PreferencesWindow) SearchEnabled() bool

SearchEnabled gets whether search is enabled for self.

The function returns the following values:

  • ok: whether search is enabled for self.

func (*PreferencesWindow) SetCanNavigateBack deprecated

func (self *PreferencesWindow) SetCanNavigateBack(canNavigateBack bool)

SetCanNavigateBack sets whether gestures and shortcuts for closing subpages are enabled.

The supported gestures are:

- One-finger swipe on touchscreens

- Horizontal scrolling on touchpads (usually two-finger swipe)

- Back mouse button

The keyboard back key is also supported, as well as the <kbd>Alt</kbd>+<kbd>←</kbd> shortcut.

For right-to-left locales, gestures and shortcuts are reversed.

Deprecated: Use navigationpage.SetCanPop instead.

Has no effect for subpages added with preferenceswindow.PushSubpage.

The function takes the following parameters:

  • canNavigateBack: new value.

func (*PreferencesWindow) SetSearchEnabled

func (self *PreferencesWindow) SetSearchEnabled(searchEnabled bool)

SetSearchEnabled sets whether search is enabled for self.

The function takes the following parameters:

  • searchEnabled: whether search is enabled.

func (*PreferencesWindow) SetVisiblePage

func (self *PreferencesWindow) SetVisiblePage(page *PreferencesPage)

SetVisiblePage makes page the visible page of self.

The function takes the following parameters:

  • page of self.

func (*PreferencesWindow) SetVisiblePageName

func (self *PreferencesWindow) SetVisiblePageName(name string)

SetVisiblePageName makes the page with the given name visible.

See viewstack:visible-child.

The function takes the following parameters:

  • name of the page to make visible.

func (*PreferencesWindow) VisiblePage

func (self *PreferencesWindow) VisiblePage() *PreferencesPage

VisiblePage gets the currently visible page of self.

The function returns the following values:

  • preferencesPage (optional): visible page.

func (*PreferencesWindow) VisiblePageName

func (self *PreferencesWindow) VisiblePageName() string

VisiblePageName gets the name of currently visible page of self.

The function returns the following values:

  • utf8 (optional): name of the visible page.

type PreferencesWindowClass

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

PreferencesWindowClass: instance of this type is always passed by reference.

func (*PreferencesWindowClass) ParentClass

func (p *PreferencesWindowClass) ParentClass() *WindowClass

ParentClass: parent class.

type PreferencesWindowOverrides

type PreferencesWindowOverrides struct {
}

PreferencesWindowOverrides contains methods that are overridable.

type PropertyAnimationTarget

type PropertyAnimationTarget struct {
	AnimationTarget
	// contains filtered or unexported fields
}

PropertyAnimationTarget: animationtarget changing the value of a property of a gobject.Object instance.

func NewPropertyAnimationTarget

func NewPropertyAnimationTarget(object *coreglib.Object, propertyName string) *PropertyAnimationTarget

NewPropertyAnimationTarget creates a new AdwPropertyAnimationTarget for the property_name property on object.

The function takes the following parameters:

  • object to be animated.
  • propertyName: name of the property on object to animate.

The function returns the following values:

  • propertyAnimationTarget: newly created AdwPropertyAnimationTarget.

func (*PropertyAnimationTarget) Object

func (self *PropertyAnimationTarget) Object() *coreglib.Object

Object gets the object animated by self.

The AdwPropertyAnimationTarget instance does not hold a strong reference on the object; make sure the object is kept alive throughout the target's lifetime.

The function returns the following values:

  • object: animated object.

type ResponseAppearance

type ResponseAppearance C.gint

ResponseAppearance describes the possible styles of messagedialog response buttons.

See messagedialog.SetResponseAppearance.

const (
	// ResponseDefault: default appearance.
	ResponseDefault ResponseAppearance = iota
	// ResponseSuggested: used to denote important responses such as the
	// affirmative action.
	ResponseSuggested
	// ResponseDestructive: used to draw attention to the potentially damaging
	// consequences of using the response. This appearance acts as a warning to
	// the user.
	ResponseDestructive
)

func (ResponseAppearance) String

func (r ResponseAppearance) String() string

String returns the name in string for ResponseAppearance.

type SpinRow

type SpinRow struct {
	ActionRow

	*coreglib.Object
	gtk.EditableTextWidget
	// contains filtered or unexported fields
}

SpinRow: actionrow with an embedded spin button.

<picture> <source srcset="spin-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="spin-row.png" alt="spin-row"> </picture>

Example of an AdwSpinRow UI definition:

<object class="AdwSpinRow">
  <property name="title" translatable="yes">Spin Row</property>
  <property name="adjustment">
    <object class="GtkAdjustment">
      <property name="lower">0</property>
      <property name="upper">100</property>
      <property name="value">50</property>
      <property name="page-increment">10</property>
      <property name="step-increment">1</property>
    </object>
  </property>
</object>

See gtk.SpinButton for details.

CSS nodes

AdwSpinRow has the same structure as actionrow, as well as the .spin style class on the main node.

func NewSpinRow

func NewSpinRow(adjustment *gtk.Adjustment, climbRate float64, digits uint) *SpinRow

NewSpinRow creates a new AdwSpinRow.

The function takes the following parameters:

  • adjustment (optional) that this spin row should use.
  • climbRate: rate the value changes when holding a button or key.
  • digits: number of decimal places to display.

The function returns the following values:

  • spinRow: newly created AdwSpinRow.

func NewSpinRowWithRange

func NewSpinRowWithRange(min, max, step float64) *SpinRow

NewSpinRowWithRange creates a new AdwSpinRow with the given properties.

This is a convenience constructor that allows creation of a numeric AdwSpinRow without manually creating an adjustment. The value is initially set to the minimum value and a page increment of 10 * step is the default. The precision of the spin row is equivalent to the precisions of step.

Note that the way in which the precision is derived works best if step is a power of ten. If the resulting precision is not suitable for your needs, use spinrow.SetDigits to correct it.

The function takes the following parameters:

  • min: minimum allowable value.
  • max: maximum allowable value.
  • step: increment added or subtracted by spinning the widget.

The function returns the following values:

  • spinRow: new AdwSpinRow.

func (*SpinRow) Adjustment

func (self *SpinRow) Adjustment() *gtk.Adjustment

Adjustment gets the adjustment that holds the value for the spin row.

The function returns the following values:

  • adjustment that holds the spin row's value.

func (*SpinRow) ClimbRate

func (self *SpinRow) ClimbRate() float64

ClimbRate gets the acceleration rate when you hold down a button or key.

The function returns the following values:

  • gdouble: acceleration rate when you hold down a button or key.

func (*SpinRow) Configure

func (self *SpinRow) Configure(adjustment *gtk.Adjustment, climbRate float64, digits uint)

Configure changes the properties of an existing spin row.

The adjustment, climb rate, and number of decimal places are updated accordingly.

The function takes the following parameters:

  • adjustment (optional) that this spin row should use.
  • climbRate: new climb rate.
  • digits: number of decimal places to display.

func (*SpinRow) ConnectOutput

func (self *SpinRow) ConnectOutput(f func() (ok bool)) coreglib.SignalHandle

ConnectOutput is emitted to tweak the formatting of the value for display.

See gtk.SpinButton::output.

func (*SpinRow) ConnectWrapped

func (self *SpinRow) ConnectWrapped(f func()) coreglib.SignalHandle

ConnectWrapped is emitted right after the spinbutton wraps.

See gtk.SpinButton::wrapped.

func (*SpinRow) Digits

func (self *SpinRow) Digits() uint

Digits gets the number of decimal places to display.

The function returns the following values:

  • guint: number of decimal places to display.

func (*SpinRow) Numeric

func (self *SpinRow) Numeric() bool

Numeric gets whether non-numeric characters should be ignored.

The function returns the following values:

  • ok: whether non-numeric characters should be ignored.

func (*SpinRow) SetAdjustment

func (self *SpinRow) SetAdjustment(adjustment *gtk.Adjustment)

SetAdjustment sets the adjustment that holds the value for the spin row.

The function takes the following parameters:

  • adjustment (optional): adjustment.

func (*SpinRow) SetClimbRate

func (self *SpinRow) SetClimbRate(climbRate float64)

SetClimbRate sets the acceleration rate when you hold down a button or key.

The function takes the following parameters:

  • climbRate: acceleration rate when you hold down a button or key.

func (*SpinRow) SetDigits

func (self *SpinRow) SetDigits(digits uint)

SetDigits sets the number of decimal places to display.

The function takes the following parameters:

  • digits: number of decimal places to display.

func (*SpinRow) SetNumeric

func (self *SpinRow) SetNumeric(numeric bool)

SetNumeric sets whether non-numeric characters should be ignored.

The function takes the following parameters:

  • numeric: whether non-numeric characters should be ignored.

func (*SpinRow) SetRange

func (self *SpinRow) SetRange(min, max float64)

SetRange sets the minimum and maximum allowable values for self.

If the current value is outside this range, it will be adjusted to fit within the range, otherwise it will remain unchanged.

The function takes the following parameters:

  • min: minimum allowable value.
  • max: maximum allowable value.

func (*SpinRow) SetSnapToTicks

func (self *SpinRow) SetSnapToTicks(snapToTicks bool)

SetSnapToTicks sets whether invalid values are snapped to the nearest step increment.

The function takes the following parameters:

  • snapToTicks: whether invalid values are snapped to the nearest step increment.

func (*SpinRow) SetUpdatePolicy

func (self *SpinRow) SetUpdatePolicy(policy gtk.SpinButtonUpdatePolicy)

SetUpdatePolicy sets the policy for updating the spin row.

The options are always, or only when the value is invalid.

The function takes the following parameters:

  • policy for updating the spin row.

func (*SpinRow) SetValue

func (self *SpinRow) SetValue(value float64)

SetValue sets the current value.

The function takes the following parameters:

  • value: new value.

func (*SpinRow) SetWrap

func (self *SpinRow) SetWrap(wrap bool)

SetWrap sets whether the spin row should wrap upon reaching its limits.

The function takes the following parameters:

  • wrap: whether the spin row should wrap upon reaching its limits.

func (*SpinRow) SnapToTicks

func (self *SpinRow) SnapToTicks() bool

SnapToTicks gets whether invalid values are snapped to nearest step increment.

The function returns the following values:

  • ok: whether invalid values are snapped to the nearest step increment.

func (*SpinRow) Update

func (self *SpinRow) Update()

Update: manually force an update of the spin row.

func (*SpinRow) UpdatePolicy

func (self *SpinRow) UpdatePolicy() gtk.SpinButtonUpdatePolicy

UpdatePolicy gets the policy for updating the spin row.

The function returns the following values:

  • spinButtonUpdatePolicy: policy for updating the spin row.

func (*SpinRow) Value

func (self *SpinRow) Value() float64

Value gets the current value.

The function returns the following values:

  • gdouble: current value.

func (*SpinRow) Wrap

func (self *SpinRow) Wrap() bool

Wrap gets whether the spin row should wrap upon reaching its limits.

The function returns the following values:

  • ok: whether the spin row should wrap upon reaching its limits.

type SpinRowClass

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

SpinRowClass: instance of this type is always passed by reference.

func (*SpinRowClass) ParentClass

func (s *SpinRowClass) ParentClass() *ActionRowClass

type SpinRowOverrides

type SpinRowOverrides struct {
}

SpinRowOverrides contains methods that are overridable.

type SplitButton

type SplitButton struct {
	gtk.Widget

	*coreglib.Object
	gtk.Actionable
	// contains filtered or unexported fields
}

SplitButton: combined button and dropdown widget.

<picture> <source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)"> <img src="split-button.png" alt="split-button"> </picture>

AdwSplitButton is typically used to present a set of actions in a menu, but allow access to one of them with a single click.

The API is very similar to gtk.Button and gtk.MenuButton, see their documentation for details.

CSS nodes

splitbutton[.image-button][.text-button]
├── button
│   ╰── <content>
├── separator
╰── menubutton
    ╰── button.toggle
        ╰── arrow

AdwSplitButton's CSS node is called splitbutton. It contains the css nodes: button, separator, menubutton. See gtk.MenuButton documentation for the menubutton contents.

The main CSS node will contain the .image-button or .text-button style classes matching the button contents. The nested button nodes will never contain them.

Accessibility

AdwSplitButton uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewSplitButton

func NewSplitButton() *SplitButton

NewSplitButton creates a new AdwSplitButton.

The function returns the following values:

  • splitButton: newly created AdwSplitButton.

func (*SplitButton) CanShrink

func (self *SplitButton) CanShrink() bool

CanShrink gets whether the button can be smaller than the natural size of its contents.

The function returns the following values:

  • ok: whether the button can shrink.

func (*SplitButton) Child

func (self *SplitButton) Child() gtk.Widgetter

Child gets the child widget.

The function returns the following values:

  • widget (optional): child widget.

func (*SplitButton) ConnectActivate

func (self *SplitButton) ConnectActivate(f func()) coreglib.SignalHandle

ConnectActivate is emitted to animate press then release.

This is an action signal. Applications should never connect to this signal, but use the splitbutton::clicked signal.

func (*SplitButton) ConnectClicked

func (self *SplitButton) ConnectClicked(f func()) coreglib.SignalHandle

ConnectClicked is emitted when the button has been activated (pressed and released).

func (*SplitButton) Direction

func (self *SplitButton) Direction() gtk.ArrowType

Direction gets the direction in which the popup will be popped up.

The function returns the following values:

  • arrowType: direction.

func (*SplitButton) DropdownTooltip

func (self *SplitButton) DropdownTooltip() string

DropdownTooltip gets the tooltip of the dropdown button of self.

The function returns the following values:

  • utf8: dropdown tooltip of self.

func (*SplitButton) IconName

func (self *SplitButton) IconName() string

IconName gets the name of the icon used to automatically populate the button.

The function returns the following values:

  • utf8 (optional): icon name.

func (*SplitButton) Label

func (self *SplitButton) Label() string

Label gets the label for self.

The function returns the following values:

  • utf8 (optional): label for self.

func (*SplitButton) MenuModel

func (self *SplitButton) MenuModel() gio.MenuModeller

MenuModel gets the menu model from which the popup will be created.

The function returns the following values:

  • menuModel (optional): menu model.

func (*SplitButton) Popdown

func (self *SplitButton) Popdown()

Popdown dismisses the menu.

func (*SplitButton) Popover

func (self *SplitButton) Popover() *gtk.Popover

Popover gets the popover that will be popped up when the dropdown is clicked.

The function returns the following values:

  • popover (optional): popover.

func (*SplitButton) Popup

func (self *SplitButton) Popup()

Popup pops up the menu.

func (*SplitButton) SetCanShrink

func (self *SplitButton) SetCanShrink(canShrink bool)

SetCanShrink sets whether the button can be smaller than the natural size of its contents.

If set to TRUE, the label will ellipsize.

See gtk.Button.SetCanShrink() and gtk.MenuButton.SetCanShrink().

The function takes the following parameters:

  • canShrink: whether the button can shrink.

func (*SplitButton) SetChild

func (self *SplitButton) SetChild(child gtk.Widgetter)

SetChild sets the child widget.

Setting the child widget will set splitbutton:label and splitbutton:icon-name to NULL.

The function takes the following parameters:

  • child (optional): new child widget.

func (*SplitButton) SetDirection

func (self *SplitButton) SetDirection(direction gtk.ArrowType)

SetDirection sets the direction in which the popup will be popped up.

The dropdown arrow icon will point at the same direction.

If the does not fit in the available space in the given direction, GTK will try its best to keep it inside the screen and fully visible.

If you pass GTK_ARROW_NONE, it's equivalent to GTK_ARROW_DOWN.

The function takes the following parameters:

  • direction: direction.

func (*SplitButton) SetDropdownTooltip

func (self *SplitButton) SetDropdownTooltip(tooltip string)

SetDropdownTooltip sets the tooltip of the dropdown button of self.

The tooltip can be marked up with the Pango text markup language.

The function takes the following parameters:

  • tooltip: dropdown tooltip of self.

func (*SplitButton) SetIconName

func (self *SplitButton) SetIconName(iconName string)

SetIconName sets the name of the icon used to automatically populate the button.

Setting the icon name will set splitbutton:label and splitbutton:child to NULL.

The function takes the following parameters:

  • iconName: icon name to set.

func (*SplitButton) SetLabel

func (self *SplitButton) SetLabel(label string)

SetLabel sets the label for self.

Setting the label will set splitbutton:icon-name and splitbutton:child to NULL.

The function takes the following parameters:

  • label to set.

func (*SplitButton) SetMenuModel

func (self *SplitButton) SetMenuModel(menuModel gio.MenuModeller)

SetMenuModel sets the menu model from which the popup will be created.

If the menu model is NULL, the dropdown is disabled.

A gtk.Popover will be created from the menu model with gtk.PopoverMenu.NewFromModel. Actions will be connected as documented for this function.

If splitbutton:popover is already set, it will be dissociated from the button, and the property is set to NULL.

The function takes the following parameters:

  • menuModel (optional): menu model.

func (*SplitButton) SetPopover

func (self *SplitButton) SetPopover(popover *gtk.Popover)

SetPopover sets the popover that will be popped up when the dropdown is clicked.

If the popover is NULL, the dropdown is disabled.

If splitbutton:menu-model is set, the menu model is dissociated from the button, and the property is set to NULL.

The function takes the following parameters:

  • popover (optional): popover.

func (*SplitButton) SetUseUnderline

func (self *SplitButton) SetUseUnderline(useUnderline bool)

SetUseUnderline sets whether an underline in the text indicates a mnemonic.

See splitbutton:label.

The function takes the following parameters:

  • useUnderline: whether an underline in the text indicates a mnemonic.

func (*SplitButton) UseUnderline

func (self *SplitButton) UseUnderline() bool

UseUnderline gets whether an underline in the text indicates a mnemonic.

The function returns the following values:

  • ok: whether an underline in the text indicates a mnemonic.

type SplitButtonClass

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

SplitButtonClass: instance of this type is always passed by reference.

func (*SplitButtonClass) ParentClass

func (s *SplitButtonClass) ParentClass() *gtk.WidgetClass

type SplitButtonOverrides

type SplitButtonOverrides struct {
}

SplitButtonOverrides contains methods that are overridable.

type SpringAnimation

type SpringAnimation struct {
	Animation
	// contains filtered or unexported fields
}

SpringAnimation: spring-based animation.

AdwSpringAnimation implements an animation driven by a physical model of a spring described by springparams, with a resting position in springanimation:value-to, stretched to springanimation:value-from.

Since the animation is physically simulated, spring animations don't have a fixed duration. The animation will stop when the simulated spring comes to a rest - when the amplitude of the oscillations becomes smaller than springanimation:epsilon, or immediately when it reaches springanimation:value-to if springanimation:clamp is set to TRUE. The estimated duration can be obtained with springanimation:estimated-duration.

Due to the nature of spring-driven motion the animation can overshoot springanimation:value-to before coming to a rest. Whether the animation will overshoot or not depends on the damping ratio of the spring. See springparams for more information about specific damping ratio values.

If springanimation:clamp is TRUE, the animation will abruptly end as soon as it reaches the final value, preventing overshooting.

Animations can have an initial velocity value, set via springanimation:initial-velocity, which adjusts the curve without changing the duration. This makes spring animations useful for deceleration at the end of gestures.

If the initial and final values are equal, and the initial velocity is not 0, the animation value will bounce and return to its resting position.

func NewSpringAnimation

func NewSpringAnimation(widget gtk.Widgetter, from, to float64, springParams *SpringParams, target AnimationTargetter) *SpringAnimation

NewSpringAnimation creates a new AdwSpringAnimation on widget.

The animation will animate target from from to to with the dynamics of a spring described by spring_params.

The function takes the following parameters:

  • widget to create animation on.
  • from: value to animate from.
  • to: value to animate to.
  • springParams: physical parameters of the spring.
  • target value to animate.

The function returns the following values:

  • springAnimation: newly created animation.

func (*SpringAnimation) CalculateValue

func (self *SpringAnimation) CalculateValue(time uint) float64

CalculateValue calculates the value self will have at time.

The time starts at 0 and ends at springanimation:estimated_duration.

See also springanimation.CalculateVelocity.

The function takes the following parameters:

  • time: elapsed time, in milliseconds.

The function returns the following values:

  • gdouble: value at time.

func (*SpringAnimation) CalculateVelocity

func (self *SpringAnimation) CalculateVelocity(time uint) float64

CalculateVelocity calculates the velocity self will have at time.

The time starts at 0 and ends at springanimation:estimated_duration.

See also springanimation.CalculateValue.

The function takes the following parameters:

  • time: elapsed time, in milliseconds.

The function returns the following values:

  • gdouble: velocity at time.

func (*SpringAnimation) Clamp

func (self *SpringAnimation) Clamp() bool

Clamp gets whether self should be clamped.

The function returns the following values:

  • ok: whether self is clamped.

func (*SpringAnimation) Epsilon

func (self *SpringAnimation) Epsilon() float64

Epsilon gets the precision of the spring.

The function returns the following values:

  • gdouble: epsilon value.

func (*SpringAnimation) EstimatedDuration

func (self *SpringAnimation) EstimatedDuration() uint

EstimatedDuration gets the estimated duration of self, in milliseconds.

Can be duration_infinite if the spring damping is set to 0.

The function returns the following values:

  • guint: estimated duration.

func (*SpringAnimation) InitialVelocity

func (self *SpringAnimation) InitialVelocity() float64

InitialVelocity gets the initial velocity of self.

The function returns the following values:

  • gdouble: initial velocity.

func (*SpringAnimation) SetClamp

func (self *SpringAnimation) SetClamp(clamp bool)

SetClamp sets whether self should be clamped.

If set to TRUE, the animation will abruptly end as soon as it reaches the final value, preventing overshooting.

It won't prevent overshooting springanimation:value-from if a relative negative springanimation:initial-velocity is set.

The function takes the following parameters:

  • clamp: new value.

func (*SpringAnimation) SetEpsilon

func (self *SpringAnimation) SetEpsilon(epsilon float64)

SetEpsilon sets the precision of the spring.

The level of precision used to determine when the animation has come to a rest, that is, when the amplitude of the oscillations becomes smaller than this value.

If the epsilon value is too small, the animation will take a long time to stop after the animated value has stopped visibly changing.

If the epsilon value is too large, the animation will end prematurely.

The default value is 0.001.

The function takes the following parameters:

  • epsilon: new value.

func (*SpringAnimation) SetInitialVelocity

func (self *SpringAnimation) SetInitialVelocity(velocity float64)

SetInitialVelocity sets the initial velocity of self.

Initial velocity affects only the animation curve, but not its duration.

The function takes the following parameters:

  • velocity: initial velocity.

func (*SpringAnimation) SetSpringParams

func (self *SpringAnimation) SetSpringParams(springParams *SpringParams)

SetSpringParams sets the physical parameters of the spring of self.

The function takes the following parameters:

  • springParams: new spring parameters.

func (*SpringAnimation) SetValueFrom

func (self *SpringAnimation) SetValueFrom(value float64)

SetValueFrom sets the value self will animate from.

The animation will start at this value and end at springanimation:value-to.

The function takes the following parameters:

  • value to animate from.

func (*SpringAnimation) SetValueTo

func (self *SpringAnimation) SetValueTo(value float64)

SetValueTo sets the value self will animate to.

The animation will start at springanimation:value-from and end at this value.

The function takes the following parameters:

  • value to animate to.

func (*SpringAnimation) SpringParams

func (self *SpringAnimation) SpringParams() *SpringParams

SpringParams gets the physical parameters of the spring of self.

The function returns the following values:

  • springParams: spring parameters.

func (*SpringAnimation) ValueFrom

func (self *SpringAnimation) ValueFrom() float64

ValueFrom gets the value self will animate from.

The function returns the following values:

  • gdouble: value to animate from.

func (*SpringAnimation) ValueTo

func (self *SpringAnimation) ValueTo() float64

ValueTo gets the value self will animate to.

The function returns the following values:

  • gdouble: value to animate to.

func (*SpringAnimation) Velocity

func (self *SpringAnimation) Velocity() float64

Velocity gets the current velocity of self.

The function returns the following values:

  • gdouble: current velocity.

type SpringParams

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

SpringParams: physical parameters of a spring for springanimation.

Any spring can be described by three parameters: mass, stiffness and damping.

An undamped spring will produce an oscillatory motion which will go on forever.

The frequency and amplitude of the oscillations will be determined by the stiffness (how "strong" the spring is) and its mass (how much "inertia" it has).

If damping is larger than 0, the amplitude of that oscillating motion will exponientally decrease over time. If that damping is strong enough that the spring can't complete a full oscillation, it's called an overdamped spring.

If we the spring can oscillate, it's called an underdamped spring.

The value between these two behaviors is called critical damping; a critically damped spring will comes to rest in the minimum possible time without producing oscillations.

The damping can be replaced by damping ratio, which produces the following springs:

* 0: an undamped spring. * Between 0 and 1: an underdamped spring. * 1: a critically damped spring. * Larger than 1: an overdamped spring.

As such

An instance of this type is always passed by reference.

func NewSpringParams

func NewSpringParams(dampingRatio float64, mass float64, stiffness float64) *SpringParams

NewSpringParams constructs a struct SpringParams.

func NewSpringParamsFull

func NewSpringParamsFull(damping float64, mass float64, stiffness float64) *SpringParams

NewSpringParamsFull constructs a struct SpringParams.

func (*SpringParams) Damping

func (self *SpringParams) Damping() float64

Damping gets the damping of self.

The function returns the following values:

  • gdouble: damping.

func (*SpringParams) DampingRatio

func (self *SpringParams) DampingRatio() float64

DampingRatio gets the damping ratio of self.

The function returns the following values:

  • gdouble: damping ratio.

func (*SpringParams) Mass

func (self *SpringParams) Mass() float64

Mass gets the mass of self.

The function returns the following values:

  • gdouble: mass.

func (*SpringParams) Stiffness

func (self *SpringParams) Stiffness() float64

Stiffness gets the stiffness of self.

The function returns the following values:

  • gdouble: stiffness.

type Squeezer deprecated

type Squeezer struct {
	gtk.Widget

	*coreglib.Object
	gtk.Orientable
	// contains filtered or unexported fields
}

Squeezer: best fit container.

<picture> <source srcset="squeezer-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="squeezer-wide.png" alt="squeezer-wide"> </picture> <picture> <source srcset="squeezer-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="squeezer-narrow.png" alt="squeezer-narrow"> </picture>

The AdwSqueezer widget is a container which only shows the first of its children that fits in the available size. It is convenient to offer different widgets to represent the same data with different levels of detail, making the widget seem to squeeze itself to fit in the available space.

Transitions between children can be animated as fades. This can be controlled with squeezer:transition-type.

CSS nodes

AdwSqueezer has a single CSS node with name squeezer.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

func NewSqueezer deprecated

func NewSqueezer() *Squeezer

NewSqueezer creates a new AdwSqueezer.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • squeezer: newly created AdwSqueezer.

func (*Squeezer) Add deprecated

func (self *Squeezer) Add(child gtk.Widgetter) *SqueezerPage

Add adds a child to self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • squeezerPage: squeezerpage for child.

func (*Squeezer) AllowNone deprecated

func (self *Squeezer) AllowNone() bool

AllowNone gets whether to allow squeezing beyond the last child's minimum size.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • ok: whether self allows squeezing beyond the last child.

func (*Squeezer) Homogeneous deprecated

func (self *Squeezer) Homogeneous() bool

Homogeneous gets whether all children have the same size for the opposite orientation.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • ok: whether self is homogeneous.

func (*Squeezer) InterpolateSize deprecated

func (self *Squeezer) InterpolateSize() bool

InterpolateSize gets whether self interpolates its size when changing the visible child.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • ok: whether the size is interpolated.

func (*Squeezer) Page deprecated

func (self *Squeezer) Page(child gtk.Widgetter) *SqueezerPage

Page returns the squeezerpage object for child.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • child of self.

The function returns the following values:

  • squeezerPage: page object for child.

func (*Squeezer) Pages deprecated

func (self *Squeezer) Pages() *gtk.SelectionModel

Pages returns a gio.ListModel that contains the pages of self.

This can be used to keep an up-to-date view. The model also implements gtk.SelectionModel and can be used to track the visible page.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • selectionModel: GtkSelectionModel for the squeezer's children.

func (*Squeezer) Remove deprecated

func (self *Squeezer) Remove(child gtk.Widgetter)

Remove removes a child widget from self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • child to remove.

func (*Squeezer) SetAllowNone deprecated

func (self *Squeezer) SetAllowNone(allowNone bool)

SetAllowNone sets whether to allow squeezing beyond the last child's minimum size.

If set to TRUE, the squeezer can shrink to the point where no child can be shown. This is functionally equivalent to appending a widget with 0×0 minimum size.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • allowNone: whether self allows squeezing beyond the last child.

func (*Squeezer) SetHomogeneous deprecated

func (self *Squeezer) SetHomogeneous(homogeneous bool)

SetHomogeneous sets whether all children have the same size for the opposite orientation.

For example, if a squeezer is horizontal and is homogeneous, it will request the same height for all its children. If it isn't, the squeezer may change size when a different child becomes visible.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • homogeneous: whether self is homogeneous.

func (*Squeezer) SetInterpolateSize deprecated

func (self *Squeezer) SetInterpolateSize(interpolateSize bool)

SetInterpolateSize sets whether self interpolates its size when changing the visible child.

If TRUE, the squeezer 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 the squeezer is horizontal, it will interpolate the its height.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • interpolateSize: whether to interpolate the size.

func (*Squeezer) SetSwitchThresholdPolicy deprecated

func (self *Squeezer) SetSwitchThresholdPolicy(policy FoldThresholdPolicy)

SetSwitchThresholdPolicy sets the switch threshold policy for self.

Determines when the squeezer will switch children.

If set to ADW_FOLD_THRESHOLD_POLICY_MINIMUM, it will only switch when the visible child cannot fit anymore. With ADW_FOLD_THRESHOLD_POLICY_NATURAL, it will switch as soon as the visible child doesn't get their natural size.

This can be useful if you have a long ellipsizing label and want to let it ellipsize instead of immediately switching.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • policy to use.

func (*Squeezer) SetTransitionDuration deprecated

func (self *Squeezer) SetTransitionDuration(duration uint)

SetTransitionDuration sets the transition animation duration for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • duration: new duration, in milliseconds.

func (*Squeezer) SetTransitionType deprecated

func (self *Squeezer) SetTransitionType(transition SqueezerTransitionType)

SetTransitionType sets the type of animation used for transitions between children in self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • transition: new transition type.

func (*Squeezer) SetXAlign deprecated

func (self *Squeezer) SetXAlign(xalign float32)

SetXAlign sets the horizontal alignment, from 0 (start) to 1 (end).

This affects the children allocation during transitions, when they exceed the size of the squeezer.

For example, 0.5 means the child will be centered, 0 means it will keep the start side aligned and overflow the end side, and 1 means the opposite.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • xalign: new alignment value.

func (*Squeezer) SetYAlign deprecated

func (self *Squeezer) SetYAlign(yalign float32)

SetYAlign sets the vertical alignment, from 0 (top) to 1 (bottom).

This affects the children allocation during transitions, when they exceed the size of the squeezer.

For example, 0.5 means the child will be centered, 0 means it will keep the top side aligned and overflow the bottom side, and 1 means the opposite.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • yalign: new alignment value.

func (*Squeezer) SwitchThresholdPolicy deprecated

func (self *Squeezer) SwitchThresholdPolicy() FoldThresholdPolicy

SwitchThresholdPolicy gets the switch threshold policy for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

func (*Squeezer) TransitionDuration deprecated

func (self *Squeezer) TransitionDuration() uint

TransitionDuration gets the transition animation duration for self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • guint: transition duration, in milliseconds.

func (*Squeezer) TransitionRunning deprecated

func (self *Squeezer) TransitionRunning() bool

TransitionRunning gets whether a transition is currently running for self.

If a transition is impossible, the property value will be set to TRUE and then immediately to FALSE, so it's possible to rely on its notifications to know that a transition has happened.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • ok: whether a transition is currently running.

func (*Squeezer) TransitionType deprecated

func (self *Squeezer) TransitionType() SqueezerTransitionType

TransitionType gets the type of animation used for transitions between children in self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • squeezerTransitionType: current transition type of self.

func (*Squeezer) VisibleChild deprecated

func (self *Squeezer) VisibleChild() gtk.Widgetter

VisibleChild gets the currently visible child of self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • widget (optional): visible child.

func (*Squeezer) XAlign deprecated

func (self *Squeezer) XAlign() float32

XAlign gets the horizontal alignment, from 0 (start) to 1 (end).

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • gfloat: alignment value.

func (*Squeezer) YAlign deprecated

func (self *Squeezer) YAlign() float32

YAlign gets the vertical alignment, from 0 (top) to 1 (bottom).

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • gfloat: alignment value.

type SqueezerClass

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

SqueezerClass: instance of this type is always passed by reference.

func (*SqueezerClass) ParentClass

func (s *SqueezerClass) ParentClass() *gtk.WidgetClass

type SqueezerOverrides

type SqueezerOverrides struct {
}

SqueezerOverrides contains methods that are overridable.

type SqueezerPage deprecated

type SqueezerPage struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

SqueezerPage: auxiliary class used by squeezer.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

func (*SqueezerPage) Child deprecated

func (self *SqueezerPage) Child() gtk.Widgetter

Child returns the squeezer child to which self belongs.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • widget: child to which self belongs.

func (*SqueezerPage) Enabled deprecated

func (self *SqueezerPage) Enabled() bool

Enabled gets whether self is enabled.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function returns the following values:

  • ok: whether self is enabled.

func (*SqueezerPage) SetEnabled deprecated

func (self *SqueezerPage) SetEnabled(enabled bool)

SetEnabled sets whether self is enabled.

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 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.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

The function takes the following parameters:

  • enabled: whether self is enabled.

type SqueezerPageClass

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

SqueezerPageClass: instance of this type is always passed by reference.

type SqueezerPageOverrides

type SqueezerPageOverrides struct {
}

SqueezerPageOverrides contains methods that are overridable.

type SqueezerTransitionType deprecated

type SqueezerTransitionType C.gint

SqueezerTransitionType describes the possible transitions in a squeezer widget.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwsqueezer).

const (
	// SqueezerTransitionTypeNone: no transition.
	SqueezerTransitionTypeNone SqueezerTransitionType = iota
	// SqueezerTransitionTypeCrossfade: cross-fade.
	SqueezerTransitionTypeCrossfade
)

func (SqueezerTransitionType) String

func (s SqueezerTransitionType) String() string

String returns the name in string for SqueezerTransitionType.

type StatusPage

type StatusPage struct {
	gtk.Widget
	// contains filtered or unexported fields
}

StatusPage: page used for empty/error states and similar use-cases.

<picture> <source srcset="status-page-dark.png" media="(prefers-color-scheme: dark)"> <img src="status-page.png" alt="status-page"> </picture>

The AdwStatusPage widget can have an icon, a title, a description and a custom widget which is displayed below them.

CSS nodes

AdwStatusPage has a main CSS node with name statuspage.

AdwStatusPage can use the .compact (style-classes.html#compact-status-page) style class for when it needs to fit into a small space such a sidebar or a popover.

func NewStatusPage

func NewStatusPage() *StatusPage

NewStatusPage creates a new AdwStatusPage.

The function returns the following values:

  • statusPage: newly created AdwStatusPage.

func (*StatusPage) Child

func (self *StatusPage) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*StatusPage) Description

func (self *StatusPage) Description() string

Description gets the description markup for self.

The function returns the following values:

  • utf8 (optional): description.

func (*StatusPage) IconName

func (self *StatusPage) IconName() string

IconName gets the icon name for self.

The function returns the following values:

  • utf8 (optional): icon name.

func (*StatusPage) Paintable

func (self *StatusPage) Paintable() *gdk.Paintable

Paintable gets the paintable for self.

The function returns the following values:

  • paintable (optional): paintable.

func (*StatusPage) SetChild

func (self *StatusPage) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

func (*StatusPage) SetDescription

func (self *StatusPage) SetDescription(description string)

SetDescription sets the description markup for self.

The description is displayed below the title. It is parsed as Pango markup.

The function takes the following parameters:

  • description (optional): description.

func (*StatusPage) SetIconName

func (self *StatusPage) SetIconName(iconName string)

SetIconName sets the icon name for self.

Changing this will set statuspage:paintable to NULL.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*StatusPage) SetPaintable

func (self *StatusPage) SetPaintable(paintable gdk.Paintabler)

SetPaintable sets the paintable for self.

Changing this will set statuspage:icon-name to NULL.

The function takes the following parameters:

  • paintable (optional): paintable.

func (*StatusPage) SetTitle

func (self *StatusPage) SetTitle(title string)

SetTitle sets the title for self.

The title is displayed below the icon. It is not parsed as Pango markup.

The function takes the following parameters:

  • title: title.

func (*StatusPage) Title

func (self *StatusPage) Title() string

Title gets the title for self.

The function returns the following values:

  • utf8: title.

type StatusPageClass

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

StatusPageClass: instance of this type is always passed by reference.

func (*StatusPageClass) ParentClass

func (s *StatusPageClass) ParentClass() *gtk.WidgetClass

type StatusPageOverrides

type StatusPageOverrides struct {
}

StatusPageOverrides contains methods that are overridable.

type StyleManager

type StyleManager struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

StyleManager class for managing application-wide styling.

AdwStyleManager provides a way to query and influence the application styles, such as whether to use dark or high contrast appearance.

It allows to set the color scheme via the stylemanager:color-scheme property, and to query the current appearance, as well as whether a system-wide color scheme preference exists.

func StyleManagerGetDefault

func StyleManagerGetDefault() *StyleManager

StyleManagerGetDefault gets the default AdwStyleManager instance.

It manages all gdk.Display instances unless the style manager for that display has an override.

See stylemanager.GetForDisplay().

The function returns the following values:

  • styleManager: default style manager.

func StyleManagerGetForDisplay

func StyleManagerGetForDisplay(display *gdk.Display) *StyleManager

StyleManagerGetForDisplay gets the AdwStyleManager instance managing display.

It can be used to override styles for that specific display instead of the whole application.

Most applications should use stylemanager.GetDefault() instead.

The function takes the following parameters:

  • display: GdkDisplay.

The function returns the following values:

  • styleManager: style manager for display.

func (*StyleManager) ColorScheme

func (self *StyleManager) ColorScheme() ColorScheme

ColorScheme gets the requested application color scheme.

The function returns the following values:

  • colorScheme: color scheme.

func (*StyleManager) Dark

func (self *StyleManager) Dark() bool

Dark gets whether the application is using dark appearance.

This can be used to query the current appearance, as requested via stylemanager:color-scheme.

The function returns the following values:

  • ok: whether the application is using dark appearance.

func (*StyleManager) Display

func (self *StyleManager) Display() *gdk.Display

Display gets the display the style manager is associated with.

The display will be NULL for the style manager returned by stylemanager.GetDefault().

The function returns the following values:

  • display (optional): display.

func (*StyleManager) HighContrast

func (self *StyleManager) HighContrast() bool

HighContrast gets whether the application is using high contrast appearance.

This cannot be overridden by applications.

The function returns the following values:

  • ok: whether the application is using high contrast appearance.

func (*StyleManager) SetColorScheme

func (self *StyleManager) SetColorScheme(colorScheme ColorScheme)

SetColorScheme sets the requested application color scheme.

The effective appearance will be decided based on the application color scheme and the system preferred color scheme. The stylemanager:dark property can be used to query the current effective appearance.

The ADW_COLOR_SCHEME_PREFER_LIGHT color scheme results in the application using light appearance unless the system prefers dark colors. This is the default value.

The ADW_COLOR_SCHEME_PREFER_DARK color scheme results in the application using dark appearance, but can still switch to the light appearance if the system can prefers it, for example, when the high contrast preference is enabled.

The ADW_COLOR_SCHEME_FORCE_LIGHT and ADW_COLOR_SCHEME_FORCE_DARK values ignore the system preference entirely. They are useful if the application wants to match its UI to its content or to provide a separate color scheme switcher.

If a per-gdk.Display style manager has its color scheme set to ADW_COLOR_SCHEME_DEFAULT, it will inherit the color scheme from the default style manager.

For the default style manager, ADW_COLOR_SCHEME_DEFAULT is equivalent to ADW_COLOR_SCHEME_PREFER_LIGHT.

The stylemanager:system-supports-color-schemes property can be used to check if the current environment provides a color scheme preference.

The function takes the following parameters:

  • colorScheme: color scheme.

func (*StyleManager) SystemSupportsColorSchemes

func (self *StyleManager) SystemSupportsColorSchemes() bool

SystemSupportsColorSchemes gets whether the system supports color schemes.

This can be used to check if the current environment provides a color scheme preference. For example, applications might want to show a separate appearance switcher if it's set to FALSE.

The function returns the following values:

  • ok: whether the system supports color schemes.

type StyleManagerClass

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

StyleManagerClass: instance of this type is always passed by reference.

type StyleManagerOverrides

type StyleManagerOverrides struct {
}

StyleManagerOverrides contains methods that are overridable.

type SwipeTracker

type SwipeTracker struct {
	*coreglib.Object

	gtk.Orientable
	// contains filtered or unexported fields
}

SwipeTracker: swipe tracker used in carousel, navigationview and overlaysplitview.

The AdwSwipeTracker object can be used for implementing widgets with swipe gestures. It supports touch-based swipes, pointer dragging, and touchpad scrolling.

The widgets will probably want to expose the swipetracker:enabled property. If they expect to use horizontal orientation, swipetracker:reversed can be used for supporting RTL text direction.

func NewSwipeTracker

func NewSwipeTracker(swipeable Swipeabler) *SwipeTracker

NewSwipeTracker creates a new AdwSwipeTracker for widget.

The function takes the following parameters:

  • swipeable: widget to add the tracker on.

The function returns the following values:

  • swipeTracker: newly created AdwSwipeTracker.

func (*SwipeTracker) AllowLongSwipes

func (self *SwipeTracker) AllowLongSwipes() bool

AllowLongSwipes gets whether to allow swiping for more than one snap point at a time.

The function returns the following values:

  • ok: whether long swipes are allowed.

func (*SwipeTracker) AllowMouseDrag

func (self *SwipeTracker) AllowMouseDrag() bool

AllowMouseDrag gets whether self can be dragged with mouse pointer.

The function returns the following values:

  • ok: whether mouse dragging is allowed.

func (*SwipeTracker) ConnectBeginSwipe

func (self *SwipeTracker) ConnectBeginSwipe(f func()) coreglib.SignalHandle

ConnectBeginSwipe: this signal is emitted right before a swipe will be started, after the drag threshold has been passed.

func (*SwipeTracker) ConnectEndSwipe

func (self *SwipeTracker) ConnectEndSwipe(f func(velocity, to float64)) coreglib.SignalHandle

ConnectEndSwipe: this signal is emitted as soon as the gesture has stopped.

The user is expected to animate the deceleration from the current progress value to to with an animation using velocity as the initial velocity, provided in pixels per second. springanimation is usually a good fit for this.

func (*SwipeTracker) ConnectPrepare

func (self *SwipeTracker) ConnectPrepare(f func(direction NavigationDirection)) coreglib.SignalHandle

ConnectPrepare: this signal is emitted when a possible swipe is detected.

The direction value can be used to restrict the swipe to a certain direction.

func (*SwipeTracker) ConnectUpdateSwipe

func (self *SwipeTracker) ConnectUpdateSwipe(f func(progress float64)) coreglib.SignalHandle

ConnectUpdateSwipe: this signal is emitted every time the progress value changes.

func (*SwipeTracker) Enabled

func (self *SwipeTracker) Enabled() bool

Enabled gets whether self is enabled.

The function returns the following values:

  • ok: whether self is enabled.

func (*SwipeTracker) LowerOvershoot

func (self *SwipeTracker) LowerOvershoot() bool

LowerOvershoot gets whether to allow swiping past the first available snap point.

The function returns the following values:

  • ok: whether to allow swiping past the first available snap point.

func (*SwipeTracker) Reversed

func (self *SwipeTracker) Reversed() bool

Reversed gets whether self is reversing the swipe direction.

The function returns the following values:

  • ok: whether the direction is reversed.

func (*SwipeTracker) SetAllowLongSwipes

func (self *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.

The function takes the following parameters:

  • allowLongSwipes: whether to allow long swipes.

func (*SwipeTracker) SetAllowMouseDrag

func (self *SwipeTracker) SetAllowMouseDrag(allowMouseDrag bool)

SetAllowMouseDrag sets whether self can be dragged with mouse pointer.

The function takes the following parameters:

  • allowMouseDrag: whether to allow mouse dragging.

func (*SwipeTracker) SetEnabled

func (self *SwipeTracker) SetEnabled(enabled bool)

SetEnabled sets whether self is enabled.

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

The function takes the following parameters:

  • enabled: whether self is enabled.

func (*SwipeTracker) SetLowerOvershoot

func (self *SwipeTracker) SetLowerOvershoot(overshoot bool)

SetLowerOvershoot sets whether to allow swiping past the first available snap point.

The function takes the following parameters:

  • overshoot: whether to allow swiping past the first available snap point.

func (*SwipeTracker) SetReversed

func (self *SwipeTracker) SetReversed(reversed bool)

SetReversed sets whether to reverse the swipe direction.

If the swipe tracker is horizontal, it can be used for supporting RTL text direction.

The function takes the following parameters:

  • reversed: whether to reverse the swipe direction.

func (*SwipeTracker) SetUpperOvershoot

func (self *SwipeTracker) SetUpperOvershoot(overshoot bool)

SetUpperOvershoot sets whether to allow swiping past the last available snap point.

The function takes the following parameters:

  • overshoot: whether to allow swiping past the last available snap point.

func (*SwipeTracker) ShiftPosition

func (self *SwipeTracker) ShiftPosition(delta float64)

ShiftPosition moves the current progress value by delta.

This can be used to adjust the current position if snap points move during the gesture.

The function takes the following parameters:

  • delta: position delta.

func (*SwipeTracker) Swipeable

func (self *SwipeTracker) Swipeable() *Swipeable

Swipeable: get the widget self is attached to.

The function returns the following values:

  • swipeable widget.

func (*SwipeTracker) UpperOvershoot

func (self *SwipeTracker) UpperOvershoot() bool

UpperOvershoot gets whether to allow swiping past the last available snap point.

The function returns the following values:

  • ok: whether to allow swiping past the last available snap point.

type SwipeTrackerClass

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

SwipeTrackerClass: instance of this type is always passed by reference.

type SwipeTrackerOverrides

type SwipeTrackerOverrides struct {
}

SwipeTrackerOverrides contains methods that are overridable.

type Swipeable

type Swipeable struct {
	gtk.Widget
	// contains filtered or unexported fields
}

Swipeable: interface for swipeable widgets.

The AdwSwipeable interface is implemented by all swipeable widgets.

See swipetracker for details about implementing it.

Swipeable wraps an interface. This means the user can get the underlying type by calling Cast().

func (*Swipeable) CancelProgress

func (self *Swipeable) CancelProgress() float64

CancelProgress gets the progress self will snap back to after the gesture is canceled.

The function returns the following values:

  • gdouble: cancel progress, unitless.

func (*Swipeable) Distance

func (self *Swipeable) Distance() float64

Distance gets the swipe distance of self.

This corresponds to how many pixels 1 unit represents.

The function returns the following values:

  • gdouble: swipe distance in pixels.

func (*Swipeable) Progress

func (self *Swipeable) Progress() float64

Progress gets the current progress of self.

The function returns the following values:

  • gdouble: current progress, unitless.

func (*Swipeable) SnapPoints

func (self *Swipeable) SnapPoints() []float64

SnapPoints gets the snap points of self.

Each snap point represents a progress value that is considered acceptable to end the swipe on.

The function returns the following values:

  • gdoubles: snap points.

func (*Swipeable) SwipeArea

func (self *Swipeable) SwipeArea(navigationDirection NavigationDirection, isDrag bool) *gdk.Rectangle

SwipeArea gets the area self 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.

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

The function takes the following parameters:

  • navigationDirection: direction of the swipe.
  • isDrag: whether the swipe is caused by a dragging gesture.

The function returns the following values:

  • rect: pointer to a rectangle to store the swipe area.

type SwipeableInterface

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

SwipeableInterface: interface for swipeable widgets.

An instance of this type is always passed by reference.

type Swipeabler

type Swipeabler interface {
	coreglib.Objector

	// CancelProgress gets the progress self will snap back to after the gesture
	// is canceled.
	CancelProgress() float64
	// Distance gets the swipe distance of self.
	Distance() float64
	// Progress gets the current progress of self.
	Progress() float64
	// SnapPoints gets the snap points of self.
	SnapPoints() []float64
	// SwipeArea gets the area self can start a swipe from for the given
	// direction and gesture type.
	SwipeArea(navigationDirection NavigationDirection, isDrag bool) *gdk.Rectangle
}

Swipeabler describes Swipeable's interface methods.

type SwitchRow

type SwitchRow struct {
	ActionRow
	// contains filtered or unexported fields
}

SwitchRow: gtk.ListBoxRow used to represent two states.

<picture> <source srcset="switch-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="switch-row.png" alt="switch-row"> </picture>

The AdwSwitchRow widget contains a gtk.Switch that allows the user to select between two states: "on" or "off". When activated, the row will invert its active state.

The user can control the switch by activating the row or by dragging on the switch handle.

See gtk.Switch for details.

Example of an AdwSwitchRow UI definition:

<object class="AdwSwitchRow">
  <property name="title" translatable="yes">Switch Row</property>
  <signal name="notify::active" handler="switch_row_notify_active_cb"/>
</object>

The switchrow:active property should be connected to in order to monitor changes to the active state.

func NewSwitchRow

func NewSwitchRow() *SwitchRow

NewSwitchRow creates a new AdwSwitchRow.

The function returns the following values:

  • switchRow: newly created AdwSwitchRow.

func (*SwitchRow) Active

func (self *SwitchRow) Active() bool

Active gets whether self is in its "on" or "off" position.

The function returns the following values:

  • ok: whether self is active or not.

func (*SwitchRow) SetActive

func (self *SwitchRow) SetActive(isActive bool)

SetActive sets whether self is in its "on" or "off" position.

The function takes the following parameters:

  • isActive: whether self should be active.

type SwitchRowClass

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

SwitchRowClass: instance of this type is always passed by reference.

func (*SwitchRowClass) ParentClass

func (s *SwitchRowClass) ParentClass() *ActionRowClass

type SwitchRowOverrides

type SwitchRowOverrides struct {
}

SwitchRowOverrides contains methods that are overridable.

type TabBar

type TabBar struct {
	gtk.Widget
	// contains filtered or unexported fields
}

TabBar: tab bar for tabview.

<picture> <source srcset="tab-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="tab-bar.png" alt="tab-bar"> </picture>

The AdwTabBar widget is a tab bar that can be used with conjunction with AdwTabView. It is typically used as a top bar within toolbarview.

AdwTabBar can autohide and can optionally contain action widgets on both sides of the tabs.

When there's not enough space to show all the tabs, AdwTabBar will scroll them. Pinned tabs always stay visible and aren't a part of the scrollable area.

CSS nodes

AdwTabBar has a single CSS node with name tabbar.

func NewTabBar

func NewTabBar() *TabBar

NewTabBar creates a new AdwTabBar.

The function returns the following values:

  • tabBar: newly created AdwTabBar.

func (*TabBar) Autohide

func (self *TabBar) Autohide() bool

Autohide gets whether the tabs automatically hide.

The function returns the following values:

  • ok: whether the tabs automatically hide.

func (*TabBar) ConnectExtraDragDrop

func (self *TabBar) ConnectExtraDragDrop(f func(page *TabPage, value coreglib.Value) (ok bool)) coreglib.SignalHandle

ConnectExtraDragDrop: this signal is emitted when content is dropped onto a tab.

The content must be of one of the types set up via tabbar.SetupExtraDropTarget.

See gtk.DropTarget::drop.

func (*TabBar) ConnectExtraDragValue

func (self *TabBar) ConnectExtraDragValue(f func(page *TabPage, value coreglib.Value) (dragAction gdk.DragAction)) coreglib.SignalHandle

ConnectExtraDragValue: this signal is emitted when the dropped content is preloaded.

In order for data to be preloaded, tabbar:extra-drag-preload must be set to TRUE.

The content must be of one of the types set up via tabbar.SetupExtraDropTarget.

See gtk.DropTarget:value.

func (*TabBar) EndActionWidget

func (self *TabBar) EndActionWidget() gtk.Widgetter

EndActionWidget gets the widget shown after the tabs.

The function returns the following values:

  • widget (optional) shown after the tabs.

func (*TabBar) ExpandTabs

func (self *TabBar) ExpandTabs() bool

ExpandTabs gets whether tabs expand to full width.

The function returns the following values:

  • ok: whether tabs expand to full width.

func (*TabBar) ExtraDragPreferredAction

func (self *TabBar) ExtraDragPreferredAction() gdk.DragAction

ExtraDragPreferredAction gets the current action during a drop on the extra_drop_target.

The function returns the following values:

  • dragAction: drag action of the current drop.

func (*TabBar) ExtraDragPreload

func (self *TabBar) ExtraDragPreload() bool

ExtraDragPreload gets whether drop data should be preloaded on hover.

The function returns the following values:

  • ok: whether drop data should be preloaded on hover.

func (*TabBar) Inverted

func (self *TabBar) Inverted() bool

Inverted gets whether tabs use inverted layout.

The function returns the following values:

  • ok: whether tabs use inverted layout.

func (*TabBar) IsOverflowing

func (self *TabBar) IsOverflowing() bool

IsOverflowing gets whether self is overflowing.

If TRUE, all tabs cannot be displayed at once and require scrolling.

The function returns the following values:

  • ok: whether self is overflowing.

func (*TabBar) SetAutohide

func (self *TabBar) SetAutohide(autohide bool)

SetAutohide sets whether the tabs automatically hide.

If set to TRUE, the tab bar disappears when tabbar:view has 0 or 1 tab, no pinned tabs, and no tab is being transferred.

See tabbar:tabs-revealed.

The function takes the following parameters:

  • autohide: whether the tabs automatically hide.

func (*TabBar) SetEndActionWidget

func (self *TabBar) SetEndActionWidget(widget gtk.Widgetter)

SetEndActionWidget sets the widget to show after the tabs.

The function takes the following parameters:

  • widget (optional) to show after the tabs.

func (*TabBar) SetExpandTabs

func (self *TabBar) SetExpandTabs(expandTabs bool)

SetExpandTabs sets whether tabs expand to full width.

If set to TRUE, the tabs will always vary width filling the whole width when possible, otherwise tabs will always have the minimum possible size.

The function takes the following parameters:

  • expandTabs: whether to expand tabs.

func (*TabBar) SetExtraDragPreload

func (self *TabBar) SetExtraDragPreload(preload bool)

SetExtraDragPreload sets whether drop data should be preloaded on hover.

See gtk.DropTarget:preload.

The function takes the following parameters:

  • preload: whether to preload drop data.

func (*TabBar) SetInverted

func (self *TabBar) SetInverted(inverted bool)

SetInverted sets whether tabs tabs use inverted layout.

If set to TRUE, non-pinned tabs will have the close button at the beginning and the indicator at the end rather than the opposite.

The function takes the following parameters:

  • inverted: whether tabs use inverted layout.

func (*TabBar) SetStartActionWidget

func (self *TabBar) SetStartActionWidget(widget gtk.Widgetter)

SetStartActionWidget sets the widget to show before the tabs.

The function takes the following parameters:

  • widget (optional) to show before the tabs.

func (*TabBar) SetView

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

SetView sets the tab view self controls.

The function takes the following parameters:

  • view (optional): tab view.

func (*TabBar) SetupExtraDropTarget

func (self *TabBar) SetupExtraDropTarget(actions gdk.DragAction, types []coreglib.Type)

SetupExtraDropTarget sets the supported types for this drop target.

Sets up an extra drop target on tabs.

This allows to drag arbitrary content onto tabs, for example URLs in a web browser.

If a tab is hovered for a certain period of time while dragging the content, it will be automatically selected.

The tabbar::extra-drag-drop signal can be used to handle the drop.

The function takes the following parameters:

  • actions: supported actions.
  • types (optional): all supported GTypes that can be dropped.

func (*TabBar) StartActionWidget

func (self *TabBar) StartActionWidget() gtk.Widgetter

StartActionWidget gets the widget shown before the tabs.

The function returns the following values:

  • widget (optional) shown before the tabs.

func (*TabBar) TabsRevealed

func (self *TabBar) TabsRevealed() bool

TabsRevealed gets whether the tabs are currently revealed.

See tabbar:autohide.

The function returns the following values:

  • ok: whether the tabs are currently revealed.

func (*TabBar) View

func (self *TabBar) View() *TabView

View gets the tab view self controls.

The function returns the following values:

  • tabView (optional): view self controls.

type TabBarClass

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

TabBarClass: instance of this type is always passed by reference.

func (*TabBarClass) ParentClass

func (t *TabBarClass) ParentClass() *gtk.WidgetClass

type TabBarOverrides

type TabBarOverrides struct {
}

TabBarOverrides contains methods that are overridable.

type TabButton

type TabButton struct {
	gtk.Widget

	*coreglib.Object
	gtk.Actionable
	// contains filtered or unexported fields
}

TabButton: button that displays the number of tabview pages.

<picture> <source srcset="tab-button-dark.png" media="(prefers-color-scheme: dark)"> <img src="tab-button.png" alt="tab-button"> </picture>

AdwTabButton is a button that displays the number of pages in a given AdwTabView, as well as whether one of the inactive pages needs attention.

It's intended to be used as a visible indicator when there's no visible tab bar, typically opening an taboverview on click, e.g. via the overview.open action name:

<object class="AdwTabButton">
  <property name="view">view</property>
  <property name="action-name">overview.open</property>
</object>

CSS nodes

AdwTabButton has a main CSS node with name tabbutton.

Accessibility

AdwTabButton uses the GTK_ACCESSIBLE_ROLE_BUTTON role.

func NewTabButton

func NewTabButton() *TabButton

NewTabButton creates a new AdwTabButton.

The function returns the following values:

  • tabButton: newly created AdwTabButton.

func (*TabButton) ConnectActivate

func (self *TabButton) ConnectActivate(f func()) coreglib.SignalHandle

ConnectActivate is emitted to animate press then release.

This is an action signal. Applications should never connect to this signal, but use the tabbutton::clicked signal.

func (*TabButton) ConnectClicked

func (self *TabButton) ConnectClicked(f func()) coreglib.SignalHandle

ConnectClicked is emitted when the button has been activated (pressed and released).

func (*TabButton) SetView

func (self *TabButton) SetView(view *TabView)

SetView sets the tab view to display.

The function takes the following parameters:

  • view (optional): tab view.

func (*TabButton) View

func (self *TabButton) View() *TabView

View gets the tab view self displays.

The function returns the following values:

  • tabView (optional): tab view.

type TabButtonClass

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

TabButtonClass: instance of this type is always passed by reference.

func (*TabButtonClass) ParentClass

func (t *TabButtonClass) ParentClass() *gtk.WidgetClass

type TabButtonOverrides

type TabButtonOverrides struct {
}

TabButtonOverrides contains methods that are overridable.

type TabOverview

type TabOverview struct {
	gtk.Widget
	// contains filtered or unexported fields
}

TabOverview: tab overview for tabview.

<picture> <source srcset="tab-overview-dark.png" media="(prefers-color-scheme: dark)"> <img src="tab-overview.png" alt="tab-overview"> </picture>

AdwTabOverview is a widget that can display tabs from an AdwTabView in a grid.

AdwTabOverview shows a thumbnail for each tab. By default thumbnails are static for all pages except the selected one. They can be made always live by setting tabpage:live-thumbnail to TRUE, or refreshed with tabpage.InvalidateThumbnail or tabview.InvalidateThumbnails otherwise.

If the pages are too tall or too wide, the thumbnails will be cropped; use tabpage:thumbnail-xalign and tabpage:thumbnail-yalign to control which part of the page should be visible in this case.

Pinned tabs are shown as smaller cards without thumbnails above the other tabs. Unlike in tabbar, they still have titles, as well as an unpin button.

AdwTabOverview provides search in open tabs. It searches in tab titles and tooltips, as well as tabpage:keyword.

If taboverview:enable-new-tab is set to TRUE, a new tab button will be shown. Connect to the taboverview::create-tab signal to use it.

taboverview:secondary-menu can be used to provide a secondary menu for the overview. Use it to add extra actions, e.g. to open a new window or undo closed tab.

AdwTabOverview is intended to be used as the direct child of the window, with the rest of the window contents set as the taboverview:child. The child is expected to contain an tabview.

AdwTabOverview shows window buttons by default. They can be disabled by setting taboverview:show-start-title-buttons and/or taboverview:show-start-title-buttons and/or taboverview:show-end-title-buttons to FALSE.

If search and window buttons are disabled, and secondary menu is not set, the header bar will be hidden.

Actions

AdwTabOverview defines the overview.open and overview.close actions for opening and closing itself. They can be convenient when used together with tabbutton.

CSS nodes

AdwTabOverview has a single CSS node with name taboverview.

func NewTabOverview

func NewTabOverview() *TabOverview

NewTabOverview creates a new AdwTabOverview.

The function returns the following values:

  • tabOverview: newly created AdwTabOverview.

func (*TabOverview) Child

func (self *TabOverview) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*TabOverview) ConnectCreateTab

func (self *TabOverview) ConnectCreateTab(f func() (tabPage *TabPage)) coreglib.SignalHandle

ConnectCreateTab is emitted when a tab needs to be created;

This can happen after the new tab button has been pressed, see taboverview:enable-new-tab.

The signal handler is expected to create a new page in the corresponding tabview and return it.

func (*TabOverview) ConnectExtraDragDrop

func (self *TabOverview) ConnectExtraDragDrop(f func(page *TabPage, value coreglib.Value) (ok bool)) coreglib.SignalHandle

ConnectExtraDragDrop: this signal is emitted when content is dropped onto a tab.

The content must be of one of the types set up via taboverview.SetupExtraDropTarget.

See gtk.DropTarget::drop.

func (*TabOverview) ConnectExtraDragValue

func (self *TabOverview) ConnectExtraDragValue(f func(page *TabPage, value coreglib.Value) (dragAction gdk.DragAction)) coreglib.SignalHandle

ConnectExtraDragValue: this signal is emitted when the dropped content is preloaded.

In order for data to be preloaded, taboverview:extra-drag-preload must be set to TRUE.

The content must be of one of the types set up via taboverview.SetupExtraDropTarget.

See gtk.DropTarget:value.

func (*TabOverview) EnableNewTab

func (self *TabOverview) EnableNewTab() bool

EnableNewTab gets whether to new tab button is enabled for self.

The function returns the following values:

  • ok: whether new tab button is enabled.

func (*TabOverview) EnableSearch

func (self *TabOverview) EnableSearch() bool

EnableSearch gets whether search in tabs is enabled for self.

The function returns the following values:

  • ok: whether search is enabled.

func (*TabOverview) ExtraDragPreferredAction

func (self *TabOverview) ExtraDragPreferredAction() gdk.DragAction

ExtraDragPreferredAction gets the current action during a drop on the extra_drop_target.

The function returns the following values:

  • dragAction: drag action of the current drop.

func (*TabOverview) ExtraDragPreload

func (self *TabOverview) ExtraDragPreload() bool

ExtraDragPreload gets whether drop data should be preloaded on hover.

The function returns the following values:

  • ok: whether drop data should be preloaded on hover.

func (*TabOverview) Inverted

func (self *TabOverview) Inverted() bool

Inverted gets whether thumbnails use inverted layout.

The function returns the following values:

  • ok: whether thumbnails use inverted layout.

func (*TabOverview) Open

func (self *TabOverview) Open() bool

Open gets whether self is open.

The function returns the following values:

  • ok: whether the overview is open.

func (*TabOverview) SearchActive

func (self *TabOverview) SearchActive() bool

SearchActive gets whether search is currently active for self.

See taboverview:enable-search.

The function returns the following values:

  • ok: whether search is active.

func (*TabOverview) SecondaryMenu

func (self *TabOverview) SecondaryMenu() gio.MenuModeller

SecondaryMenu gets the secondary menu model for self.

The function returns the following values:

  • menuModel (optional): secondary menu model.

func (*TabOverview) SetChild

func (self *TabOverview) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

func (*TabOverview) SetEnableNewTab

func (self *TabOverview) SetEnableNewTab(enableNewTab bool)

SetEnableNewTab sets whether to enable new tab button for self.

Connect to the taboverview::create-tab signal to use it.

The function takes the following parameters:

  • enableNewTab: whether to enable new tab button.

func (*TabOverview) SetEnableSearch

func (self *TabOverview) SetEnableSearch(enableSearch bool)

SetEnableSearch sets whether to enable search in tabs for self.

Search matches tab titles and tooltips, as well as keywords, set via tabpage:keyword. Use keywords to search in e.g. page URLs in a web browser.

During search, tab reordering and drag-n-drop are disabled.

Use taboverview:search-active to check out if search is currently active.

The function takes the following parameters:

  • enableSearch: whether to enable search.

func (*TabOverview) SetExtraDragPreload

func (self *TabOverview) SetExtraDragPreload(preload bool)

SetExtraDragPreload sets whether drop data should be preloaded on hover.

See gtk.DropTarget:preload.

The function takes the following parameters:

  • preload: whether to preload drop data.

func (*TabOverview) SetInverted

func (self *TabOverview) SetInverted(inverted bool)

SetInverted sets whether thumbnails use inverted layout.

If set to TRUE, thumbnails will have the close or unpin button at the beginning and the indicator at the end rather than the other way around.

The function takes the following parameters:

  • inverted: whether thumbnails use inverted layout.

func (*TabOverview) SetOpen

func (self *TabOverview) SetOpen(open bool)

SetOpen sets whether the to open self.

The function takes the following parameters:

  • open: whether the overview is open.

func (*TabOverview) SetSecondaryMenu

func (self *TabOverview) SetSecondaryMenu(secondaryMenu gio.MenuModeller)

SetSecondaryMenu sets the secondary menu model for self.

Use it to add extra actions, e.g. to open a new window or undo closed tab.

The function takes the following parameters:

  • secondaryMenu (optional): menu model.

func (*TabOverview) SetShowEndTitleButtons

func (self *TabOverview) SetShowEndTitleButtons(showEndTitleButtons bool)

SetShowEndTitleButtons sets whether to show end title buttons in self's header bar.

See headerbar:show-start-title-buttons for the other side.

The function takes the following parameters:

  • showEndTitleButtons: whether to show end title buttons.

func (*TabOverview) SetShowStartTitleButtons

func (self *TabOverview) SetShowStartTitleButtons(showStartTitleButtons bool)

SetShowStartTitleButtons sets whether to show start title buttons in self's header bar.

See headerbar:show-end-title-buttons for the other side.

The function takes the following parameters:

  • showStartTitleButtons: whether to show start title buttons.

func (*TabOverview) SetView

func (self *TabOverview) SetView(view *TabView)

SetView sets the tab view to control.

The view must be inside self, see taboverview:child.

The function takes the following parameters:

  • view (optional): tab view.

func (*TabOverview) SetupExtraDropTarget

func (self *TabOverview) SetupExtraDropTarget(actions gdk.DragAction, types []coreglib.Type)

SetupExtraDropTarget sets the supported types for this drop target.

Sets up an extra drop target on tabs.

This allows to drag arbitrary content onto tabs, for example URLs in a web browser.

If a tab is hovered for a certain period of time while dragging the content, it will be automatically selected.

The taboverview::extra-drag-drop signal can be used to handle the drop.

The function takes the following parameters:

  • actions: supported actions.
  • types (optional): all supported GTypes that can be dropped.

func (*TabOverview) ShowEndTitleButtons

func (self *TabOverview) ShowEndTitleButtons() bool

ShowEndTitleButtons gets whether end title buttons are shown in self's header bar.

The function returns the following values:

  • ok: whether end title buttons are shown.

func (*TabOverview) ShowStartTitleButtons

func (self *TabOverview) ShowStartTitleButtons() bool

ShowStartTitleButtons gets whether start title buttons are shown in self's header bar.

The function returns the following values:

  • ok: whether start title buttons are shown.

func (*TabOverview) View

func (self *TabOverview) View() *TabView

View gets the tab view self controls.

The function returns the following values:

  • tabView (optional): tab view.

type TabOverviewClass

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

TabOverviewClass: instance of this type is always passed by reference.

func (*TabOverviewClass) ParentClass

func (t *TabOverviewClass) ParentClass() *gtk.WidgetClass

type TabOverviewOverrides

type TabOverviewOverrides struct {
}

TabOverviewOverrides contains methods that are overridable.

type TabPage

type TabPage struct {
	*coreglib.Object

	gtk.Accessible
	// contains filtered or unexported fields
}

TabPage: auxiliary class used by tabview.

func (*TabPage) Child

func (self *TabPage) Child() gtk.Widgetter

Child gets the child of self.

The function returns the following values:

  • widget: child of self.

func (*TabPage) Icon

func (self *TabPage) Icon() *gio.Icon

Icon gets the icon of self.

The function returns the following values:

  • icon (optional) of self.

func (*TabPage) IndicatorActivatable

func (self *TabPage) IndicatorActivatable() bool

IndicatorActivatable gets whether the indicator of self is activatable.

The function returns the following values:

  • ok: whether the indicator is activatable.

func (*TabPage) IndicatorIcon

func (self *TabPage) IndicatorIcon() *gio.Icon

IndicatorIcon gets the indicator icon of self.

The function returns the following values:

  • icon (optional): indicator icon of self.

func (*TabPage) IndicatorTooltip

func (self *TabPage) IndicatorTooltip() string

IndicatorTooltip gets the tooltip of the indicator icon of self.

The function returns the following values:

  • utf8: indicator tooltip of self.

func (*TabPage) InvalidateThumbnail

func (self *TabPage) InvalidateThumbnail()

InvalidateThumbnail invalidates thumbnail for self.

If an taboverview is open, the thumbnail representing self will be immediately updated. Otherwise it will be update when opening the overview.

Does nothing if tabpage:live-thumbnail is set to TRUE.

See also tabview.InvalidateThumbnails.

func (*TabPage) Keyword

func (self *TabPage) Keyword() string

Keyword gets the search keyword of self.

The function returns the following values:

  • utf8 (optional): search keyword of self.

func (*TabPage) LiveThumbnail

func (self *TabPage) LiveThumbnail() bool

LiveThumbnail gets whether to live thumbnail is enabled self.

The function returns the following values:

  • ok: whether live thumbnail is enabled.

func (*TabPage) Loading

func (self *TabPage) Loading() bool

Loading gets whether self is loading.

The function returns the following values:

  • ok: whether self is loading.

func (*TabPage) NeedsAttention

func (self *TabPage) NeedsAttention() bool

NeedsAttention gets whether self needs attention.

The function returns the following values:

  • ok: whether self needs attention.

func (*TabPage) Parent

func (self *TabPage) Parent() *TabPage

Parent gets the parent page of self.

See tabview.AddPage and tabview.ClosePage.

The function returns the following values:

  • tabPage (optional): parent page.

func (*TabPage) Pinned

func (self *TabPage) Pinned() bool

Pinned gets whether self is pinned.

See tabview.SetPagePinned.

The function returns the following values:

  • ok: whether self is pinned.

func (*TabPage) Selected

func (self *TabPage) Selected() bool

Selected gets whether self is selected.

The function returns the following values:

  • ok: whether self is selected.

func (*TabPage) SetIcon

func (self *TabPage) SetIcon(icon gio.Iconner)

SetIcon sets the icon of self.

tabbar and taboverview display the icon next to the title, unless tabpage:loading is set to TRUE.

AdwTabBar also won't show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.

The function takes the following parameters:

  • icon (optional) of self.

func (*TabPage) SetIndicatorActivatable

func (self *TabPage) SetIndicatorActivatable(activatable bool)

SetIndicatorActivatable sets whether the indicator of self is activatable.

If set to TRUE, tabview::indicator-activated will be emitted when the indicator icon is clicked.

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

The function takes the following parameters:

  • activatable: whether the indicator is activatable.

func (*TabPage) SetIndicatorIcon

func (self *TabPage) SetIndicatorIcon(indicatorIcon gio.Iconner)

SetIndicatorIcon sets the indicator icon of self.

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

tabbar 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.

taboverview will show it at the at the top part of the thumbnail.

tabpage:indicator-tooltip can be used to set the tooltip on the indicator icon.

If tabpage:indicator-activatable is set to TRUE, the indicator icon can act as a button.

The function takes the following parameters:

  • indicatorIcon (optional): indicator icon of self.

func (*TabPage) SetIndicatorTooltip

func (self *TabPage) SetIndicatorTooltip(tooltip string)

SetIndicatorTooltip sets the tooltip of the indicator icon of self.

The tooltip can be marked up with the Pango text markup language.

See tabpage:indicator-icon.

The function takes the following parameters:

  • tooltip: indicator tooltip of self.

func (*TabPage) SetKeyword

func (self *TabPage) SetKeyword(keyword string)

SetKeyword sets the search keyword for self.

taboverview can search pages by their keywords in addition to their titles and tooltips.

Keywords allow to include e.g. page URLs into tab search in a web browser.

The function takes the following parameters:

  • keyword: search keyword.

func (*TabPage) SetLiveThumbnail

func (self *TabPage) SetLiveThumbnail(liveThumbnail bool)

SetLiveThumbnail sets whether to enable live thumbnail for self.

When set to TRUE, self's thumbnail in taboverview will update immediately when self is redrawn or resized.

If it's set to FALSE, the thumbnail will only be live when the self is selected, and otherwise it will be static and will only update when tabpage.InvalidateThumbnail or tabview.InvalidateThumbnails is called.

The function takes the following parameters:

  • liveThumbnail: whether to enable live thumbnail.

func (*TabPage) SetLoading

func (self *TabPage) SetLoading(loading bool)

SetLoading sets whether self is loading.

If set to TRUE, tabbar and taboverview will display a spinner in place of icon.

If the page is pinned and tabpage:indicator-icon is set, loading status will not be visible with AdwTabBar.

The function takes the following parameters:

  • loading: whether self is loading.

func (*TabPage) SetNeedsAttention

func (self *TabPage) SetNeedsAttention(needsAttention bool)

SetNeedsAttention sets whether self needs attention.

tabbar will display a line under the tab representing the page if set to TRUE. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.

taboverview will display a dot in the corner of the thumbnail if set to TRUE.

tabbutton will display a dot if any of the pages that aren't selected have tabpage:needs-attention set to TRUE.

The function takes the following parameters:

  • needsAttention: whether self needs attention.

func (*TabPage) SetThumbnailXAlign

func (self *TabPage) SetThumbnailXAlign(xalign float32)

SetThumbnailXAlign sets the horizontal alignment of the thumbnail for self.

If the page is so wide that taboverview can't display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.

The default horizontal alignment is 0.

The function takes the following parameters:

  • xalign: new value.

func (*TabPage) SetThumbnailYAlign

func (self *TabPage) SetThumbnailYAlign(yalign float32)

SetThumbnailYAlign sets the vertical alignment of the thumbnail for self.

If the page is so tall that taboverview can't display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.

The default vertical alignment is 0.

The function takes the following parameters:

  • yalign: new value.

func (*TabPage) SetTitle

func (self *TabPage) SetTitle(title string)

SetTitle: tabbar will display it in the center of the tab unless it's pinned, and will use it as a tooltip unless tabpage:tooltip is set.

taboverview will display it below the thumbnail unless it's pinned, or inside the card otherwise, and will use it as a tooltip unless tabpage:tooltip is set.

Sets the title of self.

The function takes the following parameters:

  • title of self.

func (*TabPage) SetTooltip

func (self *TabPage) SetTooltip(tooltip string)

SetTooltip sets the tooltip of self.

The tooltip can be marked up with the Pango text markup language.

If not set, tabbar and taboverview will use tabpage:title as a tooltip instead.

The function takes the following parameters:

  • tooltip of self.

func (*TabPage) ThumbnailXAlign

func (self *TabPage) ThumbnailXAlign() float32

ThumbnailXAlign gets the horizontal alignment of the thumbnail for self.

The function returns the following values:

  • gfloat: horizontal alignment.

func (*TabPage) ThumbnailYAlign

func (self *TabPage) ThumbnailYAlign() float32

ThumbnailYAlign gets the vertical alignment of the thumbnail for self.

The function returns the following values:

  • gfloat: vertical alignment.

func (*TabPage) Title

func (self *TabPage) Title() string

Title gets the title of self.

The function returns the following values:

  • utf8: title of self.

func (*TabPage) Tooltip

func (self *TabPage) Tooltip() string

Tooltip gets the tooltip of self.

The function returns the following values:

  • utf8 (optional): tooltip of self.

type TabPageClass

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

TabPageClass: instance of this type is always passed by reference.

type TabPageOverrides

type TabPageOverrides struct {
}

TabPageOverrides contains methods that are overridable.

type TabView

type TabView struct {
	gtk.Widget
	// contains filtered or unexported fields
}

TabView: dynamic tabbed container.

AdwTabView is a container which shows one child at a time. While it provides keyboard shortcuts for switching between pages, it does not provide a visible tab switcher and relies on external widgets for that, such as tabbar, taboverview and tabbutton.

AdwTabView maintains a tabpage object for each page, which holds additional per-page properties. You can obtain the AdwTabPage for a page with tabview.GetPage, and as the return value for tabview.Append and other functions for adding children.

AdwTabView only aims to be useful for dynamic tabs in multi-window document-based applications, such as web browsers, file managers, text editors or terminals. It does not aim to replace gtk.Notebook for use cases such as tabbed dialogs.

As such, it does not support disabling page reordering or detaching.

AdwTabView adds a number of global page switching and reordering shortcuts. The tabview:shortcuts property can be used to manage them.

See tabviewshortcuts for the list of the available shortcuts. All of the shortcuts are enabled by default.

tabview.AddShortcuts and tabview.RemoveShortcuts can be used to manage shortcuts in a convenient way, for example:

adw_tab_view_remove_shortcuts (view, ADW_TAB_VIEW_SHORTCUT_CONTROL_HOME |
                                     ADW_TAB_VIEW_SHORTCUT_CONTROL_END);

CSS nodes

AdwTabView has a main CSS node with the name tabview.

Accessibility

AdwTabView uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL for the tab pages which are the accessible parent objects of the child widgets.

func NewTabView

func NewTabView() *TabView

NewTabView creates a new AdwTabView.

The function returns the following values:

  • tabView: newly created AdwTabView.

func (*TabView) AddPage

func (self *TabView) AddPage(child gtk.Widgetter, parent *TabPage) *TabPage

AddPage adds child to self 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 NULL, this function is equivalent to tabview.Append.

The function takes the following parameters:

  • child: widget to add.
  • parent (optional) page for child.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) AddShortcuts

func (self *TabView) AddShortcuts(shortcuts TabViewShortcuts)

AddShortcuts adds shortcuts for self.

See tabview:shortcuts for details.

The function takes the following parameters:

  • shortcuts to add.

func (*TabView) Append

func (self *TabView) Append(child gtk.Widgetter) *TabPage

Append inserts child as the last non-pinned page.

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) AppendPinned

func (self *TabView) AppendPinned(child gtk.Widgetter) *TabPage

AppendPinned inserts child as the last pinned page.

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) CloseOtherPages

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

CloseOtherPages requests to close all pages other than page.

The function takes the following parameters:

  • page of self.

func (*TabView) ClosePage

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

ClosePage requests to close page.

Calling this function will result in the 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 NULL, 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 NULL, 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.

The function takes the following parameters:

  • page of self.

func (*TabView) ClosePageFinish

func (self *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, it 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.

The function takes the following parameters:

  • page of self.
  • confirm: whether to confirm or deny closing page.

func (*TabView) ClosePagesAfter

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

ClosePagesAfter requests to close all pages after page.

The function takes the following parameters:

  • page of self.

func (*TabView) ClosePagesBefore

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

ClosePagesBefore requests to close all pages before page.

The function takes the following parameters:

  • page of self.

func (*TabView) ConnectClosePage

func (self *TabView) ConnectClosePage(f func(page *TabPage) (ok bool)) coreglib.SignalHandle

ConnectClosePage is emitted after tabview.ClosePage has been called for page.

The handler is expected to call tabview.ClosePageFinish to confirm or reject the closing.

The default handler will immediately confirm closing for non-pinned pages, or reject it for pinned pages, equivalent to the following example:

static gboolean
close_page_cb (AdwTabView *view,
               AdwTabPage *page,
               gpointer    user_data)
{
  adw_tab_view_close_page_finish (view, page, !adw_tab_page_get_pinned (page));

  return GDK_EVENT_STOP;
}

The tabview.ClosePageFinish call doesn't have to happen inside the handler, so can be used to do asynchronous checks before confirming the closing.

A typical reason to connect to this signal is to show a confirmation dialog for closing a tab.

func (*TabView) ConnectCreateWindow

func (self *TabView) ConnectCreateWindow(f func() (tabView *TabView)) coreglib.SignalHandle

ConnectCreateWindow is emitted when a tab should be transferred into a new window.

This can happen after a tab has been dropped on desktop.

The signal handler is expected to create a new window, position it as needed and return its AdwTabView that the page will be transferred into.

func (*TabView) ConnectIndicatorActivated

func (self *TabView) ConnectIndicatorActivated(f func(page *TabPage)) coreglib.SignalHandle

ConnectIndicatorActivated is emitted after the indicator icon on page has been activated.

See tabpage:indicator-icon and tabpage:indicator-activatable.

func (*TabView) ConnectPageAttached

func (self *TabView) ConnectPageAttached(f func(page *TabPage, position int)) coreglib.SignalHandle

ConnectPageAttached is emitted when a page has been created or transferred to self.

A typical reason to connect to this signal would be to connect to page signals for things such as updating window title.

func (*TabView) ConnectPageDetached

func (self *TabView) ConnectPageDetached(f func(page *TabPage, position int)) coreglib.SignalHandle

ConnectPageDetached is emitted when a page has been removed or transferred to another view.

A typical reason to connect to this signal would be to disconnect signal handlers connected in the tabview::page-attached handler.

It is important not to try and destroy the page child in the handler of this function as the child might merely be moved to another window; use child dispose handler for that or do it in sync with your tabview.ClosePageFinish calls.

func (*TabView) ConnectPageReordered

func (self *TabView) ConnectPageReordered(f func(page *TabPage, position int)) coreglib.SignalHandle

ConnectPageReordered is emitted after page has been reordered to position.

func (*TabView) ConnectSetupMenu

func (self *TabView) ConnectSetupMenu(f func(page *TabPage)) coreglib.SignalHandle

ConnectSetupMenu is emitted when a context menu is opened or closed for page.

If the menu has been closed, page will be set to NULL.

It can be used to set up menu actions before showing the menu, for example disable actions not applicable to page.

func (*TabView) DefaultIcon

func (self *TabView) DefaultIcon() *gio.Icon

DefaultIcon gets the default icon of self.

The function returns the following values:

  • icon: default icon of self.

func (*TabView) Insert

func (self *TabView) Insert(child gtk.Widgetter, 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.

The function takes the following parameters:

  • child: widget to add.
  • position to add child at, starting from 0.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) InsertPinned

func (self *TabView) InsertPinned(child gtk.Widgetter, 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.

The function takes the following parameters:

  • child: widget to add.
  • position to add child at, starting from 0.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) InvalidateThumbnails

func (self *TabView) InvalidateThumbnails()

InvalidateThumbnails invalidates thumbnails for all pages in self.

This is a convenience method, equivalent to calling tabpage.InvalidateThumbnail on each page.

func (*TabView) IsTransferringPage

func (self *TabView) IsTransferringPage() bool

IsTransferringPage: whether a page is being transferred.

The corresponding property will be set to TRUE when a drag-n-drop tab transfer starts on any AdwTabView, and to FALSE after it ends.

During the transfer, children cannot receive pointer input and a tab can be safely dropped on the tab view.

The function returns the following values:

  • ok: whether a page is being transferred.

func (*TabView) MenuModel

func (self *TabView) MenuModel() gio.MenuModeller

MenuModel gets the tab context menu model for self.

The function returns the following values:

  • menuModel (optional): tab context menu model for self.

func (*TabView) NPages

func (self *TabView) NPages() int

NPages gets the number of pages in self.

The function returns the following values:

  • gint: number of pages in self.

func (*TabView) NPinnedPages

func (self *TabView) NPinnedPages() int

NPinnedPages gets the number of pinned pages in self.

See tabview.SetPagePinned.

The function returns the following values:

  • gint: number of pinned pages in self.

func (*TabView) NthPage

func (self *TabView) NthPage(position int) *TabPage

NthPage gets the tabpage representing the child at position.

The function takes the following parameters:

  • position: index of the page in self, starting from 0.

The function returns the following values:

  • tabPage: page object at position.

func (*TabView) Page

func (self *TabView) Page(child gtk.Widgetter) *TabPage

Page gets the tabpage object representing child.

The function takes the following parameters:

  • child in self.

The function returns the following values:

  • tabPage: page object for child.

func (*TabView) PagePosition

func (self *TabView) PagePosition(page *TabPage) int

PagePosition finds the position of page in self, starting from 0.

The function takes the following parameters:

  • page of self.

The function returns the following values:

  • gint: position of page in self.

func (*TabView) Pages

func (self *TabView) Pages() *gtk.SelectionModel

Pages returns a gio.ListModel that contains the pages of self.

This can be used to keep an up-to-date view. The model also implements gtk.SelectionModel and can be used to track and change the selected page.

The function returns the following values:

  • selectionModel: GtkSelectionModel for the pages of self.

func (*TabView) Prepend

func (self *TabView) Prepend(child gtk.Widgetter) *TabPage

Prepend inserts child as the first non-pinned page.

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) PrependPinned

func (self *TabView) PrependPinned(child gtk.Widgetter) *TabPage

PrependPinned inserts child as the first pinned page.

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • tabPage: page object representing child.

func (*TabView) RemoveShortcuts

func (self *TabView) RemoveShortcuts(shortcuts TabViewShortcuts)

RemoveShortcuts removes shortcuts from self.

See tabview:shortcuts for details.

The function takes the following parameters:

  • shortcuts to reomve.

func (*TabView) ReorderBackward

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

ReorderBackward reorders page to before its previous page if possible.

The function takes the following parameters:

  • page of self.

The function returns the following values:

  • ok: whether page was moved.

func (*TabView) ReorderFirst

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

ReorderFirst reorders page to the first possible position.

The function takes the following parameters:

  • page of self.

The function returns the following values:

  • ok: whether page was moved.

func (*TabView) ReorderForward

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

ReorderForward reorders page to after its next page if possible.

The function takes the following parameters:

  • page of self.

The function returns the following values:

  • ok: whether page was moved.

func (*TabView) ReorderLast

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

ReorderLast reorders page to the last possible position.

The function takes the following parameters:

  • page of self.

The function returns the following values:

  • ok: whether page was moved.

func (*TabView) ReorderPage

func (self *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.

The function takes the following parameters:

  • page of self.
  • position to insert the page at, starting at 0.

The function returns the following values:

  • ok: whether page was moved.

func (*TabView) SelectNextPage

func (self *TabView) SelectNextPage() bool

SelectNextPage selects the page after the currently selected page.

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

The function returns the following values:

  • ok: whether the selected page was changed.

func (*TabView) SelectPreviousPage

func (self *TabView) SelectPreviousPage() bool

SelectPreviousPage selects the page before the currently selected page.

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

The function returns the following values:

  • ok: whether the selected page was changed.

func (*TabView) SelectedPage

func (self *TabView) SelectedPage() *TabPage

SelectedPage gets the currently selected page in self.

The function returns the following values:

  • tabPage (optional): selected page.

func (*TabView) SetDefaultIcon

func (self *TabView) SetDefaultIcon(defaultIcon gio.Iconner)

SetDefaultIcon sets the default page icon for self.

If a page doesn't provide its own icon via tabpage:icon, a 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.

taboverview will use default icon for pages with missing thumbnails.

By default, the adw-tab-icon-missing-symbolic icon is used.

The function takes the following parameters:

  • defaultIcon: default icon.

func (*TabView) SetMenuModel

func (self *TabView) SetMenuModel(menuModel gio.MenuModeller)

SetMenuModel sets the tab context menu model for self.

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

The function takes the following parameters:

  • menuModel (optional): menu model.

func (*TabView) SetPagePinned

func (self *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 self 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

taboverview will not show a thumbnail for pinned pages, and replace the close button with an unpin button. Unlike AdwTabBar, it will still display the page's title, icon and indicator separately.

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

Changes the value of the tabpage:pinned property.

The function takes the following parameters:

  • page of self.
  • pinned: whether page should be pinned.

func (*TabView) SetSelectedPage

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

SetSelectedPage sets the currently selected page in self.

The function takes the following parameters:

  • selectedPage: page in self.

func (*TabView) SetShortcuts

func (self *TabView) SetShortcuts(shortcuts TabViewShortcuts)

SetShortcuts sets the enabled shortcuts for self.

See tabviewshortcuts for the list of the available shortcuts. All of the shortcuts are enabled by default.

tabview.AddShortcuts and tabview.RemoveShortcuts provide a convenient way to manage individual shortcuts.

The function takes the following parameters:

  • shortcuts: new shortcuts.

func (*TabView) Shortcuts

func (self *TabView) Shortcuts() TabViewShortcuts

Shortcuts gets the enabled shortcuts for self.

The function returns the following values:

  • tabViewShortcuts: shortcut mask.

func (*TabView) TransferPage

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

TransferPage transfers page from self 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.

The function takes the following parameters:

  • page of self.
  • otherView: tab view to transfer the page to.
  • position to insert the page at, starting at 0.

type TabViewClass

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

TabViewClass: instance of this type is always passed by reference.

func (*TabViewClass) ParentClass

func (t *TabViewClass) ParentClass() *gtk.WidgetClass

type TabViewOverrides

type TabViewOverrides struct {
}

TabViewOverrides contains methods that are overridable.

type TabViewShortcuts

type TabViewShortcuts C.guint

TabViewShortcuts describes available shortcuts in an tabview.

Shortcuts can be set with tabview:shortcuts, or added/removed individually with tabview.AddShortcuts and tabview.RemoveShortcuts.

New values may be added to this enumeration over time.

const (
	// TabViewShortcutNone: no shortcuts.
	TabViewShortcutNone TabViewShortcuts = 0b0
	// TabViewShortcutControlTab: <kbd>Ctrl</kbd>+<kbd>Tab</kbd> - switch to the
	// next page.
	TabViewShortcutControlTab TabViewShortcuts = 0b1
	// TabViewShortcutControlShiftTab:
	// <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>Tab</kbd> - switch to the previous
	// page.
	TabViewShortcutControlShiftTab TabViewShortcuts = 0b10
	// TabViewShortcutControlPageUp: <kbd>Ctrl</kbd>+<kbd>Page Up</kbd> - switch
	// to the previous page.
	TabViewShortcutControlPageUp TabViewShortcuts = 0b100
	// TabViewShortcutControlPageDown: <kbd>Ctrl</kbd>+<kbd>Page Down</kbd> -
	// switch to the next page.
	TabViewShortcutControlPageDown TabViewShortcuts = 0b1000
	// TabViewShortcutControlHome: <kbd>Ctrl</kbd>+<kbd>Home</kbd> - switch to
	// the first page.
	TabViewShortcutControlHome TabViewShortcuts = 0b10000
	// TabViewShortcutControlEnd: <kbd>Ctrl</kbd>+<kbd>End</kbd> - switch to the
	// last page.
	TabViewShortcutControlEnd TabViewShortcuts = 0b100000
	// TabViewShortcutControlShiftPageUp:
	// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Page Up</kbd> - move the selected
	// page backward.
	TabViewShortcutControlShiftPageUp TabViewShortcuts = 0b1000000
	// TabViewShortcutControlShiftPageDown:
	// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Page Down</kbd> - move the selected
	// page forward.
	TabViewShortcutControlShiftPageDown TabViewShortcuts = 0b10000000
	// TabViewShortcutControlShiftHome:
	// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Home</kbd> - move the selected page
	// at the start.
	TabViewShortcutControlShiftHome TabViewShortcuts = 0b100000000
	// TabViewShortcutControlShiftEnd:
	// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>End</kbd> - move the current page
	// at the end.
	TabViewShortcutControlShiftEnd TabViewShortcuts = 0b1000000000
	// TabViewShortcutAltDigits: <kbd>Alt</kbd>+<kbd>1</kbd>⋯<kbd>9</kbd> -
	// switch to pages 1-9.
	TabViewShortcutAltDigits TabViewShortcuts = 0b10000000000
	// TabViewShortcutAltZero: <kbd>Alt</kbd>+<kbd>0</kbd> - switch to page 10.
	TabViewShortcutAltZero TabViewShortcuts = 0b100000000000
	// TabViewShortcutAllShortcuts: all of the shortcuts.
	TabViewShortcutAllShortcuts TabViewShortcuts = 0b111111111111
)

func (TabViewShortcuts) Has

func (t TabViewShortcuts) Has(other TabViewShortcuts) bool

Has returns true if t contains other.

func (TabViewShortcuts) String

func (t TabViewShortcuts) String() string

String returns the names in string for TabViewShortcuts.

type TimedAnimation

type TimedAnimation struct {
	Animation
	// contains filtered or unexported fields
}

TimedAnimation: time-based animation.

AdwTimedAnimation implements a simple animation interpolating the given value from timedanimation:value-from to timedanimation:value-to over timedanimation:duration milliseconds using the curve described by timedanimation:easing.

If timedanimation:reverse is set to TRUE, AdwTimedAnimation will instead animate from timedanimation:value-to to timedanimation:value-from, and the easing curve will be inverted.

The animation can repeat a certain amount of times, or endlessly, depending on the timedanimation:repeat-count value. If timedanimation:alternate is set to TRUE, it will also change the direction every other iteration.

func NewTimedAnimation

func NewTimedAnimation(widget gtk.Widgetter, from, to float64, duration uint, target AnimationTargetter) *TimedAnimation

NewTimedAnimation creates a new AdwTimedAnimation on widget to animate target from from to to.

The function takes the following parameters:

  • widget to create animation on.
  • from: value to animate from.
  • to: value to animate to.
  • duration for the animation.
  • target value to animate.

The function returns the following values:

  • timedAnimation: newly created animation.

func (*TimedAnimation) Alternate

func (self *TimedAnimation) Alternate() bool

Alternate gets whether self changes direction on every iteration.

The function returns the following values:

  • ok: whether self alternates.

func (*TimedAnimation) Duration

func (self *TimedAnimation) Duration() uint

Duration gets the duration of self.

The function returns the following values:

  • guint: duration of self, in milliseconds.

func (*TimedAnimation) Easing

func (self *TimedAnimation) Easing() Easing

Easing gets the easing function self uses.

The function returns the following values:

  • easing function self uses.

func (*TimedAnimation) RepeatCount

func (self *TimedAnimation) RepeatCount() uint

RepeatCount gets the number of times self will play.

The function returns the following values:

  • guint: number of times self will play.

func (*TimedAnimation) Reverse

func (self *TimedAnimation) Reverse() bool

Reverse gets whether self plays backwards.

The function returns the following values:

  • ok: whether self plays backwards.

func (*TimedAnimation) SetAlternate

func (self *TimedAnimation) SetAlternate(alternate bool)

SetAlternate sets whether self changes direction on every iteration.

The function takes the following parameters:

  • alternate: whether self alternates.

func (*TimedAnimation) SetDuration

func (self *TimedAnimation) SetDuration(duration uint)

SetDuration sets the duration of self.

If the animation repeats more than once, sets the duration of one iteration.

The function takes the following parameters:

  • duration to use, in milliseconds.

func (*TimedAnimation) SetEasing

func (self *TimedAnimation) SetEasing(easing Easing)

SetEasing sets the easing function self will use.

See easing for the description of specific easing functions.

The function takes the following parameters:

  • easing function to use.

func (*TimedAnimation) SetRepeatCount

func (self *TimedAnimation) SetRepeatCount(repeatCount uint)

SetRepeatCount sets the number of times self will play.

If set to 0, self will repeat endlessly.

The function takes the following parameters:

  • repeatCount: number of times self will play.

func (*TimedAnimation) SetReverse

func (self *TimedAnimation) SetReverse(reverse bool)

SetReverse sets whether self plays backwards.

The function takes the following parameters:

  • reverse: whether self plays backwards.

func (*TimedAnimation) SetValueFrom

func (self *TimedAnimation) SetValueFrom(value float64)

SetValueFrom sets the value self will animate from.

The animation will start at this value and end at timedanimation:value-to.

If timedanimation:reverse is TRUE, the animation will end at this value instead.

The function takes the following parameters:

  • value to animate from.

func (*TimedAnimation) SetValueTo

func (self *TimedAnimation) SetValueTo(value float64)

SetValueTo sets the value self will animate to.

The animation will start at timedanimation:value-from and end at this value.

If timedanimation:reverse is TRUE, the animation will start at this value instead.

The function takes the following parameters:

  • value to animate to.

func (*TimedAnimation) ValueFrom

func (self *TimedAnimation) ValueFrom() float64

ValueFrom gets the value self will animate from.

The function returns the following values:

  • gdouble: value to animate from.

func (*TimedAnimation) ValueTo

func (self *TimedAnimation) ValueTo() float64

ValueTo gets the value self will animate to.

The function returns the following values:

  • gdouble: value to animate to.

type Toast

type Toast struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

Toast: helper object for toastoverlay.

Toasts are meant to be passed into toastoverlay.AddToast as follows:

adw_toast_overlay_add_toast (overlay, adw_toast_new (_("Simple Toast")));

<picture> <source srcset="toast-simple-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-simple.png" alt="toast-simple"> </picture>

Toasts always have a close button. They emit the toast::dismissed signal when disappearing.

toast:timeout determines how long the toast stays on screen, while toast:priority determines how it behaves if another toast is already being displayed.

Toast titles use Pango markup by default, set toast:use-markup to FALSE if this is unwanted.

toast:custom-title can be used to replace the title label with a custom widget.

Actions

Toasts can have one button on them, with a label and an attached gio.Action.

AdwToast *toast = adw_toast_new (_("Toast with Action"));

adw_toast_set_button_label (toast, _("_Example"));
adw_toast_set_action_name (toast, "win.example");

adw_toast_overlay_add_toast (overlay, toast);

<picture> <source srcset="toast-action-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-action.png" alt="toast-action"> </picture>

Modifying toasts

Toasts can be modified after they have been shown. For this, an AdwToast reference must be kept around while the toast is visible.

A common use case for this is using toasts as undo prompts that stack with each other, allowing to batch undo the last deleted items:

static void
toast_undo_cb (GtkWidget  *sender,
               const char *action,
               GVariant   *param)
{
  // Undo the deletion
}

static void
dismissed_cb (MyWindow *self)
{
  self->undo_toast = NULL;

  // Permanently delete the items
}

static void
delete_item (MyWindow *self,
             MyItem   *item)
{
  g_autofree char *title = NULL;
  int n_items;

  // Mark the item as waiting for deletion
  n_items = ... // The number of waiting items

  if (!self->undo_toast) {
    self->undo_toast = adw_toast_new_format (_("‘s’ deleted"), ...);

    adw_toast_set_priority (self->undo_toast, ADW_TOAST_PRIORITY_HIGH);
    adw_toast_set_button_label (self->undo_toast, _("_Undo"));
    adw_toast_set_action_name (self->undo_toast, "toast.undo");

    g_signal_connect_swapped (self->undo_toast, "dismissed",
                              G_CALLBACK (dismissed_cb), self);

    adw_toast_overlay_add_toast (self->toast_overlay, self->undo_toast);

    return;
  }

  title =
    g_strdup_printf (ngettext ("<span font_features='tnum=1'>d</span> item deleted",
                               "<span font_features='tnum=1'>d</span> items deleted",
                               n_items), n_items);

  adw_toast_set_title (self->undo_toast, title);

  // Bump the toast timeout
  adw_toast_overlay_add_toast (self->toast_overlay, g_object_ref (self->undo_toast));
}

static void
my_window_class_init (MyWindowClass *klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);

  gtk_widget_class_install_action (widget_class, "toast.undo", NULL, toast_undo_cb);
}

<picture> <source srcset="toast-undo-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-undo.png" alt="toast-undo"> </picture>.

func NewToast

func NewToast(title string) *Toast

NewToast creates a new AdwToast.

The toast will use title as its title.

title can be marked up with the Pango text markup language.

The function takes the following parameters:

  • title to be displayed.

The function returns the following values:

  • toast: new created AdwToast.

func (*Toast) ActionName

func (self *Toast) ActionName() string

ActionName gets the name of the associated action.

The function returns the following values:

  • utf8 (optional): action name.

func (*Toast) ActionTargetValue

func (self *Toast) ActionTargetValue() *glib.Variant

ActionTargetValue gets the parameter for action invocations.

The function returns the following values:

  • variant (optional): action target.

func (*Toast) ButtonLabel

func (self *Toast) ButtonLabel() string

ButtonLabel gets the label to show on the button.

The function returns the following values:

  • utf8 (optional): button label.

func (*Toast) ConnectButtonClicked

func (self *Toast) ConnectButtonClicked(f func()) coreglib.SignalHandle

ConnectButtonClicked is emitted after the button has been clicked.

It can be used as an alternative to setting an action.

func (*Toast) ConnectDismissed

func (self *Toast) ConnectDismissed(f func()) coreglib.SignalHandle

ConnectDismissed is emitted when the toast has been dismissed.

func (*Toast) CustomTitle

func (self *Toast) CustomTitle() gtk.Widgetter

CustomTitle gets the custom title widget of self.

The function returns the following values:

  • widget (optional): custom title widget.

func (*Toast) Dismiss

func (self *Toast) Dismiss()

Dismiss dismisses self.

Does nothing if self has already been dismissed, or hasn't been added to an toastoverlay.

func (*Toast) Priority

func (self *Toast) Priority() ToastPriority

Priority gets priority for self.

The function returns the following values:

  • toastPriority: priority.

func (*Toast) SetActionName

func (self *Toast) SetActionName(actionName string)

SetActionName sets the name of the associated action.

It will be activated when clicking the button.

See toast:action-target.

The function takes the following parameters:

  • actionName (optional): action name.

func (*Toast) SetActionTargetValue

func (self *Toast) SetActionTargetValue(actionTarget *glib.Variant)

SetActionTargetValue sets the parameter for action invocations.

If the action_target variant has a floating reference this function will sink it.

The function takes the following parameters:

  • actionTarget (optional): action target.

func (*Toast) SetButtonLabel

func (self *Toast) SetButtonLabel(buttonLabel string)

SetButtonLabel sets the label to show on the button.

Underlines in the button text can be used to indicate a mnemonic.

If set to NULL, the button won't be shown.

See toast:action-name.

The function takes the following parameters:

  • buttonLabel (optional): button label.

func (*Toast) SetCustomTitle

func (self *Toast) SetCustomTitle(widget gtk.Widgetter)

SetCustomTitle sets the custom title widget of self.

It will be displayed instead of the title if set. In this case, toast:title is ignored.

Setting a custom title will unset toast:title.

The function takes the following parameters:

  • widget (optional): custom title widget.

func (*Toast) SetDetailedActionName

func (self *Toast) SetDetailedActionName(detailedActionName string)

SetDetailedActionName sets the action name and its parameter.

detailed_action_name is a string in the format accepted by gio.Action().ParseDetailedName.

The function takes the following parameters:

  • detailedActionName (optional): detailed action name.

func (*Toast) SetPriority

func (self *Toast) SetPriority(priority ToastPriority)

SetPriority sets priority for self.

Priority controls how the toast behaves when another toast is already being displayed.

If priority is ADW_TOAST_PRIORITY_NORMAL, the toast will be queued.

If priority is ADW_TOAST_PRIORITY_HIGH, the toast will be displayed immediately, pushing the previous toast into the queue instead.

The function takes the following parameters:

  • priority: priority.

func (*Toast) SetTimeout

func (self *Toast) SetTimeout(timeout uint)

SetTimeout sets timeout for self.

If timeout is 0, the toast is displayed indefinitely until manually dismissed.

Toasts cannot disappear while being hovered, pressed (on touchscreen), or have keyboard focus inside them.

The function takes the following parameters:

  • timeout: timeout.

func (*Toast) SetTitle

func (self *Toast) SetTitle(title string)

SetTitle sets the title that will be displayed on the toast.

The title can be marked up with the Pango text markup language.

Setting a title will unset toast:custom-title.

If toast:custom-title is set, it will be used instead.

The function takes the following parameters:

  • title: title.

func (*Toast) SetUseMarkup

func (self *Toast) SetUseMarkup(useMarkup bool)

SetUseMarkup: whether to use Pango markup for the toast title.

See also pango.ParseMarkup().

The function takes the following parameters:

  • useMarkup: whether to use markup.

func (*Toast) Timeout

func (self *Toast) Timeout() uint

Timeout gets timeout for self.

The function returns the following values:

  • guint: timeout.

func (*Toast) Title

func (self *Toast) Title() string

Title gets the title that will be displayed on the toast.

If a custom title has been set with adw.Toast.SetCustomTitle() the return value will be NULL.

The function returns the following values:

  • utf8 (optional): title.

func (*Toast) UseMarkup

func (self *Toast) UseMarkup() bool

UseMarkup gets whether to use Pango markup for the toast title.

The function returns the following values:

  • ok: whether the toast uses markup.

type ToastClass

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

ToastClass: instance of this type is always passed by reference.

type ToastOverlay

type ToastOverlay struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ToastOverlay: widget showing toasts above its content.

<picture> <source srcset="toast-overlay-dark.png" media="(prefers-color-scheme: dark)"> <img src="toast-overlay.png" alt="toast-overlay"> </picture>

Much like gtk.Overlay, AdwToastOverlay is a container with a single main child, on top of which it can display a toast, overlaid. Toasts can be shown with toastoverlay.AddToast.

See toast for details.

CSS nodes

toastoverlay
├── [child]
├── toast
┊   ├── widget
┊   │   ├── [label.heading]
    │   ╰── [custom title]
    ├── [button]
    ╰── button.circular.flat

AdwToastOverlay's CSS node is called toastoverlay. It contains the child, as well as zero or more toast subnodes.

Each of the toast nodes contains a widget subnode, optionally a button subnode, and another button subnode with .circular and .flat style classes.

The widget subnode contains a label subnode with the .heading style class, or a custom widget provided by the application.

Accessibility

AdwToastOverlay uses the GTK_ACCESSIBLE_ROLE_TAB_GROUP role.

func NewToastOverlay

func NewToastOverlay() *ToastOverlay

NewToastOverlay creates a new AdwToastOverlay.

The function returns the following values:

  • toastOverlay: new created AdwToastOverlay.

func (*ToastOverlay) AddToast

func (self *ToastOverlay) AddToast(toast *Toast)

AddToast displays toast.

Only one toast can be shown at a time; if a toast is already being displayed, either toast or the original toast will be placed in a queue, depending on the priority of toast. See toast:priority.

If called on a toast that's already displayed, its timeout will be reset.

If called on a toast currently in the queue, the toast will be bumped forward to be shown as soon as possible.

The function takes the following parameters:

  • toast: toast.

func (*ToastOverlay) Child

func (self *ToastOverlay) Child() gtk.Widgetter

Child gets the child widget of self.

The function returns the following values:

  • widget (optional): child widget of self.

func (*ToastOverlay) SetChild

func (self *ToastOverlay) SetChild(child gtk.Widgetter)

SetChild sets the child widget of self.

The function takes the following parameters:

  • child (optional) widget.

type ToastOverlayClass

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

ToastOverlayClass: instance of this type is always passed by reference.

func (*ToastOverlayClass) ParentClass

func (t *ToastOverlayClass) ParentClass() *gtk.WidgetClass

type ToastOverlayOverrides

type ToastOverlayOverrides struct {
}

ToastOverlayOverrides contains methods that are overridable.

type ToastOverrides

type ToastOverrides struct {
}

ToastOverrides contains methods that are overridable.

type ToastPriority

type ToastPriority C.gint

ToastPriority: toast behavior when another toast is already displayed.

const (
	// ToastPriorityNormal: toast will be queued if another toast is already
	// displayed.
	ToastPriorityNormal ToastPriority = iota
	// ToastPriorityHigh: toast will be displayed immediately, pushing the
	// previous toast into the queue instead.
	ToastPriorityHigh
)

func (ToastPriority) String

func (t ToastPriority) String() string

String returns the name in string for ToastPriority.

type ToolbarStyle

type ToolbarStyle C.gint

ToolbarStyle describes the possible top or bottom bar styles in an toolbarview widget.

ADW_TOOLBAR_FLAT is suitable for simple content, such as statuspage or preferencespage, where the background at the top and bottom parts of the page is uniform. Additionally, windows with sidebars should always use this style.

<picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1"> </picture> <picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2"> </picture>

ADW_TOOLBAR_RAISED style is suitable for content such as utility panes (https://developer.gnome.org/hig/patterns/containers/utility-panes.html), where some elements are directly adjacent to the top/bottom bars, or tabview, where each page can have a different background.

ADW_TOOLBAR_RAISED_BORDER style is similar to ADW_TOOLBAR_RAISED, but with the shadow replaced with a more subtle border. It's intended to be used in applications like image viewers, where a shadow over the content might be undesired.

<picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-raised.png" alt="toolbar-view-raised"> </picture> <picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-raised-border-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-raised-border.png" alt="toolbar-view-raised-border"> </picture>

See toolbarview:top-bar-style and toolbarview:bottom-bar-style.

New values may be added to this enumeration over time.

const (
	// ToolbarFlat: no background, shadow only for scrolled content.
	ToolbarFlat ToolbarStyle = iota
	// ToolbarRaised: opaque background with a persistent shadow.
	ToolbarRaised
	// ToolbarRaisedBorder: opaque background with a persistent border.
	ToolbarRaisedBorder
)

func (ToolbarStyle) String

func (t ToolbarStyle) String() string

String returns the name in string for ToolbarStyle.

type ToolbarView

type ToolbarView struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ToolbarView: widget containing a page, as well as top and/or bottom bars.

<picture> <source srcset="toolbar-view-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view.png" alt="toolbar-view"> </picture>

AdwToolbarView has a single content widget and one or multiple top and bottom bars, shown at the top and bottom sides respectively.

Example of an AdwToolbarView UI definition:

<object class="AdwToolbarView">
  <child type="top">
    <object class="AdwHeaderBar"/>
  </child>
  <property name="content">
    <object class="AdwPreferencesPage">
      <!-- ... -->
    </object>
  </property>
</object>

The following kinds of top and bottom bars are supported:

- headerbar

- tabbar

- viewswitcherbar

- gtk.ActionBar

- gtk.HeaderBar

- gtk.PopoverMenuBar

- gtk.SearchBar

- Any gtk.Box or a similar widget with the .toolbar (style-classes.html#toolbars) style class

By default, top and bottom bars are flat and scrolling content has a subtle undershoot shadow, same as when using the .undershoot-top (style-classes.html#undershot-indicators) and .undershoot-bottom (style-classes.html#undershot-indicators) style classes. This works well in most cases, e.g. with statuspage or preferencespage, where the background at the top and bottom parts of the page is uniform. Additionally, windows with sidebars should always use this style.

toolbarview:top-bar-style and toolbarview:bottom-bar-style properties can be used add an opaque background and a persistent shadow to top and bottom bars, this can be useful for content such as utility panes (https://developer.gnome.org/hig/patterns/containers/utility-panes.html), where some elements are adjacent to the top/bottom bars, or tabview, where each page can have a different background.

<picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-flat-1-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-flat-1.png" alt="toolbar-view-flat-1"> </picture> <picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-flat-2-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-flat-2.png" alt="toolbar-view-flat-2"> </picture> <picture style="min-width: 33%; display: inline-block;"> <source srcset="toolbar-view-raised-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-raised.png" alt="toolbar-view-raised"> </picture>

AdwToolbarView ensures the top and bottom bars have consistent backdrop styles and vertical spacing. For comparison:

<picture style="min-width: 40%; display: inline-block;"> <source srcset="toolbar-view-spacing-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-spacing.png" alt="toolbar-view-spacing"> </picture> <picture style="min-width: 40%; display: inline-block;"> <source srcset="toolbar-view-spacing-box-dark.png" media="(prefers-color-scheme: dark)"> <img src="toolbar-view-spacing-box.png" alt="toolbar-view-spacing-box"> </picture>

Any top and bottom bars can also be dragged to move the window, equivalent to putting them into a gtk.WindowHandle.

Content is typically place between top and bottom bars, but can also extend behind them. This is controlled with the toolbarview:extend-content-to-top-edge and toolbarview:extend-content-to-bottom-edge properties.

Top and bottom bars can be hidden and revealed with an animation using the toolbarview:reveal-top-bars and toolbarview:reveal-bottom-bars properties.

AdwToolbarView as GtkBuildable

The AdwToolbarView implementation of the gtk.Buildable interface supports adding a top bar by specifying “top” as the “type” attribute of a <child> element, or adding a bottom bar by specifying “bottom”.

Accessibility

AdwToolbarView uses the GTK_ACCESSIBLE_ROLE_GROUP role.

func NewToolbarView

func NewToolbarView() *ToolbarView

NewToolbarView creates a new AdwToolbarView.

The function returns the following values:

  • toolbarView: newly created AdwToolbarView.

func (*ToolbarView) AddBottomBar

func (self *ToolbarView) AddBottomBar(widget gtk.Widgetter)

AddBottomBar adds a bottom bar to self.

The function takes the following parameters:

  • widget: widget.

func (*ToolbarView) AddTopBar

func (self *ToolbarView) AddTopBar(widget gtk.Widgetter)

AddTopBar adds a top bar to self.

The function takes the following parameters:

  • widget: widget.

func (*ToolbarView) BottomBarHeight

func (self *ToolbarView) BottomBarHeight() int

BottomBarHeight gets the current bottom bar height for self.

Bottom bar height does change depending on toolbarview:reveal-bottom-bars, including during the transition.

See toolbarview.GetTopBarHeight.

The function returns the following values:

  • gint: current bottom bar height.

func (*ToolbarView) BottomBarStyle

func (self *ToolbarView) BottomBarStyle() ToolbarStyle

BottomBarStyle gets appearance of the botom bars for self.

The function returns the following values:

  • toolbarStyle: bottom bar style.

func (*ToolbarView) Content

func (self *ToolbarView) Content() gtk.Widgetter

Content gets the content widget for self.

The function returns the following values:

  • widget (optional): content widget.

func (*ToolbarView) ExtendContentToBottomEdge

func (self *ToolbarView) ExtendContentToBottomEdge() bool

ExtendContentToBottomEdge gets whether the content widget can extend behind bottom bars.

The function returns the following values:

  • ok: whether content extends behind bottom bars.

func (*ToolbarView) ExtendContentToTopEdge

func (self *ToolbarView) ExtendContentToTopEdge() bool

ExtendContentToTopEdge gets whether the content widget can extend behind top bars.

The function returns the following values:

  • ok: whether content extends behind top bars.

func (*ToolbarView) Remove

func (self *ToolbarView) Remove(widget gtk.Widgetter)

Remove removes a child from self.

The function takes the following parameters:

  • widget: child to be removed.

func (*ToolbarView) RevealBottomBars

func (self *ToolbarView) RevealBottomBars() bool

RevealBottomBars gets whether bottom bars are revealed for self.

The function returns the following values:

  • ok: whether bottom bars are revealed.

func (*ToolbarView) RevealTopBars

func (self *ToolbarView) RevealTopBars() bool

RevealTopBars gets whether top bars are revealed for self.

The function returns the following values:

  • ok: whether top bars are revealed.

func (*ToolbarView) SetBottomBarStyle

func (self *ToolbarView) SetBottomBarStyle(style ToolbarStyle)

SetBottomBarStyle sets appearance of the bottom bars for self.

If set to ADW_TOOLBAR_FLAT, bottom bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the .undershoot-bottom (style-classes.html#undershot-indicators) style class. This works well for simple content, e.g. statuspage or preferencespage, where the background at the bottom of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a bottom bar is actually present and visible. It is also never present if toolbarview:extend-content-to-bottom-edge is set to TRUE.

If set to ADW_TOOLBAR_RAISED, bottom bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes (https://developer.gnome.org/hig/patterns/containers/utility-panes.html), where some elements are directly adjacent to the bottom bars, or tabview, where each page can have a different background.

ADW_TOOLBAR_RAISED_BORDER is similar to ADW_TOOLBAR_RAISED, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also toolbarview.SetTopBarStyle.

The function takes the following parameters:

  • style: bottom bar style.

func (*ToolbarView) SetContent

func (self *ToolbarView) SetContent(content gtk.Widgetter)

SetContent sets the content widget for self.

The function takes the following parameters:

  • content (optional) widget.

func (*ToolbarView) SetExtendContentToBottomEdge

func (self *ToolbarView) SetExtendContentToBottomEdge(extend bool)

SetExtendContentToBottomEdge sets whether the content widget can extend behind bottom bars.

This can be used in combination with toolbarview:reveal-bottom-bars to show and hide toolbars in fullscreen.

See toolbarview.SetExtendContentToTopEdge.

The function takes the following parameters:

  • extend: whether content extends behind bottom bars.

func (*ToolbarView) SetExtendContentToTopEdge

func (self *ToolbarView) SetExtendContentToTopEdge(extend bool)

SetExtendContentToTopEdge sets whether the content widget can extend behind top bars.

This can be used in combination with toolbarview:reveal-top-bars to show and hide toolbars in fullscreen.

See toolbarview.SetExtendContentToBottomEdge.

The function takes the following parameters:

  • extend: whether content extends behind top bars.

func (*ToolbarView) SetRevealBottomBars

func (self *ToolbarView) SetRevealBottomBars(reveal bool)

SetRevealBottomBars sets whether bottom bars are revealed for self.

The transition will be animated.

This can be used in combination with toolbarview:extend-content-to-bottom-edge to show and hide toolbars in fullscreen.

See toolbarview.SetRevealTopBars.

The function takes the following parameters:

  • reveal: whether to reveal bottom bars.

func (*ToolbarView) SetRevealTopBars

func (self *ToolbarView) SetRevealTopBars(reveal bool)

SetRevealTopBars sets whether top bars are revealed for self.

The transition will be animated.

This can be used in combination with toolbarview:extend-content-to-top-edge to show and hide toolbars in fullscreen.

See toolbarview.SetRevealBottomBars.

The function takes the following parameters:

  • reveal: whether to reveal top bars.

func (*ToolbarView) SetTopBarStyle

func (self *ToolbarView) SetTopBarStyle(style ToolbarStyle)

SetTopBarStyle sets appearance of the top bars for self.

If set to ADW_TOOLBAR_FLAT, top bars are flat and scrolling content has a subtle undershoot shadow when touching them, same as the .undershoot-top (style-classes.html#undershot-indicators) style class. This works well for simple content, e.g. statuspage or preferencespage, where the background at the top of the page is uniform. Additionally, windows with sidebars should always use this style.

Undershoot shadow is only present if a top bar is actually present and visible. It is also never present if toolbarview:extend-content-to-top-edge is set to TRUE.

If set to ADW_TOOLBAR_RAISED, top bars have an opaque background and a persistent shadow, this is suitable for content such as utility panes (https://developer.gnome.org/hig/patterns/containers/utility-panes.html), where some elements are directly adjacent to the top bars, or tabview, where each page can have a different background.

ADW_TOOLBAR_RAISED_BORDER is similar to ADW_TOOLBAR_RAISED, but the shadow is replaced with a more subtle border. This can be useful for applications like image viewers.

See also toolbarview.SetBottomBarStyle.

The function takes the following parameters:

  • style: top bar style.

func (*ToolbarView) TopBarHeight

func (self *ToolbarView) TopBarHeight() int

TopBarHeight gets the current top bar height for self.

Top bar height does change depending on toolbarview:reveal-top-bars, including during the transition.

See toolbarview.GetBottomBarHeight.

The function returns the following values:

  • gint: current top bar height.

func (*ToolbarView) TopBarStyle

func (self *ToolbarView) TopBarStyle() ToolbarStyle

TopBarStyle gets appearance of the top bars for self.

The function returns the following values:

  • toolbarStyle: top bar style.

type ToolbarViewClass

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

ToolbarViewClass: instance of this type is always passed by reference.

func (*ToolbarViewClass) ParentClass

func (t *ToolbarViewClass) ParentClass() *gtk.WidgetClass

type ToolbarViewOverrides

type ToolbarViewOverrides struct {
}

ToolbarViewOverrides contains methods that are overridable.

type ViewStack

type ViewStack struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ViewStack: view container for viewswitcher.

AdwViewStack is a container which only shows one page at a time. It is typically used to hold an application's main views.

It doesn't provide a way to transition between pages. Instead, a separate widget such as viewswitcher can be used with AdwViewStack to provide this functionality.

AdwViewStack pages can have a title, an icon, an attention request, and a numbered badge that viewswitcher will use to let users identify which page is which. Set them using the viewstackpage:title, viewstackpage:icon-name, viewstackpage:needs-attention, and viewstackpage:badge-number properties.

Unlike gtk.Stack, transitions between views are not animated.

AdwViewStack maintains a viewstackpage object for each added child, which holds additional per-child properties. You obtain the viewstackpage for a child with viewstack.GetPage and you can obtain a gtk.SelectionModel containing all the pages with viewstack.GetPages.

AdwViewStack as GtkBuildable

To set child-specific properties in a .ui file, create viewstackpage objects explicitly, and set the child widget as a property on it:

<object class="AdwViewStack" id="stack">
  <child>
    <object class="AdwViewStackPage">
      <property name="name">overview</property>
      <property name="title">Overview</property>
      <property name="child">
        <object class="AdwStatusPage">
          <property name="title">Welcome!</property>
        </object>
      </property>
    </object>
  </child>
</object>

CSS nodes

AdwViewStack has a single CSS node named stack.

Accessibility

AdwViewStack uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL for the stack pages which are the accessible parent objects of the child widgets.

func NewViewStack

func NewViewStack() *ViewStack

NewViewStack creates a new AdwViewStack.

The function returns the following values:

  • viewStack: newly created AdwViewStack.

func (*ViewStack) Add

func (self *ViewStack) Add(child gtk.Widgetter) *ViewStackPage

Add adds a child to self.

The function takes the following parameters:

  • child: widget to add.

The function returns the following values:

  • viewStackPage: viewstackpage for child.

func (*ViewStack) AddNamed

func (self *ViewStack) AddNamed(child gtk.Widgetter, name string) *ViewStackPage

AddNamed adds a child to self.

The child is identified by the name.

The function takes the following parameters:

  • child: widget to add.
  • name (optional) for child.

The function returns the following values:

  • viewStackPage: AdwViewStackPage for child.

func (*ViewStack) AddTitled

func (self *ViewStack) AddTitled(child gtk.Widgetter, name, title string) *ViewStackPage

AddTitled adds a child to self.

The child is identified by the name. The title will be used by viewswitcher to represent child, so it should be short.

The function takes the following parameters:

  • child: widget to add.
  • name (optional) for child.
  • title: human-readable title for child.

The function returns the following values:

  • viewStackPage: AdwViewStackPage for child.

func (*ViewStack) AddTitledWithIcon

func (self *ViewStack) AddTitledWithIcon(child gtk.Widgetter, name, title, iconName string) *ViewStackPage

AddTitledWithIcon adds a child to self.

The child is identified by the name. The title and icon_name will be used by viewswitcher to represent child.

The function takes the following parameters:

  • child: widget to add.
  • name (optional) for child.
  • title: human-readable title for child.
  • iconName: icon name for child.

The function returns the following values:

  • viewStackPage: AdwViewStackPage for child.

func (*ViewStack) ChildByName

func (self *ViewStack) ChildByName(name string) gtk.Widgetter

ChildByName finds the child with name in self.

The function takes the following parameters:

  • name of the child to find.

The function returns the following values:

  • widget (optional): requested child.

func (*ViewStack) Hhomogeneous

func (self *ViewStack) Hhomogeneous() bool

Hhomogeneous gets whether self is horizontally homogeneous.

The function returns the following values:

  • ok: whether self is horizontally homogeneous.

func (*ViewStack) Page

func (self *ViewStack) Page(child gtk.Widgetter) *ViewStackPage

Page gets the viewstackpage object for child.

The function takes the following parameters:

  • child of self.

The function returns the following values:

  • viewStackPage: page object for child.

func (*ViewStack) Pages

func (self *ViewStack) Pages() *gtk.SelectionModel

Pages returns a gio.ListModel that contains the pages of the stack.

This can be used to keep an up-to-date view. The model also implements gtk.SelectionModel and can be used to track and change the visible page.

The function returns the following values:

  • selectionModel: GtkSelectionModel for the stack's children.

func (*ViewStack) Remove

func (self *ViewStack) Remove(child gtk.Widgetter)

Remove removes a child widget from self.

The function takes the following parameters:

  • child to remove.

func (*ViewStack) SetHhomogeneous

func (self *ViewStack) SetHhomogeneous(hhomogeneous bool)

SetHhomogeneous sets self to be horizontally homogeneous or not.

If the stack is horizontally homogeneous, it allocates the same width for all children.

If it's FALSE, the stack may change width when a different child becomes visible.

The function takes the following parameters:

  • hhomogeneous: whether to make self horizontally homogeneous.

func (*ViewStack) SetVhomogeneous

func (self *ViewStack) SetVhomogeneous(vhomogeneous bool)

SetVhomogeneous sets self to be vertically homogeneous or not.

If the stack is vertically homogeneous, it allocates the same height for all children.

If it's FALSE, the stack may change height when a different child becomes visible.

The function takes the following parameters:

  • vhomogeneous: whether to make self vertically homogeneous.

func (*ViewStack) SetVisibleChild

func (self *ViewStack) SetVisibleChild(child gtk.Widgetter)

SetVisibleChild makes child the visible child of self.

The function takes the following parameters:

  • child of self.

func (*ViewStack) SetVisibleChildName

func (self *ViewStack) SetVisibleChildName(name string)

SetVisibleChildName makes the child with name visible.

See viewstack:visible-child.

The function takes the following parameters:

  • name of the child.

func (*ViewStack) Vhomogeneous

func (self *ViewStack) Vhomogeneous() bool

Vhomogeneous gets whether self is vertically homogeneous.

The function returns the following values:

  • ok: whether self is vertically homogeneous.

func (*ViewStack) VisibleChild

func (self *ViewStack) VisibleChild() gtk.Widgetter

VisibleChild gets the currently visible child of self, .

The function returns the following values:

  • widget (optional): visible child.

func (*ViewStack) VisibleChildName

func (self *ViewStack) VisibleChildName() string

VisibleChildName returns the name of the currently visible child of self.

The function returns the following values:

  • utf8 (optional): name of the visible child.

type ViewStackClass

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

ViewStackClass: instance of this type is always passed by reference.

func (*ViewStackClass) ParentClass

func (v *ViewStackClass) ParentClass() *gtk.WidgetClass

type ViewStackOverrides

type ViewStackOverrides struct {
}

ViewStackOverrides contains methods that are overridable.

type ViewStackPage

type ViewStackPage struct {
	*coreglib.Object

	gtk.Accessible
	// contains filtered or unexported fields
}

ViewStackPage: auxiliary class used by viewstack.

func (*ViewStackPage) BadgeNumber

func (self *ViewStackPage) BadgeNumber() uint

BadgeNumber gets the badge number for this page.

The function returns the following values:

  • guint: badge number for this page.

func (*ViewStackPage) Child

func (self *ViewStackPage) Child() gtk.Widgetter

Child gets the stack child to which self belongs.

The function returns the following values:

  • widget: child to which self belongs.

func (*ViewStackPage) IconName

func (self *ViewStackPage) IconName() string

IconName gets the icon name of the page.

The function returns the following values:

  • utf8 (optional): icon name of the page.

func (*ViewStackPage) Name

func (self *ViewStackPage) Name() string

Name gets the name of the page.

The function returns the following values:

  • utf8 (optional): name of the page.

func (*ViewStackPage) NeedsAttention

func (self *ViewStackPage) NeedsAttention() bool

NeedsAttention gets whether the page requires the user attention.

The function returns the following values:

  • ok: whether the page needs attention.

func (*ViewStackPage) SetBadgeNumber

func (self *ViewStackPage) SetBadgeNumber(badgeNumber uint)

SetBadgeNumber sets the badge number for this page.

viewswitcher can display it as a badge next to the page icon. It is commonly used to display a number of unread items within the page.

It can be used together with viewstack{age}:needs-attention.

The function takes the following parameters:

  • badgeNumber: new value to set.

func (*ViewStackPage) SetIconName

func (self *ViewStackPage) SetIconName(iconName string)

SetIconName sets the icon name of the page.

The function takes the following parameters:

  • iconName (optional): icon name.

func (*ViewStackPage) SetName

func (self *ViewStackPage) SetName(name string)

SetName sets the name of the page.

The function takes the following parameters:

  • name (optional): page name.

func (*ViewStackPage) SetNeedsAttention

func (self *ViewStackPage) SetNeedsAttention(needsAttention bool)

SetNeedsAttention sets whether the page requires the user attention.

viewswitcher will display it as a dot next to the page icon.

The function takes the following parameters:

  • needsAttention: new value to set.

func (*ViewStackPage) SetTitle

func (self *ViewStackPage) SetTitle(title string)

SetTitle sets the page title.

The function takes the following parameters:

  • title (optional): page title.

func (*ViewStackPage) SetUseUnderline

func (self *ViewStackPage) SetUseUnderline(useUnderline bool)

SetUseUnderline sets whether underlines in the page title indicate mnemonics.

The function takes the following parameters:

  • useUnderline: new value to set.

func (*ViewStackPage) SetVisible

func (self *ViewStackPage) SetVisible(visible bool)

SetVisible sets whether page is visible in its AdwViewStack.

This is independent from the gtk.Widget:visible property of viewstackpage:child.

The function takes the following parameters:

  • visible: whether self is visible.

func (*ViewStackPage) Title

func (self *ViewStackPage) Title() string

Title gets the page title.

The function returns the following values:

  • utf8 (optional): page title.

func (*ViewStackPage) UseUnderline

func (self *ViewStackPage) UseUnderline() bool

UseUnderline gets whether underlines in the page title indicate mnemonics.

The function returns the following values:

  • ok: whether underlines in the page title indicate mnemonics.

func (*ViewStackPage) Visible

func (self *ViewStackPage) Visible() bool

Visible gets whether self is visible in its AdwViewStack.

This is independent from the gtk.Widget:visible property of its widget.

The function returns the following values:

  • ok: whether self is visible.

type ViewStackPageClass

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

ViewStackPageClass: instance of this type is always passed by reference.

type ViewStackPageOverrides

type ViewStackPageOverrides struct {
}

ViewStackPageOverrides contains methods that are overridable.

type ViewStackPages

type ViewStackPages struct {
	*coreglib.Object

	gtk.SelectionModel
	// contains filtered or unexported fields
}

ViewStackPages: auxiliary class used by viewstack.

See viewstack:pages.

func (*ViewStackPages) SelectedPage

func (self *ViewStackPages) SelectedPage() *ViewStackPage

SelectedPage gets the viewstackpage for the visible child of a view stack

Gets the viewstackpage for the visible child of the associated stack.

Returns NULL if there's no selected page.

The function returns the following values:

  • viewStackPage (optional): stack page.

func (*ViewStackPages) SetSelectedPage

func (self *ViewStackPages) SetSelectedPage(page *ViewStackPage)

SetSelectedPage sets the visible child in the associated viewstack.

See viewstack:visible-child.

The function takes the following parameters:

  • page: stack page within the associated stack.

type ViewStackPagesClass

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

ViewStackPagesClass: instance of this type is always passed by reference.

type ViewStackPagesOverrides

type ViewStackPagesOverrides struct {
}

ViewStackPagesOverrides contains methods that are overridable.

type ViewSwitcher

type ViewSwitcher struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ViewSwitcher: adaptive view switcher.

<picture> <source srcset="view-switcher-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher.png" alt="view-switcher"> </picture>

An adaptive view switcher designed to switch between multiple views contained in a viewstack in a similar fashion to gtk.StackSwitcher.

AdwViewSwitcher buttons always have an icon and a label. They can be displayed side by side, or icon on top of the label. This can be controlled via the viewswitcher:policy property.

AdwViewSwitcher is intended to be used in a header bar together with viewswitcherbar at the bottom of the window, and a breakpoint showing the view switcher bar on narrow sizes, while removing the view switcher from the header bar, as follows:

<object class="AdwWindow">
  <property name="width-request">360</property>
  <property name="height-request">200</property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 550sp</condition>
      <setter object="switcher_bar" property="reveal">True</setter>
      <setter object="header_bar" property="title-widget"/>
    </object>
  </child>
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar" id="header_bar">
          <property name="title-widget">
            <object class="AdwViewSwitcher">
              <property name="stack">stack</property>
              <property name="policy">wide</property>
            </object>
          </property>
        </object>
      </child>
      <property name="content">
        <object class="AdwViewStack" id="stack"/>
      </property>
      <child type="bottom">
        <object class="AdwViewSwitcherBar" id="switcher_bar">
          <property name="stack">stack</property>
        </object>
      </child>
    </object>
  </property>
</object>

It's recommended to set viewswitcher:policy to ADW_VIEW_SWITCHER_POLICY_WIDE in this case.

You may have to adjust the breakpoint condition for your specific pages.

CSS nodes

AdwViewSwitcher has a single CSS node with name viewswitcher. It can have the style classes .wide and .narrow, matching its policy.

Accessibility

AdwViewSwitcher uses the GTK_ACCESSIBLE_ROLE_TAB_LIST role and uses the GTK_ACCESSIBLE_ROLE_TAB for its buttons.

func NewViewSwitcher

func NewViewSwitcher() *ViewSwitcher

NewViewSwitcher creates a new AdwViewSwitcher.

The function returns the following values:

  • viewSwitcher: newly created AdwViewSwitcher.

func (*ViewSwitcher) Policy

func (self *ViewSwitcher) Policy() ViewSwitcherPolicy

Policy gets the policy of self.

The function returns the following values:

  • viewSwitcherPolicy: policy of self.

func (*ViewSwitcher) SetPolicy

func (self *ViewSwitcher) SetPolicy(policy ViewSwitcherPolicy)

SetPolicy sets the policy of self.

The function takes the following parameters:

  • policy: new policy.

func (*ViewSwitcher) SetStack

func (self *ViewSwitcher) SetStack(stack *ViewStack)

SetStack sets the stack controlled by self.

The function takes the following parameters:

  • stack (optional): stack.

func (*ViewSwitcher) Stack

func (self *ViewSwitcher) Stack() *ViewStack

Stack gets the stack controlled by self.

The function returns the following values:

  • viewStack (optional): stack.

type ViewSwitcherBar

type ViewSwitcherBar struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ViewSwitcherBar: view switcher action bar.

<picture> <source srcset="view-switcher-bar-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher-bar.png" alt="view-switcher-bar"> </picture>

An action bar letting you switch between multiple views contained in a viewstack, via an viewswitcher. It is designed to be put at the bottom of a window and to be revealed only on really narrow windows, e.g. on mobile phones. It can't be revealed if there are less than two pages.

AdwViewSwitcherBar is intended to be used together with AdwViewSwitcher in a header bar, and a breakpoint showing the view switcher bar on narrow sizes, while removing the view switcher from the header bar, as follows:

<object class="AdwWindow">
  <property name="width-request">360</property>
  <property name="height-request">200</property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 550sp</condition>
      <setter object="switcher_bar" property="reveal">True</setter>
      <setter object="header_bar" property="title-widget"/>
    </object>
  </child>
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar" id="header_bar">
          <property name="title-widget">
            <object class="AdwViewSwitcher">
              <property name="stack">stack</property>
              <property name="policy">wide</property>
            </object>
          </property>
        </object>
      </child>
      <property name="content">
        <object class="AdwViewStack" id="stack"/>
      </property>
      <child type="bottom">
        <object class="AdwViewSwitcherBar" id="switcher_bar">
          <property name="stack">stack</property>
        </object>
      </child>
    </object>
  </property>
</object>

It's recommended to set viewswitcher:policy to ADW_VIEW_SWITCHER_POLICY_WIDE in this case.

You may have to adjust the breakpoint condition for your specific pages.

CSS nodes

AdwViewSwitcherBar has a single CSS node with name viewswitcherbar.

func NewViewSwitcherBar

func NewViewSwitcherBar() *ViewSwitcherBar

NewViewSwitcherBar creates a new AdwViewSwitcherBar.

The function returns the following values:

  • viewSwitcherBar: newly created AdwViewSwitcherBar.

func (*ViewSwitcherBar) Reveal

func (self *ViewSwitcherBar) Reveal() bool

Reveal gets whether self should be revealed or hidden.

The function returns the following values:

  • ok: whether self is revealed.

func (*ViewSwitcherBar) SetReveal

func (self *ViewSwitcherBar) SetReveal(reveal bool)

SetReveal sets whether self should be revealed or hidden.

The function takes the following parameters:

  • reveal: whether to reveal self.

func (*ViewSwitcherBar) SetStack

func (self *ViewSwitcherBar) SetStack(stack *ViewStack)

SetStack sets the stack controlled by self.

The function takes the following parameters:

  • stack (optional): stack.

func (*ViewSwitcherBar) Stack

func (self *ViewSwitcherBar) Stack() *ViewStack

Stack gets the stack controlled by self.

The function returns the following values:

  • viewStack (optional): stack.

type ViewSwitcherBarClass

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

ViewSwitcherBarClass: instance of this type is always passed by reference.

func (*ViewSwitcherBarClass) ParentClass

func (v *ViewSwitcherBarClass) ParentClass() *gtk.WidgetClass

type ViewSwitcherBarOverrides

type ViewSwitcherBarOverrides struct {
}

ViewSwitcherBarOverrides contains methods that are overridable.

type ViewSwitcherClass

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

ViewSwitcherClass: instance of this type is always passed by reference.

func (*ViewSwitcherClass) ParentClass

func (v *ViewSwitcherClass) ParentClass() *gtk.WidgetClass

type ViewSwitcherOverrides

type ViewSwitcherOverrides struct {
}

ViewSwitcherOverrides contains methods that are overridable.

type ViewSwitcherPolicy

type ViewSwitcherPolicy C.gint

ViewSwitcherPolicy describes the adaptive modes of viewswitcher.

const (
	// ViewSwitcherPolicyNarrow: force the narrow mode.
	ViewSwitcherPolicyNarrow ViewSwitcherPolicy = iota
	// ViewSwitcherPolicyWide: force the wide mode.
	ViewSwitcherPolicyWide
)

func (ViewSwitcherPolicy) String

func (v ViewSwitcherPolicy) String() string

String returns the name in string for ViewSwitcherPolicy.

type ViewSwitcherTitle deprecated

type ViewSwitcherTitle struct {
	gtk.Widget
	// contains filtered or unexported fields
}

ViewSwitcherTitle: view switcher title.

<picture> <source srcset="view-switcher-title-dark.png" media="(prefers-color-scheme: dark)"> <img src="view-switcher-title.png" alt="view-switcher-title"> </picture>

A widget letting you switch between multiple views contained by a viewstack via an viewswitcher.

It is designed to be used as the title widget of a headerbar, and will display the window's title when the window is too narrow to fit the view switcher e.g. on mobile phones, or if there are less than two views.

In order to center the title in narrow windows, the header bar should have headerbar:centering-policy set to ADW_CENTERING_POLICY_STRICT.

AdwViewSwitcherTitle is intended to be used together with viewswitcherbar.

A common use case is to bind the viewswitcherbar:reveal property to viewswitchertitle:title-visible to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher, as follows:

<object class="AdwWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar">
          <property name="centering-policy">strict</property>
          <property name="title-widget">
            <object class="AdwViewSwitcherTitle" id="title">
              <property name="stack">stack</property>
            </object>
          </property>
        </object>
      </child>
      <property name="content">
        <object class="AdwViewStack" id="stack"/>
      </property>
      <child type="bottom">
        <object class="AdwViewSwitcherBar">
          <property name="stack">stack</property>
          <binding name="reveal">
            <lookup name="title-visible">title</lookup>
          </binding>
        </object>
      </child>
    </object>
  </property>
</object>

CSS nodes

AdwViewSwitcherTitle has a single CSS node with name viewswitchertitle.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

func NewViewSwitcherTitle deprecated

func NewViewSwitcherTitle() *ViewSwitcherTitle

NewViewSwitcherTitle creates a new AdwViewSwitcherTitle.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • viewSwitcherTitle: newly created AdwViewSwitcherTitle.

func (*ViewSwitcherTitle) SetStack deprecated

func (self *ViewSwitcherTitle) SetStack(stack *ViewStack)

SetStack sets the stack controlled by self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function takes the following parameters:

  • stack (optional): stack.

func (*ViewSwitcherTitle) SetSubtitle deprecated

func (self *ViewSwitcherTitle) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle of self.

The subtitle should give the user additional details.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function takes the following parameters:

  • subtitle: subtitle.

func (*ViewSwitcherTitle) SetTitle deprecated

func (self *ViewSwitcherTitle) SetTitle(title string)

SetTitle sets the title of self.

The title typically identifies the current view or content item, and generally does not use the application name.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function takes the following parameters:

  • title: title.

func (*ViewSwitcherTitle) SetViewSwitcherEnabled deprecated

func (self *ViewSwitcherTitle) SetViewSwitcherEnabled(enabled bool)

SetViewSwitcherEnabled sets whether self's view switcher is enabled.

If it is disabled, the title will be displayed instead. This allows to programmatically hide the view switcher 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.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function takes the following parameters:

  • enabled: whether the view switcher is enabled.

func (*ViewSwitcherTitle) Stack deprecated

func (self *ViewSwitcherTitle) Stack() *ViewStack

Stack gets the stack controlled by self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • viewStack (optional): stack.

func (*ViewSwitcherTitle) Subtitle deprecated

func (self *ViewSwitcherTitle) Subtitle() string

Subtitle gets the subtitle of self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • utf8: subtitle.

func (*ViewSwitcherTitle) Title deprecated

func (self *ViewSwitcherTitle) Title() string

Title gets the title of self.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • utf8: title.

func (*ViewSwitcherTitle) TitleVisible deprecated

func (self *ViewSwitcherTitle) TitleVisible() bool

TitleVisible gets whether the title of self is currently visible.

If the title is visible, it means the view switcher is hidden an it may be wanted to show an alternative switcher, e.g. a viewswitcherbar.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • ok: whether the title of self is currently visible.

func (*ViewSwitcherTitle) ViewSwitcherEnabled deprecated

func (self *ViewSwitcherTitle) ViewSwitcherEnabled() bool

ViewSwitcherEnabled gets whether self's view switcher is enabled.

Deprecated: See the migration guide (migrating-to-breakpoints.html#replace-adwviewswitchertitle).

The function returns the following values:

  • ok: whether the view switcher is enabled.

type ViewSwitcherTitleClass

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

ViewSwitcherTitleClass: instance of this type is always passed by reference.

func (*ViewSwitcherTitleClass) ParentClass

func (v *ViewSwitcherTitleClass) ParentClass() *gtk.WidgetClass

type ViewSwitcherTitleOverrides

type ViewSwitcherTitleOverrides struct {
}

ViewSwitcherTitleOverrides contains methods that are overridable.

type Window

type Window struct {
	gtk.Window
	// contains filtered or unexported fields
}

Window: freeform window.

<picture> <source srcset="window-dark.png" media="(prefers-color-scheme: dark)"> <img src="window.png" alt="window"> </picture>

The AdwWindow widget is a subclass of gtk.Window which has no titlebar area. Instead, toolbarview can be used together with headerbar or gtk.HeaderBar as follows:

<object class="AdwWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar"/>
      </child>
      <property name="content">
        <!-- ... -->
      </property>
    </object>
  </property>
</object>

Using gtk.Window:titlebar or gtk.Window:child is not supported and will result in a crash. Use window:content instead.

Breakpoints

AdwWindow can be used with breakpoint the same way as breakpointbin. Refer to that widget's documentation for details.

Example:

<object class="AdwWindow">
  <property name="width-request">360</property>
  <property name="height-request">200</property>
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar"/>
      </child>
      <property name="content">
        <!-- ... -->
      </property>
      <child type="bottom">
        <object class="GtkActionBar" id="bottom_bar">
          <property name="revealed">True</property>
          <property name="visible">False</property>
        </object>
      </child>
    </object>
  </property>
  <child>
    <object class="AdwBreakpoint">
      <condition>max-width: 500px</condition>
      <setter object="bottom_bar" property="visible">True</setter>
    </object>
  </child>
</object>

Like AdwBreakpointBin, if breakpoints are used, AdwWindow doesn't have a minimum size, and gtk.Widget:width-request and gtk.Widget:height-request properties must be set manually.

func NewWindow

func NewWindow() *Window

NewWindow creates a new AdwWindow.

The function returns the following values:

  • window: newly created AdwWindow.

func (*Window) AddBreakpoint

func (self *Window) AddBreakpoint(breakpoint *Breakpoint)

AddBreakpoint adds breakpoint to self.

The function takes the following parameters:

  • breakpoint to add.

func (*Window) Content

func (self *Window) Content() gtk.Widgetter

Content gets the content widget of self.

This method should always be used instead of gtk.Window.GetChild().

The function returns the following values:

  • widget (optional): content widget of self.

func (*Window) CurrentBreakpoint

func (self *Window) CurrentBreakpoint() *Breakpoint

CurrentBreakpoint gets the current breakpoint.

The function returns the following values:

  • breakpoint (optional): current breakpoint.

func (*Window) SetContent

func (self *Window) SetContent(content gtk.Widgetter)

SetContent sets the content widget of self.

This method should always be used instead of gtk.Window.SetChild().

The function takes the following parameters:

  • content (optional) widget.

type WindowClass

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

WindowClass: instance of this type is always passed by reference.

func (*WindowClass) ParentClass

func (w *WindowClass) ParentClass() *gtk.WindowClass

type WindowOverrides

type WindowOverrides struct {
}

WindowOverrides contains methods that are overridable.

type WindowTitle

type WindowTitle struct {
	gtk.Widget
	// contains filtered or unexported fields
}

WindowTitle: helper widget for setting a window's title and subtitle.

<picture> <source srcset="window-title-dark.png" media="(prefers-color-scheme: dark)"> <img src="window-title.png" alt="window-title"> </picture>

AdwWindowTitle shows a title and subtitle. It's intended to be used as the title child of gtk.HeaderBar or headerbar.

CSS nodes

AdwWindowTitle has a single CSS node with name windowtitle.

func NewWindowTitle

func NewWindowTitle(title, subtitle string) *WindowTitle

NewWindowTitle creates a new AdwWindowTitle.

The function takes the following parameters:

  • title: title.
  • subtitle: subtitle.

The function returns the following values:

  • windowTitle: newly created AdwWindowTitle.

func (*WindowTitle) SetSubtitle

func (self *WindowTitle) SetSubtitle(subtitle string)

SetSubtitle sets the subtitle of self.

The subtitle should give the user additional details.

The function takes the following parameters:

  • subtitle: subtitle.

func (*WindowTitle) SetTitle

func (self *WindowTitle) SetTitle(title string)

SetTitle sets the title of self.

The title typically identifies the current view or content item, and generally does not use the application name.

The function takes the following parameters:

  • title: title.

func (*WindowTitle) Subtitle

func (self *WindowTitle) Subtitle() string

Subtitle gets the subtitle of self.

The function returns the following values:

  • utf8: subtitle.

func (*WindowTitle) Title

func (self *WindowTitle) Title() string

Title gets the title of self.

The function returns the following values:

  • utf8: title.

type WindowTitleClass

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

WindowTitleClass: instance of this type is always passed by reference.

func (*WindowTitleClass) ParentClass

func (w *WindowTitleClass) ParentClass() *gtk.WidgetClass

type WindowTitleOverrides

type WindowTitleOverrides struct {
}

WindowTitleOverrides contains methods that are overridable.

Source Files

Jump to

Keyboard shortcuts

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