SwitchRow

class SwitchRow(pointer: <Error class: unknown class><<Error class: unknown class>>) : ActionRow

A class@Gtk.ListBoxRow used to represent two states.

switch-row

The AdwSwitchRow widget contains a class@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 class@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 property@SwitchRow:active property should be connected to in order to monitor changes to the active state.

Accessibility

AdwSwitchRow uses the GTK_ACCESSIBLE_ROLE_SWITCH role.

Since

1.4

Constructors

Link copied to clipboard
constructor()

Creates a new AdwSwitchRow.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var activatableWidget: <Error class: unknown class>?

The widget to activate when the row is activated.

Link copied to clipboard

Whether the switch row is in the "on" or "off" position.

Link copied to clipboard
val adwActionRowPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val adwPreferencesRowPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val adwSwitchRowPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkActionablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var iconName: String?

The icon name for this row.

Link copied to clipboard
open var subtitleLines: Int

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

Link copied to clipboard

Whether the user can copy the subtitle from the label.

Link copied to clipboard
open var title: String

The title of the preference represented by this row.

Link copied to clipboard
open var titleLines: Int

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

Link copied to clipboard

Whether the user can copy the title from the label.

Link copied to clipboard
open var useMarkup: Boolean

Whether to use Pango markup for the title label.

Link copied to clipboard

Whether an embedded underline in the title indicates a mnemonic.

Functions

Link copied to clipboard
open fun activate_()

Activates @self.

Link copied to clipboard
open fun addPrefix(widget: <Error class: unknown class>)

Adds a prefix widget to @self.

Link copied to clipboard
open fun addSuffix(widget: <Error class: unknown class>)

Adds a suffix widget to @self.

Link copied to clipboard
fun connectActivated(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

This signal is emitted after the row has been activated.

Link copied to clipboard
open fun getActivatableWidget(): <Error class: unknown class>?

Gets the widget activated when @self is activated.

Link copied to clipboard

Gets whether @self is in its "on" or "off" position.

Link copied to clipboard
open fun getIconName(): String?

Gets the icon name for @self.

Link copied to clipboard
open fun getSubtitle(): String?

Gets the subtitle for @self.

Link copied to clipboard
open fun getSubtitleLines(): Int

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

Link copied to clipboard

Gets whether the user can copy the subtitle from the label

Link copied to clipboard
open fun getTitle(): String

Gets the title of the preference represented by @self.

Link copied to clipboard
open fun getTitleLines(): Int

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

Link copied to clipboard

Gets whether the user can copy the title from the label

Link copied to clipboard
open fun getUseMarkup(): Boolean

Gets whether to use Pango markup for the title label.

Link copied to clipboard

Gets whether an embedded underline in the title indicates a mnemonic.

Link copied to clipboard
open fun remove(widget: <Error class: unknown class>)

Removes a child from @self.

Link copied to clipboard
open fun setActivatableWidget(widget: <Error class: unknown class>? = null)

Sets the widget to activate when @self is activated.

Link copied to clipboard
fun setActive(isActive: Boolean)

Sets whether @self is in its "on" or "off" position

Link copied to clipboard
open fun setIconName(iconName: String? = null)

Sets the icon name for @self.

Link copied to clipboard
open fun setSubtitle(subtitle: String)

Sets the subtitle for @self.

Link copied to clipboard
open fun setSubtitleLines(subtitleLines: Int)

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

Link copied to clipboard
open fun setSubtitleSelectable(subtitleSelectable: Boolean)

Sets whether the user can copy the subtitle from the label

Link copied to clipboard
open fun setTitle(title: String)

Sets the title of the preference represented by @self.

Link copied to clipboard
open fun setTitleLines(titleLines: Int)

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

Link copied to clipboard
open fun setTitleSelectable(titleSelectable: Boolean)

Sets whether the user can copy the title from the label

Link copied to clipboard
open fun setUseMarkup(useMarkup: Boolean)

Sets whether to use Pango markup for the title label.

Link copied to clipboard
open fun setUseUnderline(useUnderline: Boolean)

Sets whether an embedded underline in the title indicates a mnemonic.