Merge branch 'master' into feature/test-recorder
This commit is contained in:
commit
e2df674aa5
9 changed files with 26 additions and 25 deletions
|
|
@ -1860,7 +1860,10 @@ where
|
|||
|
||||
row![
|
||||
svg(LOGO.clone()).width(text_size * 1.3),
|
||||
text("iced").size(text_size).font(Font::MONOSPACE)
|
||||
text("iced")
|
||||
.size(text_size)
|
||||
.font(Font::MONOSPACE)
|
||||
.shaping(text::Shaping::Advanced)
|
||||
]
|
||||
.spacing(text_size.0 / 3.0)
|
||||
.align_y(Alignment::Center)
|
||||
|
|
|
|||
|
|
@ -534,8 +534,7 @@ impl Focus {
|
|||
self.is_window_focused
|
||||
&& ((self.now - self.updated_at).as_millis()
|
||||
/ Self::CURSOR_BLINK_INTERVAL_MILLIS)
|
||||
% 2
|
||||
== 0
|
||||
.is_multiple_of(2)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -512,8 +512,7 @@ where
|
|||
let is_cursor_visible = !is_disabled
|
||||
&& ((focus.now - focus.updated_at).as_millis()
|
||||
/ CURSOR_BLINK_INTERVAL_MILLIS)
|
||||
% 2
|
||||
== 0;
|
||||
.is_multiple_of(2);
|
||||
|
||||
let cursor = if is_cursor_visible {
|
||||
Some((
|
||||
|
|
|
|||
|
|
@ -201,23 +201,23 @@ where
|
|||
shell: &mut Shell<'_, Message>,
|
||||
viewport: &Rectangle,
|
||||
) {
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
if let Event::Mouse(_) = event {
|
||||
let state = tree.state.downcast_mut::<State>();
|
||||
let was_idle = *state == State::Idle;
|
||||
|
||||
let previous_state = *state;
|
||||
let was_idle = *state == State::Idle;
|
||||
*state = cursor
|
||||
.position_over(layout.bounds())
|
||||
.map(|cursor_position| State::Hovered { cursor_position })
|
||||
.unwrap_or_default();
|
||||
|
||||
*state = cursor
|
||||
.position_over(layout.bounds())
|
||||
.map(|cursor_position| State::Hovered { cursor_position })
|
||||
.unwrap_or_default();
|
||||
let is_idle = *state == State::Idle;
|
||||
|
||||
let is_idle = *state == State::Idle;
|
||||
|
||||
if was_idle != is_idle
|
||||
|| (self.position == Position::FollowCursor
|
||||
&& previous_state != *state)
|
||||
{
|
||||
shell.request_redraw();
|
||||
if was_idle != is_idle {
|
||||
shell.invalidate_layout();
|
||||
shell.request_redraw();
|
||||
} else if self.position == Position::FollowCursor {
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
self.content.as_widget_mut().update(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue