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