diff --git a/src/Library/demos/Menu Button/code.rs b/src/Library/demos/Menu Button/code.rs new file mode 100644 index 000000000..11def679d --- /dev/null +++ b/src/Library/demos/Menu Button/code.rs @@ -0,0 +1,16 @@ +use crate::workbench; +use gtk::prelude::*; +use gtk::{MenuButton, Switch}; + +pub fn main() { + let circular_switch: Switch = workbench::builder().object("circular_switch").unwrap(); + let secondary_button: MenuButton = workbench::builder().object("secondary").unwrap(); + + circular_switch.connect_active_notify(move |switch| { + if switch.is_active() { + secondary_button.add_css_class("circular"); + } else { + secondary_button.remove_css_class("circular"); + } + }); +} diff --git a/src/Library/demos/Menu Button/main.js b/src/Library/demos/Menu Button/main.js index f76a77ed4..14f39f201 100644 --- a/src/Library/demos/Menu Button/main.js +++ b/src/Library/demos/Menu Button/main.js @@ -1,7 +1,6 @@ import Gtk from "gi://Gtk"; const circular_switch = workbench.builder.get_object("circular_switch"); -const primary_button = workbench.builder.get_object("primary"); const secondary_button = workbench.builder.get_object("secondary"); circular_switch.connect("notify::active", () => { diff --git a/src/about.js b/src/about.js index 7ac3fc5df..d315dc659 100644 --- a/src/about.js +++ b/src/about.js @@ -76,6 +76,7 @@ ${getBlueprintVersion()} "Marvin W https://github.com/mar-v-in", "Saad Khan https://github.com/saadulkh", "Adeel Ahmed Qureshi https://github.com/itsAdee", + "Muhammad Bilal https://github.com/mbilal234", // Add yourself as // "John Doe", // or