Move viewport argument to last position in mouse_interaction methods
This keeps the order of the arguments consistent with `draw`.
This commit is contained in:
parent
c330bb1b69
commit
631e95ee0b
24 changed files with 61 additions and 41 deletions
|
|
@ -201,8 +201,8 @@ where
|
|||
pub(crate) fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
viewport: &Rectangle,
|
||||
cursor_position: Point,
|
||||
viewport: &Rectangle,
|
||||
) -> mouse::Interaction {
|
||||
let (body_layout, title_bar_interaction) =
|
||||
if let Some(title_bar) = &self.title_bar {
|
||||
|
|
@ -218,8 +218,8 @@ where
|
|||
|
||||
let mouse_interaction = title_bar.mouse_interaction(
|
||||
title_bar_layout,
|
||||
viewport,
|
||||
cursor_position,
|
||||
viewport,
|
||||
);
|
||||
|
||||
(children.next().unwrap(), mouse_interaction)
|
||||
|
|
@ -228,7 +228,7 @@ where
|
|||
};
|
||||
|
||||
self.body
|
||||
.mouse_interaction(body_layout, viewport, cursor_position)
|
||||
.mouse_interaction(body_layout, cursor_position, viewport)
|
||||
.max(title_bar_interaction)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ where
|
|||
pub(crate) fn mouse_interaction(
|
||||
&self,
|
||||
layout: Layout<'_>,
|
||||
viewport: &Rectangle,
|
||||
cursor_position: Point,
|
||||
viewport: &Rectangle,
|
||||
) -> mouse::Interaction {
|
||||
let mut children = layout.children();
|
||||
let padded = children.next().unwrap();
|
||||
|
|
@ -267,15 +267,15 @@ where
|
|||
|
||||
let title_interaction = self.content.mouse_interaction(
|
||||
title_layout,
|
||||
viewport,
|
||||
cursor_position,
|
||||
viewport,
|
||||
);
|
||||
|
||||
if let Some(controls) = &self.controls {
|
||||
let controls_layout = children.next().unwrap();
|
||||
|
||||
controls
|
||||
.mouse_interaction(controls_layout, viewport, cursor_position)
|
||||
.mouse_interaction(controls_layout, cursor_position, viewport)
|
||||
.max(title_interaction)
|
||||
} else {
|
||||
title_interaction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue