mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
Style contacts popover background based on theme
This commit is contained in:
parent
44553875d0
commit
0c422fadb8
4 changed files with 20 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
use gpui::{color::Color, elements::*, Entity, RenderContext, View, ViewContext};
|
||||
use gpui::{elements::*, Entity, RenderContext, View, ViewContext};
|
||||
use settings::Settings;
|
||||
|
||||
pub enum Event {
|
||||
Deactivated,
|
||||
|
@ -16,9 +17,10 @@ impl View for ContactsPopover {
|
|||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
let theme = &cx.global::<Settings>().theme.contacts_popover;
|
||||
Empty::new()
|
||||
.contained()
|
||||
.with_background_color(Color::red())
|
||||
.with_background_color(theme.background)
|
||||
.boxed()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ pub struct Theme {
|
|||
pub workspace: Workspace,
|
||||
pub context_menu: ContextMenu,
|
||||
pub chat_panel: ChatPanel,
|
||||
pub contacts_popover: ContactsPopover,
|
||||
pub contacts_panel: ContactsPanel,
|
||||
pub contact_finder: ContactFinder,
|
||||
pub project_panel: ProjectPanel,
|
||||
|
@ -301,6 +302,11 @@ pub struct CommandPalette {
|
|||
pub keystroke_spacing: f32,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub struct ContactsPopover {
|
||||
pub background: Color,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default)]
|
||||
pub struct ContactsPanel {
|
||||
#[serde(flatten)]
|
||||
|
|
|
@ -3,6 +3,7 @@ import chatPanel from "./chatPanel";
|
|||
import { text } from "./components";
|
||||
import contactFinder from "./contactFinder";
|
||||
import contactsPanel from "./contactsPanel";
|
||||
import contactsPopover from "./contactsPopover";
|
||||
import commandPalette from "./commandPalette";
|
||||
import editor from "./editor";
|
||||
import projectPanel from "./projectPanel";
|
||||
|
@ -34,6 +35,7 @@ export default function app(theme: Theme): Object {
|
|||
commandPalette: commandPalette(theme),
|
||||
projectPanel: projectPanel(theme),
|
||||
chatPanel: chatPanel(theme),
|
||||
contactsPopover: contactsPopover(theme),
|
||||
contactsPanel: contactsPanel(theme),
|
||||
contactFinder: contactFinder(theme),
|
||||
search: search(theme),
|
||||
|
|
8
styles/src/styleTree/contactsPopover.ts
Normal file
8
styles/src/styleTree/contactsPopover.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import Theme from "../themes/common/theme";
|
||||
import { backgroundColor } from "./components";
|
||||
|
||||
export default function workspace(theme: Theme) {
|
||||
return {
|
||||
background: backgroundColor(theme, 300),
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue