wip: design
This commit is contained in:
@@ -10,7 +10,7 @@ use gpui::{
|
||||
use serde::Deserialize;
|
||||
use std::sync::Arc;
|
||||
use ui::{
|
||||
dock::{DockArea, DockItem, DockPlacement},
|
||||
dock_area::{dock::DockPlacement, DockArea, DockItem},
|
||||
indicator::Indicator,
|
||||
notification::NotificationType,
|
||||
theme::Theme,
|
||||
|
||||
@@ -3,7 +3,10 @@ use gpui::{
|
||||
div, img, InteractiveElement, IntoElement, ParentElement, RenderOnce, SharedString, Styled,
|
||||
WindowContext,
|
||||
};
|
||||
use ui::{theme::ActiveTheme, StyledExt};
|
||||
use ui::{
|
||||
theme::{scale::ColorScaleStep, ActiveTheme},
|
||||
StyledExt,
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, IntoElement)]
|
||||
pub struct Message {
|
||||
@@ -32,9 +35,8 @@ impl RenderOnce for Message {
|
||||
.border_l_2()
|
||||
.border_color(cx.theme().background)
|
||||
.hover(|this| {
|
||||
this.bg(cx.theme().muted)
|
||||
.border_color(cx.theme().primary_active)
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
this.bg(cx.theme().base.step(cx, ColorScaleStep::TWO))
|
||||
.border_color(cx.theme().accent.step(cx, ColorScaleStep::NINE))
|
||||
})
|
||||
.child(
|
||||
img(self.member.avatar())
|
||||
@@ -58,15 +60,10 @@ impl RenderOnce for Message {
|
||||
.child(
|
||||
div()
|
||||
.child(self.ago)
|
||||
.text_color(cx.theme().muted_foreground),
|
||||
.text_color(cx.theme().base.step(cx, ColorScaleStep::ELEVEN)),
|
||||
),
|
||||
)
|
||||
.child(
|
||||
div()
|
||||
.text_sm()
|
||||
.text_color(cx.theme().foreground)
|
||||
.child(self.content),
|
||||
),
|
||||
.child(div().text_sm().child(self.content)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,13 @@ use nostr_sdk::prelude::*;
|
||||
use std::sync::Arc;
|
||||
use ui::{
|
||||
button::{Button, ButtonVariants},
|
||||
dock::{Panel, PanelEvent, PanelState},
|
||||
dock_area::{
|
||||
panel::{Panel, PanelEvent},
|
||||
state::PanelState,
|
||||
},
|
||||
input::{InputEvent, TextInput},
|
||||
popup_menu::PopupMenu,
|
||||
theme::ActiveTheme,
|
||||
theme::{scale::ColorScaleStep, ActiveTheme},
|
||||
v_flex, Icon, IconName,
|
||||
};
|
||||
|
||||
@@ -374,7 +377,7 @@ impl Render for ChatPanel {
|
||||
div()
|
||||
.flex_1()
|
||||
.flex()
|
||||
.bg(cx.theme().muted)
|
||||
.bg(cx.theme().base.step(cx, ColorScaleStep::FOUR))
|
||||
.rounded(px(cx.theme().radius))
|
||||
.px_2()
|
||||
.child(self.input.clone()),
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
use crate::{constants::KEYRING_SERVICE, get_client, states::app::AppRegistry};
|
||||
use gpui::{div, IntoElement, ParentElement, Render, Styled, View, ViewContext, VisualContext};
|
||||
use nostr_sdk::prelude::*;
|
||||
use ui::{
|
||||
input::{InputEvent, TextInput},
|
||||
label::Label,
|
||||
};
|
||||
use ui::input::{InputEvent, TextInput};
|
||||
|
||||
pub struct Onboarding {
|
||||
input: View<TextInput>,
|
||||
@@ -70,7 +67,7 @@ impl Render for Onboarding {
|
||||
.flex()
|
||||
.flex_col()
|
||||
.gap_1()
|
||||
.child(Label::new("Private Key").text_sm())
|
||||
.child(div().child("Private Key").text_sm())
|
||||
.child(self.input.clone()),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use serde::Deserialize;
|
||||
use std::collections::{BTreeSet, HashSet};
|
||||
use ui::{
|
||||
prelude::FluentBuilder,
|
||||
theme::{ActiveTheme, Colorize},
|
||||
theme::{scale::ColorScaleStep, ActiveTheme},
|
||||
Icon, IconName, Selectable, StyledExt,
|
||||
};
|
||||
|
||||
@@ -95,12 +95,12 @@ impl RenderOnce for ContactListItem {
|
||||
this.child(
|
||||
Icon::new(IconName::CircleCheck)
|
||||
.size_4()
|
||||
.text_color(cx.theme().colors.primary),
|
||||
.text_color(cx.theme().accent.step(cx, ColorScaleStep::NINE)),
|
||||
)
|
||||
})
|
||||
.hover(|this| {
|
||||
this.bg(cx.theme().muted.darken(0.1))
|
||||
.text_color(cx.theme().muted_foreground.darken(0.1))
|
||||
this.bg(cx.theme().base.step(cx, ColorScaleStep::FOUR))
|
||||
.text_color(cx.theme().base.step(cx, ColorScaleStep::ELEVEN))
|
||||
})
|
||||
.on_click(move |_, cx| {
|
||||
cx.dispatch_action(Box::new(SelectContact(self.public_key)));
|
||||
@@ -239,8 +239,8 @@ impl Render for ContactList {
|
||||
.child(
|
||||
div()
|
||||
.p_1()
|
||||
.bg(cx.theme().muted)
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.bg(cx.theme().base.step(cx, ColorScaleStep::THREE))
|
||||
.text_color(cx.theme().base.step(cx, ColorScaleStep::ELEVEN))
|
||||
.rounded_lg()
|
||||
.child(list(self.list.clone()).h(px(300.))),
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ use gpui::{
|
||||
ParentElement, Render, SharedString, StatefulInteractiveElement, Styled, ViewContext,
|
||||
};
|
||||
use ui::{
|
||||
dock_area::dock::DockPlacement,
|
||||
skeleton::Skeleton,
|
||||
theme::{scale::ColorScaleStep, ActiveTheme},
|
||||
v_flex, Collapsible, Icon, IconName, StyledExt,
|
||||
@@ -106,7 +107,7 @@ impl Inbox {
|
||||
fn action(&self, id: u64, cx: &mut ViewContext<Self>) {
|
||||
cx.dispatch_action(Box::new(AddPanel {
|
||||
panel: PanelKind::Room(id),
|
||||
position: ui::dock::DockPlacement::Center,
|
||||
position: DockPlacement::Center,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@ use gpui::{
|
||||
};
|
||||
use ui::{
|
||||
button::{Button, ButtonRounded, ButtonVariants},
|
||||
dock::{Panel, PanelEvent, PanelState},
|
||||
dock_area::{
|
||||
panel::{Panel, PanelEvent},
|
||||
state::PanelState,
|
||||
},
|
||||
popup_menu::PopupMenu,
|
||||
scroll::ScrollbarAxis,
|
||||
v_flex, ContextModal, Icon, IconName, Sizable, StyledExt,
|
||||
|
||||
@@ -4,9 +4,12 @@ use gpui::{
|
||||
};
|
||||
use ui::{
|
||||
button::Button,
|
||||
dock::{Panel, PanelEvent, PanelState},
|
||||
dock_area::{
|
||||
panel::{Panel, PanelEvent},
|
||||
state::PanelState,
|
||||
},
|
||||
popup_menu::PopupMenu,
|
||||
theme::{ActiveTheme, Colorize},
|
||||
theme::{scale::ColorScaleStep, ActiveTheme},
|
||||
StyledExt,
|
||||
};
|
||||
|
||||
@@ -78,7 +81,7 @@ impl Render for WelcomePanel {
|
||||
.items_center()
|
||||
.justify_center()
|
||||
.child("coop on nostr.")
|
||||
.text_color(cx.theme().muted.darken(0.1))
|
||||
.text_color(cx.theme().base.step(cx, ColorScaleStep::THREE))
|
||||
.font_black()
|
||||
.text_sm()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user