yoda: warning cleanup sweep (dead code + clippy --fix) (squashed)
Squash of 4 yoda commits: -84437e21yoda: libcosmic-yoda dead-code purge (14->0 warnings) -999db0a4yoda: cosmic-theme cleanup (4->0 warnings) — workspace at 0 warnings total -4743bb8eyoda: cargo clippy --fix on libcosmic-yoda (115->33 warnings) -675f3b59chore: reduce local stack warnings
This commit is contained in:
parent
38acba82b4
commit
7a191cf086
36 changed files with 181 additions and 219 deletions
|
|
@ -474,16 +474,14 @@ where
|
|||
match event {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
let hovered_guard = self.hovered_option.lock().unwrap();
|
||||
if cursor.is_over(layout.bounds()) {
|
||||
if let Some(index) = *hovered_guard {
|
||||
if cursor.is_over(layout.bounds())
|
||||
&& let Some(index) = *hovered_guard {
|
||||
shell.publish((self.on_selected)(index));
|
||||
if let Some(close_on_selected) = self.close_on_selected.as_ref() {
|
||||
shell.publish(close_on_selected.clone());
|
||||
}
|
||||
shell.capture_event();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Event::Mouse(mouse::Event::CursorMoved { .. }) => {
|
||||
if let Some(cursor_position) = cursor.position_in(layout.bounds()) {
|
||||
|
|
@ -498,11 +496,10 @@ where
|
|||
let new_hovered_option = (cursor_position.y / option_height) as usize;
|
||||
let mut hovered_guard = self.hovered_option.lock().unwrap();
|
||||
|
||||
if let Some(on_option_hovered) = self.on_option_hovered {
|
||||
if *hovered_guard != Some(new_hovered_option) {
|
||||
if let Some(on_option_hovered) = self.on_option_hovered
|
||||
&& *hovered_guard != Some(new_hovered_option) {
|
||||
shell.publish(on_option_hovered(new_hovered_option));
|
||||
}
|
||||
}
|
||||
|
||||
*hovered_guard = Some(new_hovered_option);
|
||||
}
|
||||
|
|
@ -526,7 +523,6 @@ where
|
|||
shell.publish(close_on_selected.clone());
|
||||
}
|
||||
shell.capture_event();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,13 +343,11 @@ where
|
|||
|
||||
match event {
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left)) => {
|
||||
if cursor.is_over(bounds) {
|
||||
if let Some(item) = self.hovered_option.as_ref() {
|
||||
if cursor.is_over(bounds)
|
||||
&& let Some(item) = self.hovered_option.as_ref() {
|
||||
shell.publish((self.on_selected)(item.clone()));
|
||||
shell.capture_event();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Event::Mouse(mouse::Event::CursorMoved { .. }) => {
|
||||
if let Some(cursor_position) = cursor.position_in(bounds) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use super::menu::{self, Menu};
|
|||
use crate::widget::icon;
|
||||
use derive_setters::Setters;
|
||||
use iced_core::event::Event;
|
||||
use iced_core::text::{self, Paragraph, Text};
|
||||
use iced_core::text::{self, Text};
|
||||
use iced_core::widget::tree::{self, Tree};
|
||||
use iced_core::{
|
||||
Clipboard, Layout, Length, Padding, Pixels, Rectangle, Shadow, Shell, Size, Vector, Widget,
|
||||
|
|
@ -127,7 +127,7 @@ impl<'a, S: AsRef<str>, Message: 'a, Item: Clone + PartialEq + 'static>
|
|||
_viewport: &Rectangle,
|
||||
) {
|
||||
update(
|
||||
&event,
|
||||
event,
|
||||
layout,
|
||||
cursor,
|
||||
shell,
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ where
|
|||
_viewport: &Rectangle,
|
||||
) {
|
||||
update::<S, Message, AppMessage>(
|
||||
&event,
|
||||
event,
|
||||
layout,
|
||||
cursor,
|
||||
shell,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue