replace sign-in banner with simple centered layout
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-16 16:21:23 +07:00
parent f9823e8de1
commit c011f35df4
6 changed files with 25 additions and 49 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

-2
View File
@@ -5,8 +5,6 @@ use rust_embed::RustEmbed;
#[derive(RustEmbed)] #[derive(RustEmbed)]
#[folder = "assets"] #[folder = "assets"]
#[include = "icons/**/*.svg"] #[include = "icons/**/*.svg"]
#[include = "backgrounds/**/*.jpg"]
#[include = "backgrounds/**/*.png"]
#[exclude = "*.DS_Store"] #[exclude = "*.DS_Store"]
pub struct Assets; pub struct Assets;
+25 -47
View File
@@ -1,8 +1,5 @@
use std::time::{SystemTime, UNIX_EPOCH};
use gpui::{ use gpui::{
Context, IntoElement, ObjectFit, ParentElement as _, Render, SharedString, Styled as _, Context, FontWeight, IntoElement, ParentElement as _, Render, Styled as _, Window, div,
StyledImage as _, Window, div, img,
}; };
use gpui_native_kit::button::{Button, ButtonVariant}; use gpui_native_kit::button::{Button, ButtonVariant};
use gpui_native_kit::common::v_flex; use gpui_native_kit::common::v_flex;
@@ -10,15 +7,11 @@ use gpui_native_kit::layout::panel::Panel;
use crate::identity; use crate::identity;
pub struct SignedOutView { pub struct SignedOutView;
banner: SharedString,
}
impl SignedOutView { impl SignedOutView {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self
banner: pick_banner(),
}
} }
} }
@@ -28,49 +21,34 @@ impl Render for SignedOutView {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement { fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
v_flex() v_flex()
.size_full() .size_full()
.relative() .items_center()
.justify_center()
.gap_4()
.child( .child(
div().absolute().inset_0().child( div()
img(self.banner.clone()) .text_2xl()
.size_full() .font_weight(FontWeight::SEMIBOLD)
.object_fit(ObjectFit::Cover), .child("Signed"),
),
) )
.child( .child(
v_flex() v_flex()
.size_full() .gap_1()
.justify_end() .w_48()
.p_4()
.gap_4()
.child(img("backgrounds/headline.png").max_w_48())
.child( .child(
v_flex() Button::new("onboarding")
.gap_1() .label("Join now")
.w_full() .on_click(|_, _, cx| {
.child(Button::new("onboarding").label("Join now").on_click( identity::helpers::open_onboarding(cx);
|_, _, cx| { }),
identity::helpers::open_onboarding(cx); )
}, .child(
)) Button::new("import")
.child( .label("Import identity")
Button::new("import") .variant(ButtonVariant::Secondary)
.label("Import identity") .on_click(|_, _, cx| {
.variant(ButtonVariant::Secondary) identity::helpers::open_import(cx);
.on_click(|_, _, cx| { }),
identity::helpers::open_import(cx);
}),
),
), ),
) )
} }
} }
fn pick_banner() -> SharedString {
let num = SystemTime::now()
.duration_since(UNIX_EPOCH)
.map(|duration| duration.subsec_nanos())
.unwrap_or(1)
% 3
+ 1;
format!("backgrounds/banner{num}.jpg").into()
}