gtk4::prelude

Trait ScaleButtonExt

Source
pub trait ScaleButtonExt: IsA<ScaleButton> + 'static {
Show 22 methods // Provided methods fn is_active(&self) -> bool { ... } fn adjustment(&self) -> Adjustment { ... } fn has_frame(&self) -> bool { ... } fn minus_button(&self) -> Button { ... } fn plus_button(&self) -> Button { ... } fn popup(&self) -> Widget { ... } fn value(&self) -> f64 { ... } fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>) { ... } fn set_has_frame(&self, has_frame: bool) { ... } fn set_icons(&self, icons: &[&str]) { ... } fn set_value(&self, value: f64) { ... } fn icons(&self) -> Vec<GString> { ... } fn connect_popdown<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_popdown(&self) { ... } fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_popup(&self) { ... } fn connect_value_changed<F: Fn(&Self, f64) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_active_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_adjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_icons_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_value_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ScaleButton methods.

§Implementors

ScaleButton, VolumeButton

Provided Methods§

Source

fn is_active(&self) -> bool

Available on crate feature v4_10 only.

Queries a ScaleButton and returns its current state.

Returns true if the scale button is pressed in and false if it is raised.

§Returns

whether the button is pressed

Source

fn adjustment(&self) -> Adjustment

Gets the Adjustment associated with the ScaleButton’s scale.

See RangeExt::adjustment() for details.

§Returns

the adjustment associated with the scale

Source

fn has_frame(&self) -> bool

Available on crate feature v4_14 only.

Returns whether the button has a frame.

§Returns

true if the button has a frame

Source

fn minus_button(&self) -> Button

Retrieves the minus button of the ScaleButton.

§Returns

the minus button of the ScaleButton

Source

fn plus_button(&self) -> Button

Retrieves the plus button of the ScaleButton

§Returns

the plus button of the ScaleButton

Source

fn popup(&self) -> Widget

Retrieves the popup of the ScaleButton.

§Returns

the popup of the ScaleButton

Source

fn value(&self) -> f64

Gets the current value of the scale button.

§Returns

current value of the scale button

Source

fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)

Sets the Adjustment to be used as a model for the ScaleButton’s scale.

See RangeExt::set_adjustment() for details.

§adjustment

a Adjustment

Source

fn set_has_frame(&self, has_frame: bool)

Available on crate feature v4_14 only.

Sets the style of the button.

§has_frame

whether the button should have a visible frame

Source

fn set_icons(&self, icons: &[&str])

Sets the icons to be used by the scale button.

§icons

a None-terminated array of icon names

Source

fn set_value(&self, value: f64)

Sets the current value of the scale.

If the value is outside the minimum or maximum range values, it will be clamped to fit inside them.

The scale button emits the value-changed signal if the value changes.

§value

new value of the scale button

Source

fn icons(&self) -> Vec<GString>

The names of the icons to be used by the scale button.

The first item in the array will be used in the button when the current value is the lowest value, the second item for the highest value. All the subsequent icons will be used for all the other values, spread evenly over the range of values.

If there’s only one icon name in the @icons array, it will be used for all the values. If only two icon names are in the @icons array, the first one will be used for the bottom 50% of the scale, and the second one for the top 50%.

It is recommended to use at least 3 icons so that the ScaleButton reflects the current value of the scale better for the users.

Source

fn connect_popdown<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted to dismiss the popup.

This is a keybinding signal.

The default binding for this signal is Escape.

Source

fn emit_popdown(&self)

Source

fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted to popup the scale widget.

This is a keybinding signal.

The default bindings for this signal are Space, Enter and Return.

Source

fn emit_popup(&self)

Source

fn connect_value_changed<F: Fn(&Self, f64) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the value field has changed.

§value

the new value

Source

fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Available on crate feature v4_10 only.
Source

fn connect_adjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v4_14 only.
Source

fn connect_icons_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§