refactor(custom): rename exec to on_click for consistency
BREAKING CHANGE: This changes the option on buttons in the `custom` module. Any uses of the module must be updated to use the new custom widget attribute name.
This commit is contained in:
@@ -42,7 +42,7 @@ pub struct Widget {
|
|||||||
label: Option<String>,
|
label: Option<String>,
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
class: Option<String>,
|
class: Option<String>,
|
||||||
exec: Option<String>,
|
on_click: Option<String>,
|
||||||
orientation: Option<String>,
|
orientation: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ impl Widget {
|
|||||||
button.style_context().add_class(&class);
|
button.style_context().add_class(&class);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(exec) = self.exec {
|
if let Some(exec) = self.on_click {
|
||||||
button.connect_clicked(move |button| {
|
button.connect_clicked(move |button| {
|
||||||
tx.try_send(ExecEvent {
|
tx.try_send(ExecEvent {
|
||||||
cmd: exec.clone(),
|
cmd: exec.clone(),
|
||||||
|
|||||||
Reference in New Issue
Block a user