Added tooltips (#127)
This commit is contained in:
parent
30305cd506
commit
c4cbdedec5
1 changed files with 7 additions and 1 deletions
|
@ -74,6 +74,10 @@ pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Wi
|
||||||
prop(height: as_f64) { gtk_widget.set_size_request(gtk_widget.get_allocated_width(), height as i32) },
|
prop(height: as_f64) { gtk_widget.set_size_request(gtk_widget.get_allocated_width(), height as i32) },
|
||||||
// @prop active - If this widget can be interacted with
|
// @prop active - If this widget can be interacted with
|
||||||
prop(active: as_bool = true) { gtk_widget.set_sensitive(active) },
|
prop(active: as_bool = true) { gtk_widget.set_sensitive(active) },
|
||||||
|
// @prop tooltip - tooltip text (on hover)
|
||||||
|
prop(tooltip: as_string) {
|
||||||
|
gtk_widget.set_tooltip_text(Some(&tooltip));
|
||||||
|
},
|
||||||
// @prop visible - visibility of the widget
|
// @prop visible - visibility of the widget
|
||||||
prop(visible: as_bool = true) {
|
prop(visible: as_bool = true) {
|
||||||
// TODO how do i call this only after the widget has been mapped? this is actually an issue,....
|
// TODO how do i call this only after the widget has been mapped? this is actually an issue,....
|
||||||
|
@ -107,7 +111,8 @@ pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Wi
|
||||||
})
|
})
|
||||||
));
|
));
|
||||||
old_id.map(|id| gtk_widget.disconnect(id));
|
old_id.map(|id| gtk_widget.disconnect(id));
|
||||||
}
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,6 +244,7 @@ fn build_gtk_checkbox(bargs: &mut BuilderArgs) -> Result<gtk::CheckButton> {
|
||||||
old_id.map(|id| gtk_widget.disconnect(id));
|
old_id.map(|id| gtk_widget.disconnect(id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(gtk_widget)
|
Ok(gtk_widget)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue