mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
rename variables
This commit is contained in:
parent
052a219d9b
commit
1f0ad92f11
@ -29,15 +29,15 @@ impl List {
|
|||||||
|
|
||||||
factory.connect_setup(|_, this| {
|
factory.connect_setup(|_, this| {
|
||||||
// Init widget for dropdown item
|
// Init widget for dropdown item
|
||||||
let widget = Box::builder()
|
let child = Box::builder()
|
||||||
.orientation(gtk::Orientation::Vertical)
|
.orientation(gtk::Orientation::Vertical)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
widget.append(&Label::builder().halign(Align::Start).build());
|
child.append(&Label::builder().halign(Align::Start).build());
|
||||||
|
|
||||||
// Subtitle
|
// Subtitle
|
||||||
widget.append(
|
child.append(
|
||||||
&Label::builder()
|
&Label::builder()
|
||||||
.halign(Align::Start)
|
.halign(Align::Start)
|
||||||
.css_classes(["caption", "dim-label"])
|
.css_classes(["caption", "dim-label"])
|
||||||
@ -47,7 +47,7 @@ impl List {
|
|||||||
// Done
|
// Done
|
||||||
this.downcast_ref::<ListItem>()
|
this.downcast_ref::<ListItem>()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.set_child(Some(&widget));
|
.set_child(Some(&child));
|
||||||
});
|
});
|
||||||
|
|
||||||
factory.connect_bind(|_, this| {
|
factory.connect_bind(|_, this| {
|
||||||
@ -122,9 +122,9 @@ impl List {
|
|||||||
/// Run callback function on `connect_selected_notify` event
|
/// Run callback function on `connect_selected_notify` event
|
||||||
/// * return `Value` enum match selected item
|
/// * return `Value` enum match selected item
|
||||||
pub fn on_select(&self, callback: impl Fn(Value) + 'static) {
|
pub fn on_select(&self, callback: impl Fn(Value) + 'static) {
|
||||||
self.dropdown.connect_selected_notify(move |list| {
|
self.dropdown.connect_selected_notify(move |this| {
|
||||||
callback(
|
callback(
|
||||||
list.selected_item()
|
this.selected_item()
|
||||||
.and_downcast::<Item>()
|
.and_downcast::<Item>()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.value_enum(),
|
.value_enum(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user