WIP
This commit is contained in:
parent
3ba8857491
commit
5dad97779a
5 changed files with 15 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -7378,6 +7378,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"gpui2",
|
"gpui2",
|
||||||
"log",
|
"log",
|
||||||
|
"refineable",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"serde",
|
"serde",
|
||||||
"settings",
|
"settings",
|
||||||
|
|
|
@ -22,6 +22,8 @@ use gpui2_macros::styleable_helpers;
|
||||||
use refineable::{Refineable, RefinementCascade};
|
use refineable::{Refineable, RefinementCascade};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
pub type StyleCascade = RefinementCascade<Style>;
|
||||||
|
|
||||||
#[derive(Clone, Refineable, Debug)]
|
#[derive(Clone, Refineable, Debug)]
|
||||||
#[refineable(debug)]
|
#[refineable(debug)]
|
||||||
pub struct Style {
|
pub struct Style {
|
||||||
|
|
|
@ -17,6 +17,12 @@ pub trait Refineable: Clone {
|
||||||
{
|
{
|
||||||
Self::default().refined(refinement)
|
Self::default().refined(refinement)
|
||||||
}
|
}
|
||||||
|
fn from_cascade(cascade: &RefinementCascade<Self>) -> Self
|
||||||
|
where
|
||||||
|
Self: Default + Sized,
|
||||||
|
{
|
||||||
|
Self::default().refined(&cascade.merged())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct RefinementCascade<S: Refineable>(Vec<Option<S::Refinement>>);
|
pub struct RefinementCascade<S: Refineable>(Vec<Option<S::Refinement>>);
|
||||||
|
|
|
@ -12,6 +12,7 @@ path = "src/storybook.rs"
|
||||||
gpui2 = { path = "../gpui2" }
|
gpui2 = { path = "../gpui2" }
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
refineable = { path = "../refineable" }
|
||||||
rust-embed.workspace = true
|
rust-embed.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
settings = { path = "../settings" }
|
settings = { path = "../settings" }
|
||||||
|
|
5
crates/storybook/build.rs
Normal file
5
crates/storybook/build.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
fn main() {
|
||||||
|
// Find WebRTC.framework as a sibling of the executable when running outside of an application bundle.
|
||||||
|
// TODO: We shouldn't depend on WebRTC in editor
|
||||||
|
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue