mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-08 22:52:01 +02:00
rename button
This commit is contained in:
parent
0184fba8b4
commit
4142f3f3a8
|
@ -295,14 +295,14 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
|||
list_entry
|
||||
.0
|
||||
.imp()
|
||||
.button
|
||||
.remove_device_button
|
||||
.borrow()
|
||||
.set_sensitive(true);
|
||||
} else {
|
||||
list_entry
|
||||
.0
|
||||
.imp()
|
||||
.button
|
||||
.remove_device_button
|
||||
.borrow()
|
||||
.set_sensitive(false);
|
||||
}
|
||||
|
|
|
@ -31,20 +31,20 @@ impl BluetoothEntry {
|
|||
entry.set_subtitle(&device.address);
|
||||
entry.set_activatable(true);
|
||||
|
||||
entry_imp.button.replace(Button::builder().icon_name("user-trash-symbolic").valign(Align::Center).build());
|
||||
entry.add_suffix(entry_imp.button.borrow().deref());
|
||||
entry_imp.remove_device_button.replace(Button::builder().icon_name("user-trash-symbolic").valign(Align::Center).build());
|
||||
entry.add_suffix(entry_imp.remove_device_button.borrow().deref());
|
||||
if device.icon.is_empty() {
|
||||
entry.add_prefix(&Image::from_icon_name("dialog-question-symbolic"));
|
||||
} else {
|
||||
entry.add_prefix(&Image::from_icon_name(&device.icon));
|
||||
}
|
||||
if device.connected || device.paired {
|
||||
entry_imp.button.borrow().set_sensitive(true);
|
||||
entry_imp.remove_device_button.borrow().set_sensitive(true);
|
||||
} else {
|
||||
entry_imp.button.borrow().set_sensitive(false);
|
||||
entry_imp.remove_device_button.borrow().set_sensitive(false);
|
||||
}
|
||||
let path = Arc::new(device.path.clone());
|
||||
entry_imp.button.borrow().connect_clicked(move |_| {
|
||||
entry_imp.remove_device_button.borrow().connect_clicked(move |_| {
|
||||
remove_device_pairing((*path).clone());
|
||||
});
|
||||
let gesture = GestureClick::new();
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::cell::RefCell;
|
|||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetBluetoothEntry.ui")]
|
||||
pub struct BluetoothEntry {
|
||||
pub button: RefCell<Button>,
|
||||
pub remove_device_button: RefCell<Button>,
|
||||
pub device_name: RefCell<String>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue