Fix issues introduced in #32

This commit is contained in:
elkowar 2020-10-20 20:11:59 +02:00
parent d5fc9df94d
commit 084d37124a

View file

@ -149,7 +149,7 @@ pub(super) fn resolve_orientable_attrs(bargs: &mut BuilderArgs, gtk_widget: &gtk
/// @widget expander widget
fn build_gtk_expander(bargs: &mut BuilderArgs) -> Result<gtk::Expander> {
let gtk_widget = gtk::Expander::new(Some("Placeholder text, don't forget to set the property 'name'"));
let gtk_widget = gtk::Expander::new(None);
resolve_block!(bargs, gtk_widget, {
// @prop label - label of the expander
prop(label: as_string) { gtk_widget.set_label(Some(&label)); }
@ -163,6 +163,7 @@ fn build_gtk_color_button(bargs: &mut BuilderArgs) -> Result<gtk::ColorButton> {
resolve_block!(bargs, gtk_widget, {
// @prop use-alpha - bool to wether or not use alpha
prop(use_alpha: as_bool) {gtk_widget.set_use_alpha(use_alpha);},
// @prop onchange - runs the code when the color was selected
prop(onchange: as_string) {
let old_id = on_change_handler_id.replace(Some(
@ -172,7 +173,6 @@ fn build_gtk_color_button(bargs: &mut BuilderArgs) -> Result<gtk::ColorButton> {
));
old_id.map(|id| gtk_widget.disconnect(id));
}
prop(use_alpha: as_bool) {gtk_widget.set_use_alpha(use_alpha);}
});
Ok(gtk_widget)