don't store menu_opened as i32
This commit is contained in:
parent
e7ea1122de
commit
0b51f1f702
@ -76,7 +76,7 @@ pub struct FunctionEntry {
|
|||||||
|
|
||||||
pub settings_opened: bool,
|
pub settings_opened: bool,
|
||||||
|
|
||||||
menu_opened: i32,
|
menu_opened: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for FunctionEntry {
|
impl Default for FunctionEntry {
|
||||||
@ -100,7 +100,7 @@ impl Default for FunctionEntry {
|
|||||||
test_result: None,
|
test_result: None,
|
||||||
curr_nth: 3,
|
curr_nth: 3,
|
||||||
settings_opened: false,
|
settings_opened: false,
|
||||||
menu_opened: 100,
|
menu_opened: 1.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,10 +123,10 @@ impl FunctionEntry {
|
|||||||
|
|
||||||
let max_size = vec2(
|
let max_size = vec2(
|
||||||
ui.available_width(),
|
ui.available_width(),
|
||||||
if self.menu_opened == 100 {
|
if self.menu_opened == 1.0 {
|
||||||
row_height * 2.5
|
row_height * 2.5
|
||||||
} else {
|
} else {
|
||||||
row_height * (1.0 + ((self.menu_opened as f32 / 100.0) * 1.5))
|
row_height * (1.0 + (self.menu_opened * 1.5))
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -145,9 +145,9 @@ impl FunctionEntry {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
self.menu_opened = (ui.ctx().animate_bool(te_id, re.has_focus()) * 100.0) as i32;
|
self.menu_opened = ui.ctx().animate_bool(te_id, re.has_focus());
|
||||||
|
|
||||||
if self.menu_opened < 100 {
|
if self.menu_opened < 1.0 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user