pub trait RangeExt:
IsA<Range>
+ Sealed
+ 'static {
Show 33 methods
// Provided methods
fn adjustment(&self) -> Adjustment { ... }
fn fill_level(&self) -> f64 { ... }
fn is_flippable(&self) -> bool { ... }
fn is_inverted(&self) -> bool { ... }
fn range_rect(&self) -> Rectangle { ... }
fn restricts_to_fill_level(&self) -> bool { ... }
fn round_digits(&self) -> i32 { ... }
fn shows_fill_level(&self) -> bool { ... }
fn slider_range(&self) -> (i32, i32) { ... }
fn is_slider_size_fixed(&self) -> bool { ... }
fn value(&self) -> f64 { ... }
fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>) { ... }
fn set_fill_level(&self, fill_level: f64) { ... }
fn set_flippable(&self, flippable: bool) { ... }
fn set_increments(&self, step: f64, page: f64) { ... }
fn set_inverted(&self, setting: bool) { ... }
fn set_range(&self, min: f64, max: f64) { ... }
fn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool) { ... }
fn set_round_digits(&self, round_digits: i32) { ... }
fn set_show_fill_level(&self, show_fill_level: bool) { ... }
fn set_slider_size_fixed(&self, size_fixed: bool) { ... }
fn set_value(&self, value: f64) { ... }
fn connect_adjust_bounds<F: Fn(&Self, f64) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_change_value<F: Fn(&Self, ScrollType, f64) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_move_slider<F: Fn(&Self, ScrollType) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn emit_move_slider(&self, step: ScrollType) { ... }
fn connect_value_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_adjustment_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_fill_level_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_inverted_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_restrict_to_fill_level_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_round_digits_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_show_fill_level_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Provided Methods§
Sourcefn adjustment(&self) -> Adjustment
fn adjustment(&self) -> Adjustment
Sourcefn fill_level(&self) -> f64
fn fill_level(&self) -> f64
Sourcefn is_flippable(&self) -> bool
fn is_flippable(&self) -> bool
Gets whether the Range
respects text direction.
See set_flippable()
.
§Returns
true
if the range is flippable
Sourcefn is_inverted(&self) -> bool
fn is_inverted(&self) -> bool
Sourcefn range_rect(&self) -> Rectangle
fn range_rect(&self) -> Rectangle
Sourcefn restricts_to_fill_level(&self) -> bool
fn restricts_to_fill_level(&self) -> bool
Sourcefn round_digits(&self) -> i32
fn round_digits(&self) -> i32
Gets the number of digits to round the value to when it changes.
See change-value
.
§Returns
the number of digits to round to
Sourcefn shows_fill_level(&self) -> bool
fn shows_fill_level(&self) -> bool
Sourcefn slider_range(&self) -> (i32, i32)
fn slider_range(&self) -> (i32, i32)
Sourcefn is_slider_size_fixed(&self) -> bool
fn is_slider_size_fixed(&self) -> bool
Sourcefn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)
fn set_adjustment(&self, adjustment: &impl IsA<Adjustment>)
Sets the adjustment to be used as the “model” object for the Range
The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size.
The page size is normally 0 for Scale
and nonzero for Scrollbar
,
and indicates the size of the visible area of the widget being scrolled.
The page size affects the size of the scrollbar slider.
§adjustment
Sourcefn set_fill_level(&self, fill_level: f64)
fn set_fill_level(&self, fill_level: f64)
Set the new position of the fill level indicator.
The “fill level” is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded.
This amount of prebuffering can be displayed on the range’s trough
and is themeable separately from the trough. To enable fill level
display, use set_show_fill_level()
. The range defaults
to not showing the fill level.
Additionally, it’s possible to restrict the range’s slider position
to values which are smaller than the fill level. This is controlled
by set_restrict_to_fill_level()
and is by default
enabled.
§fill_level
the new position of the fill level indicator
Sourcefn set_flippable(&self, flippable: bool)
fn set_flippable(&self, flippable: bool)
Sets whether the Range
respects text direction.
If a range is flippable, it will switch its direction
if it is horizontal and its direction is TextDirection::Rtl
.
§flippable
true
to make the range flippable
Sourcefn set_increments(&self, step: f64, page: f64)
fn set_increments(&self, step: f64, page: f64)
Sourcefn set_inverted(&self, setting: bool)
fn set_inverted(&self, setting: bool)
Sourcefn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool)
fn set_restrict_to_fill_level(&self, restrict_to_fill_level: bool)
Sets whether the slider is restricted to the fill level.
See set_fill_level()
for a general description
of the fill level concept.
§restrict_to_fill_level
Whether the fill level restricts slider movement.
Sourcefn set_round_digits(&self, round_digits: i32)
fn set_round_digits(&self, round_digits: i32)
Sets the number of digits to round the value to when it changes.
See change-value
.
§round_digits
the precision in digits, or -1
Sourcefn set_show_fill_level(&self, show_fill_level: bool)
fn set_show_fill_level(&self, show_fill_level: bool)
Sets whether a graphical fill level is show on the trough.
See set_fill_level()
for a general description
of the fill level concept.
§show_fill_level
Whether a fill level indicator graphics is shown.
Sourcefn set_slider_size_fixed(&self, size_fixed: bool)
fn set_slider_size_fixed(&self, size_fixed: bool)
Sourcefn set_value(&self, value: f64)
fn set_value(&self, value: f64)
Sets the current value of the range.
If the value is outside the minimum or maximum range values,
it will be clamped to fit inside them. The range emits the
value-changed
signal if the value changes.
§value
new value of the range
Sourcefn connect_adjust_bounds<F: Fn(&Self, f64) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_adjust_bounds<F: Fn(&Self, f64) + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted before clamping a value, to give the application a chance to adjust the bounds.
§value
the value before we clamp
Sourcefn connect_change_value<F: Fn(&Self, ScrollType, f64) -> Propagation + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_change_value<F: Fn(&Self, ScrollType, f64) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted when a scroll action is performed on a range.
It allows an application to determine the type of scroll event
that occurred and the resultant new value. The application can
handle the event itself and return true
to prevent further
processing. Or, by returning false
, it can pass the event to
other handlers until the default GTK handler is reached.
The value parameter is unrounded. An application that overrides
the ::change-value signal is responsible for clamping the value
to the desired number of decimal digits; the default GTK
handler clamps the value based on round-digits
.
§scroll
the type of scroll action that was performed
§value
the new value resulting from the scroll action
§Returns
true
to prevent other handlers from being invoked for
the signal, false
to propagate the signal further
Sourcefn connect_move_slider<F: Fn(&Self, ScrollType) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_move_slider<F: Fn(&Self, ScrollType) + 'static>( &self, f: F, ) -> SignalHandlerId
fn emit_move_slider(&self, step: ScrollType)
Sourcefn connect_value_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_value_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the range value changes.
fn connect_adjustment_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_fill_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_inverted_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_restrict_to_fill_level_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_round_digits_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_show_fill_level_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.