Add hint about width of progress (fixes #458)

This commit is contained in:
elkowar 2022-05-22 11:21:45 +02:00
parent 6b5c35cbf9
commit 4fb5c37a35
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F

View file

@ -405,7 +405,7 @@ fn build_gtk_scale(bargs: &mut BuilderArgs) -> Result<gtk::Scale> {
const WIDGET_NAME_PROGRESS: &str = "progress"; const WIDGET_NAME_PROGRESS: &str = "progress";
/// @widget progress /// @widget progress
/// @desc A progress bar /// @desc A progress bar. HINT: for the `width` property to work, you may need to set the `min-width` of `progressbar > trough` in your css.
fn build_gtk_progress(bargs: &mut BuilderArgs) -> Result<gtk::ProgressBar> { fn build_gtk_progress(bargs: &mut BuilderArgs) -> Result<gtk::ProgressBar> {
let gtk_widget = gtk::ProgressBar::new(); let gtk_widget = gtk::ProgressBar::new();
def_widget!(bargs, _g, gtk_widget, { def_widget!(bargs, _g, gtk_widget, {
@ -418,6 +418,7 @@ fn build_gtk_progress(bargs: &mut BuilderArgs) -> Result<gtk::ProgressBar> {
// @prop orientation - orientation of the progress bar. possible values: $orientation // @prop orientation - orientation of the progress bar. possible values: $orientation
prop(orientation: as_string) { gtk_widget.set_orientation(parse_orientation(&orientation)?) }, prop(orientation: as_string) { gtk_widget.set_orientation(parse_orientation(&orientation)?) },
}); });
Ok(gtk_widget) Ok(gtk_widget)
} }