Skip to main content

ProgressBarExt

Trait ProgressBarExt 

Source
pub trait ProgressBarExt: IsA<ProgressBar> + 'static {
Show 19 methods // Provided methods fn ellipsize(&self) -> EllipsizeMode { ... } fn fraction(&self) -> f64 { ... } fn is_inverted(&self) -> bool { ... } fn pulse_step(&self) -> f64 { ... } fn shows_text(&self) -> bool { ... } fn text(&self) -> Option<GString> { ... } fn pulse(&self) { ... } fn set_ellipsize(&self, mode: EllipsizeMode) { ... } fn set_fraction(&self, fraction: f64) { ... } fn set_inverted(&self, inverted: bool) { ... } fn set_pulse_step(&self, fraction: f64) { ... } fn set_show_text(&self, show_text: bool) { ... } fn set_text(&self, text: Option<&str>) { ... } fn connect_ellipsize_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_fraction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_inverted_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_pulse_step_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_show_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ProgressBar methods.

§Implementors

ProgressBar

Provided Methods§

Source

fn ellipsize(&self) -> EllipsizeMode

Returns the ellipsizing position of the progress bar. See set_ellipsize().

§Returns

pango::EllipsizeMode

Source

fn fraction(&self) -> f64

Returns the current fraction of the task that’s been completed.

§Returns

a fraction from 0.0 to 1.0

Source

fn is_inverted(&self) -> bool

Gets the value set by set_inverted().

§Returns

true if the progress bar is inverted

Source

fn pulse_step(&self) -> f64

Retrieves the pulse step set with set_pulse_step().

§Returns

a fraction from 0.0 to 1.0

Source

fn shows_text(&self) -> bool

Gets the value of the show-text property. See set_show_text().

§Returns

true if text is shown in the progress bar

Source

fn text(&self) -> Option<GString>

Retrieves the text that is displayed with the progress bar, if any, otherwise None. The return value is a reference to the text, not a copy of it, so will become invalid if you change the text in the progress bar.

§Returns

text, or None; this string is owned by the widget and should not be modified or freed.

Source

fn pulse(&self)

Indicates that some progress has been made, but you don’t know how much. Causes the progress bar to enter “activity mode,” where a block bounces back and forth. Each call to pulse() causes the block to move by a little bit (the amount of movement per pulse is determined by set_pulse_step()).

Source

fn set_ellipsize(&self, mode: EllipsizeMode)

Sets the mode used to ellipsize (add an ellipsis: “…”) the text if there is not enough space to render the entire string.

§mode

a pango::EllipsizeMode

Source

fn set_fraction(&self, fraction: f64)

Causes the progress bar to “fill in” the given fraction of the bar. The fraction should be between 0.0 and 1.0, inclusive.

§fraction

fraction of the task that’s been completed

Source

fn set_inverted(&self, inverted: bool)

Progress bars normally grow from top to bottom or left to right. Inverted progress bars grow in the opposite direction.

§inverted

true to invert the progress bar

Source

fn set_pulse_step(&self, fraction: f64)

Sets the fraction of total progress bar length to move the bouncing block for each call to pulse().

§fraction

fraction between 0.0 and 1.0

Source

fn set_show_text(&self, show_text: bool)

Sets whether the progress bar will show text next to the bar. The shown text is either the value of the text property or, if that is None, the fraction value, as a percentage.

To make a progress bar that is styled and sized suitably for containing text (even if the actual text is blank), set show-text to true and text to the empty string (not None).

§show_text

whether to show text

Source

fn set_text(&self, text: Option<&str>)

Causes the given text to appear next to the progress bar.

If text is None and show-text is true, the current value of fraction will be displayed as a percentage.

If text is non-None and show-text is true, the text will be displayed. In this case, it will not display the progress percentage. If text is the empty string, the progress bar will still be styled and sized suitably for containing text, as long as show-text is true.

§text

a UTF-8 string, or None

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn connect_text_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".

Implementors§