tooltip2 (#3237)
- Fix executor.timer() in gpui2 - Add support for tooltips [[PR Description]] Release Notes: - N/A
This commit is contained in:
commit
3afdeeac1e
8 changed files with 80 additions and 49 deletions
|
@ -1,6 +1,4 @@
|
|||
use gpui2::{
|
||||
div, px, Div, ParentElement, Render, SharedString, Styled, View, ViewContext, VisualContext,
|
||||
};
|
||||
use gpui2::{div, px, Div, ParentElement, Render, SharedString, Styled, ViewContext};
|
||||
use theme2::ActiveTheme;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -12,10 +10,6 @@ impl TextTooltip {
|
|||
pub fn new(str: SharedString) -> Self {
|
||||
Self { title: str }
|
||||
}
|
||||
|
||||
pub fn build_view<C: VisualContext>(str: SharedString, cx: &mut C) -> C::Result<View<Self>> {
|
||||
cx.build_view(|cx| TextTooltip::new(str))
|
||||
}
|
||||
}
|
||||
|
||||
impl Render for TextTooltip {
|
||||
|
@ -27,6 +21,7 @@ impl Render for TextTooltip {
|
|||
.bg(theme.colors().background)
|
||||
.rounded(px(8.))
|
||||
.border()
|
||||
.font("Zed Sans")
|
||||
.border_color(theme.colors().border)
|
||||
.text_color(theme.colors().text)
|
||||
.pl_2()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue