New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add status tooltips #32011
base: main
Are you sure you want to change the base?
feat: add status tooltips #32011
Conversation
a807737
to
f8ca586
Compare
140ebe8
to
35ce190
Compare
35ce190
to
3a49a89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming along well! A few comments:
@@ -48,6 +48,8 @@ pub struct Minibrowser { | |||
location_dirty: Cell<bool>, | |||
|
|||
load_status: LoadStatus, | |||
|
|||
hovered_link: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommend renaming this to status_text
to make it more clearly related to EmbedderMsg::Status, and avoid confusion if we later show other kinds of status bar text
@@ -371,6 +391,15 @@ impl Minibrowser { | |||
need_update | |||
} | |||
|
|||
pub fn update_hovered_link( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -37,6 +37,7 @@ use crate::window_trait::{WindowPortsMethods, LINE_HEIGHT}; | |||
pub struct WebViewManager<Window: WindowPortsMethods + ?Sized> { | |||
current_url: Option<ServoUrl>, | |||
current_url_string: Option<String>, | |||
hovered_link: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -130,6 +132,10 @@ where | |||
self.load_status | |||
} | |||
|
|||
pub fn hovered_link(&self) -> Option<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
TopBottomPanel::bottom("innner_hover_links") | ||
.max_height(0.0) | ||
.show(ctx, |ui| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be done without a TopBottomPanel by replacing ui.cursor().max.y
with ctx.available_rect().max.y
@@ -217,6 +220,23 @@ impl Minibrowser { | |||
return; | |||
}; | |||
let mut embedder_events = vec![]; | |||
|
|||
if self.hovered_link.is_some() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self.hovered_link.is_some() { | |
if let Some(status_text) = &self.status_text { |
and then do ui.label(status_text.clone());
./mach build -d
does not report any errors./mach test-tidy
does not report any errors