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: <Error class: unknown class>

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: <Error class: unknown class>

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 getSubtitle(): String?

Gets the subtitle for @self.

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

Removes a child from @self.

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

Sets the subtitle for @self.