launcher: Sculk's banner at the foot of the sidebar, seen without scrolling

On Home it sat under every row, so nobody saw it without scrolling. It now
sits small (228 px wide) above the Discord and Website links on every page
but Servers, which keeps the large one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-26 22:54:33 +01:00
parent 840d11a3b2
commit b0783dac38
2 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -1749,6 +1749,11 @@ impl Launcher {
}
_ => {}
}
// Sculk's banner, small, above the links: seen without scrolling, on every page but Servers, which
// shows it large.
if self.page != Page::Servers {
foot = foot.child(partner::banner("partner-side", theme::SIDEBAR - 20., &t).mb(px(8.)));
}
if !self.links.discord.is_empty() {
foot = foot.child(link(
"discord",
@@ -2131,8 +2136,7 @@ impl Launcher {
if let Some(crash) = self.crash.clone() {
page = page.child(self.crash_notice(crash, cx));
}
// Below everything the player needs to start, so it never moves Play.
page.child(partner::banner("partner-home", 560., &t))
page
}
/// "Horizon crashed": the report and the logs, and where to report it.
+3 -3
View File
@@ -1,5 +1,5 @@
//! Sculk's banner: a server host that sponsors Horizon (Ludovic, 2026-10-26), on the Servers page
//! and under Home's rows. The picture is in the binary, never fetched; a click opens Sculk's page in
//! Sculk's banner: a server host that sponsors Horizon (Ludovic, 2026-10-26), large on the Servers page
//! and small at the foot of the sidebar on the other pages, where it shows without scrolling. The picture is in the binary, never fetched; a click opens Sculk's page in
//! the browser. A "Partner" label above it says it is an ad.
use crate::theme::Theme;
use gpui::{div, img, prelude::*, px, ClickEvent, Div, Image, ImageFormat, Stateful};
@@ -19,7 +19,7 @@ static BANNER: LazyLock<Arc<Image>> = LazyLock::new(|| {
});
/// The banner `width` logical pixels wide, under its label. Hovering lifts it a little and turns the
/// label to ink. The narrowest window (960) leaves the page 648 pixels, so it always fits.
/// label to ink. The narrowest window (960) leaves the page 648 pixels, so the Servers one always fits.
pub fn banner(id: &'static str, width: f32, t: &Theme) -> Stateful<Div> {
let t = *t;
let el = div()