mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-17 10:18:32 +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
|
list_entry
|
||||||
.0
|
.0
|
||||||
.imp()
|
.imp()
|
||||||
.button
|
.remove_device_button
|
||||||
.borrow()
|
.borrow()
|
||||||
.set_sensitive(true);
|
.set_sensitive(true);
|
||||||
} else {
|
} else {
|
||||||
list_entry
|
list_entry
|
||||||
.0
|
.0
|
||||||
.imp()
|
.imp()
|
||||||
.button
|
.remove_device_button
|
||||||
.borrow()
|
.borrow()
|
||||||
.set_sensitive(false);
|
.set_sensitive(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,20 +31,20 @@ impl BluetoothEntry {
|
||||||
entry.set_subtitle(&device.address);
|
entry.set_subtitle(&device.address);
|
||||||
entry.set_activatable(true);
|
entry.set_activatable(true);
|
||||||
|
|
||||||
entry_imp.button.replace(Button::builder().icon_name("user-trash-symbolic").valign(Align::Center).build());
|
entry_imp.remove_device_button.replace(Button::builder().icon_name("user-trash-symbolic").valign(Align::Center).build());
|
||||||
entry.add_suffix(entry_imp.button.borrow().deref());
|
entry.add_suffix(entry_imp.remove_device_button.borrow().deref());
|
||||||
if device.icon.is_empty() {
|
if device.icon.is_empty() {
|
||||||
entry.add_prefix(&Image::from_icon_name("dialog-question-symbolic"));
|
entry.add_prefix(&Image::from_icon_name("dialog-question-symbolic"));
|
||||||
} else {
|
} else {
|
||||||
entry.add_prefix(&Image::from_icon_name(&device.icon));
|
entry.add_prefix(&Image::from_icon_name(&device.icon));
|
||||||
}
|
}
|
||||||
if device.connected || device.paired {
|
if device.connected || device.paired {
|
||||||
entry_imp.button.borrow().set_sensitive(true);
|
entry_imp.remove_device_button.borrow().set_sensitive(true);
|
||||||
} else {
|
} else {
|
||||||
entry_imp.button.borrow().set_sensitive(false);
|
entry_imp.remove_device_button.borrow().set_sensitive(false);
|
||||||
}
|
}
|
||||||
let path = Arc::new(device.path.clone());
|
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());
|
remove_device_pairing((*path).clone());
|
||||||
});
|
});
|
||||||
let gesture = GestureClick::new();
|
let gesture = GestureClick::new();
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::cell::RefCell;
|
||||||
#[derive(Default, CompositeTemplate)]
|
#[derive(Default, CompositeTemplate)]
|
||||||
#[template(resource = "/org/Xetibo/ReSet/resetBluetoothEntry.ui")]
|
#[template(resource = "/org/Xetibo/ReSet/resetBluetoothEntry.ui")]
|
||||||
pub struct BluetoothEntry {
|
pub struct BluetoothEntry {
|
||||||
pub button: RefCell<Button>,
|
pub remove_device_button: RefCell<Button>,
|
||||||
pub device_name: RefCell<String>,
|
pub device_name: RefCell<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue