mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-11-06 08:15:35 +00:00
refactor(settings): drop the raised-control paint nothing uses now
Tk::btn and Tk::raised_hover lost their last callers when the page's controls moved onto the well. Also corrects two comments that described the old field ring and claimed more than was observed.
This commit is contained in:
+3
-2
@@ -209,8 +209,9 @@ impl Render for TextPrompt {
|
||||
.track_focus(&self.focus)
|
||||
.size_full()
|
||||
// Nothing under the scrim answers the pointer while the question
|
||||
// is up: the prompt is painted over the window, not into it, so
|
||||
// without this a click on the dimmed tab strip still switched tabs.
|
||||
// is up: the prompt is painted over the window, not into it, and
|
||||
// gpui hands a click to every hitbox under it that is not
|
||||
// occluded — the dimmed window would still take it.
|
||||
.occlude()
|
||||
.cursor_default()
|
||||
.bg(crate::ui::presets::scrim_fill(cx))
|
||||
|
||||
+1
-16
@@ -47,8 +47,6 @@ pub(crate) struct Tk {
|
||||
pub heading: Hsla,
|
||||
/// A nav item at rest.
|
||||
pub nav: Hsla,
|
||||
/// A raised button's fill.
|
||||
pub btn: Hsla,
|
||||
/// The one fill every control on the page stands on — field, dropdown,
|
||||
/// secondary button, stepper — the theme's `muted`, the same well the
|
||||
/// dialogs' fields and the sidebar's search sit in. No outline, no drop.
|
||||
@@ -104,7 +102,6 @@ impl Tk {
|
||||
k6: a(0.6, 0.65),
|
||||
heading: a(0.9, 0.9),
|
||||
nav: a(0.82, 0.8),
|
||||
btn: if dark { fg.opacity(0.1) } else { white },
|
||||
well,
|
||||
well_hover: well.blend(fg.opacity(if dark { 0.06 } else { 0.05 })),
|
||||
focus: theme.ring,
|
||||
@@ -130,18 +127,6 @@ impl Tk {
|
||||
}
|
||||
}
|
||||
|
||||
/// The same, a step firmer, for a hovered raised control.
|
||||
pub(crate) fn raised_hover(&self) -> Vec<BoxShadow> {
|
||||
if self.dark {
|
||||
vec![ring(self.fg.opacity(0.2), 0.5, false)]
|
||||
} else {
|
||||
vec![
|
||||
ring(gpui::black().opacity(0.16), 0.5, false),
|
||||
drop(gpui::black().opacity(0.08), 1., 2., 0.),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn popover(&self) -> Vec<BoxShadow> {
|
||||
if self.dark {
|
||||
vec![
|
||||
@@ -442,7 +427,7 @@ pub(crate) fn search_glass(size: f32, tk: &Tk) -> Icon {
|
||||
/// lower, at 26.
|
||||
pub(crate) const CONTROL_H: f32 = 28.;
|
||||
|
||||
/// A search field with a hairline ring, for filtering a list on the page.
|
||||
/// A search field on the well, for filtering a list on the page.
|
||||
pub(crate) fn search_field(input: &gpui::Entity<InputState>, tk: &Tk) -> Div {
|
||||
h_flex()
|
||||
.h(px(CONTROL_H))
|
||||
|
||||
Reference in New Issue
Block a user