clean up
This commit is contained in:
@@ -3,7 +3,7 @@ use gpui::{
|
||||
App, BoxShadow, Div, ElementId, FocusHandle, Hsla, IntoElement, StatefulInteractiveElement,
|
||||
Styled, Window, div, px,
|
||||
};
|
||||
use gpui_native_theme::Theme;
|
||||
use gpui_native_theme::ActiveTheme as _;
|
||||
|
||||
/// A row whose children center on the cross axis.
|
||||
pub fn h_flex() -> Div {
|
||||
@@ -71,7 +71,8 @@ where
|
||||
}
|
||||
|
||||
/// A selectable row's label and icon color.
|
||||
pub fn selectable_label_color(theme: &Theme, selected: bool, disabled: bool) -> Hsla {
|
||||
pub fn selectable_label_color(cx: &App, selected: bool, disabled: bool) -> Hsla {
|
||||
let theme = cx.theme();
|
||||
if disabled {
|
||||
theme.colors.muted_foreground
|
||||
} else if selected {
|
||||
@@ -82,10 +83,11 @@ pub fn selectable_label_color(theme: &Theme, selected: bool, disabled: bool) ->
|
||||
}
|
||||
|
||||
/// A selectable row's background.
|
||||
pub fn paint_selectable_row<R>(theme: &Theme, row: R, selected: bool, disabled: bool) -> R
|
||||
pub fn paint_selectable_row<R>(cx: &App, row: R, selected: bool, disabled: bool) -> R
|
||||
where
|
||||
R: IntoElement + Styled + StatefulInteractiveElement,
|
||||
{
|
||||
let theme = cx.theme();
|
||||
row.map(|row| {
|
||||
if disabled {
|
||||
row
|
||||
|
||||
Reference in New Issue
Block a user