Small clippy fixes (#7566)
This commit is contained in:
parent
472437a510
commit
4683d91653
|
|
@ -445,12 +445,13 @@ impl MenuRoot {
|
|||
response.ctx.input(|input| {
|
||||
let pointer = &input.pointer;
|
||||
if let Some(pos) = pointer.interact_pos() {
|
||||
let mut in_old_menu = false;
|
||||
let mut destroy = false;
|
||||
if let Some(root) = root {
|
||||
in_old_menu = root.menu_state.read().area_contains(pos);
|
||||
destroy = !in_old_menu && pointer.any_pressed() && root.id == response.id;
|
||||
}
|
||||
let (in_old_menu, destroy) = if let Some(root) = root {
|
||||
let in_old_menu = root.menu_state.read().area_contains(pos);
|
||||
let destroy = !in_old_menu && pointer.any_pressed() && root.id == response.id;
|
||||
(in_old_menu, destroy)
|
||||
} else {
|
||||
(false, false)
|
||||
};
|
||||
if !in_old_menu {
|
||||
if hovered && secondary_clicked {
|
||||
return MenuResponse::Create(pos, response.id);
|
||||
|
|
|
|||
|
|
@ -404,15 +404,11 @@ impl RichText {
|
|||
let text_color = text_color.unwrap_or(crate::Color32::PLACEHOLDER);
|
||||
|
||||
let font_id = {
|
||||
let mut font_id = text_style
|
||||
.or_else(|| style.override_text_style.clone())
|
||||
.map_or_else(
|
||||
|| fallback_font.resolve(style),
|
||||
|text_style| text_style.resolve(style),
|
||||
);
|
||||
if let Some(fid) = style.override_font_id.clone() {
|
||||
font_id = fid;
|
||||
}
|
||||
let mut font_id = style.override_font_id.clone().unwrap_or_else(|| {
|
||||
(text_style.as_ref().or(style.override_text_style.as_ref()))
|
||||
.map(|text_style| text_style.resolve(style))
|
||||
.unwrap_or_else(|| fallback_font.resolve(style))
|
||||
});
|
||||
if let Some(size) = size {
|
||||
font_id.size = size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue