mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Use the same background color as the editor for SharedScreen
This commit is contained in:
parent
a7d86a164c
commit
56a66b348d
4 changed files with 16 additions and 1 deletions
|
@ -28,6 +28,7 @@ pub struct Theme {
|
||||||
pub search: Search,
|
pub search: Search,
|
||||||
pub project_diagnostics: ProjectDiagnostics,
|
pub project_diagnostics: ProjectDiagnostics,
|
||||||
pub breadcrumbs: ContainedText,
|
pub breadcrumbs: ContainedText,
|
||||||
|
pub shared_screen: ContainerStyle,
|
||||||
pub contact_notification: ContactNotification,
|
pub contact_notification: ContactNotification,
|
||||||
pub update_notification: UpdateNotification,
|
pub update_notification: UpdateNotification,
|
||||||
pub project_shared_notification: ProjectSharedNotification,
|
pub project_shared_notification: ProjectSharedNotification,
|
||||||
|
|
|
@ -8,6 +8,7 @@ use gpui::{
|
||||||
geometry::{rect::RectF, vector::vec2f},
|
geometry::{rect::RectF, vector::vec2f},
|
||||||
Entity, ModelHandle, MouseButton, RenderContext, Task, View, ViewContext,
|
Entity, ModelHandle, MouseButton, RenderContext, Task, View, ViewContext,
|
||||||
};
|
};
|
||||||
|
use settings::Settings;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::{
|
use std::{
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
|
@ -67,7 +68,7 @@ impl View for SharedScreen {
|
||||||
enum Focus {}
|
enum Focus {}
|
||||||
|
|
||||||
let frame = self.frame.clone();
|
let frame = self.frame.clone();
|
||||||
MouseEventHandler::<Focus>::new(0, cx, |_, _| {
|
MouseEventHandler::<Focus>::new(0, cx, |_, cx| {
|
||||||
Canvas::new(move |bounds, _, cx| {
|
Canvas::new(move |bounds, _, cx| {
|
||||||
if let Some(frame) = frame.clone() {
|
if let Some(frame) = frame.clone() {
|
||||||
let size = constrain_size_preserving_aspect_ratio(
|
let size = constrain_size_preserving_aspect_ratio(
|
||||||
|
@ -81,6 +82,8 @@ impl View for SharedScreen {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.contained()
|
||||||
|
.with_style(cx.global::<Settings>().theme.shared_screen)
|
||||||
.boxed()
|
.boxed()
|
||||||
})
|
})
|
||||||
.on_down(MouseButton::Left, |_, cx| cx.focus_parent_view())
|
.on_down(MouseButton::Left, |_, cx| cx.focus_parent_view())
|
||||||
|
|
|
@ -8,6 +8,7 @@ import search from "./search";
|
||||||
import picker from "./picker";
|
import picker from "./picker";
|
||||||
import workspace from "./workspace";
|
import workspace from "./workspace";
|
||||||
import contextMenu from "./contextMenu";
|
import contextMenu from "./contextMenu";
|
||||||
|
import sharedScreen from "./sharedScreen";
|
||||||
import projectDiagnostics from "./projectDiagnostics";
|
import projectDiagnostics from "./projectDiagnostics";
|
||||||
import contactNotification from "./contactNotification";
|
import contactNotification from "./contactNotification";
|
||||||
import updateNotification from "./updateNotification";
|
import updateNotification from "./updateNotification";
|
||||||
|
@ -38,6 +39,7 @@ export default function app(colorScheme: ColorScheme): Object {
|
||||||
contactFinder: contactFinder(colorScheme),
|
contactFinder: contactFinder(colorScheme),
|
||||||
contactList: contactList(colorScheme),
|
contactList: contactList(colorScheme),
|
||||||
search: search(colorScheme),
|
search: search(colorScheme),
|
||||||
|
sharedScreen: sharedScreen(colorScheme),
|
||||||
breadcrumbs: {
|
breadcrumbs: {
|
||||||
...text(colorScheme.highest, "sans", "variant"),
|
...text(colorScheme.highest, "sans", "variant"),
|
||||||
padding: {
|
padding: {
|
||||||
|
|
9
styles/src/styleTree/sharedScreen.ts
Normal file
9
styles/src/styleTree/sharedScreen.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { ColorScheme } from "../themes/common/colorScheme";
|
||||||
|
import { background } from "./components";
|
||||||
|
|
||||||
|
export default function sharedScreen(colorScheme: ColorScheme) {
|
||||||
|
let layer = colorScheme.highest;
|
||||||
|
return {
|
||||||
|
background: background(layer)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue