Brand colours on the marks; round the app's corners; move the lights in
Simple Icons publishes each brand's own hex next to its glyph, and the build was throwing it away. Tiles now carry it - Gmail red, Drive blue, Chat green, Gemini violet - and the glyph is drawn black or white by the tile's perceived brightness, since brand colours are picked to look right rather than to carry a white mark. GitHub and Notion are near-black, Snapchat is pure yellow, and a fixed white glyph loses one end of that. An app's right corners are now rounded on its own layer. The container's rounded-xl could never have clipped them: an app is a native view sitting on top, not something the shell lays out, so it kept square corners and overhung the curve. Only the right pair - the left edge butts against the nav, and rounding it would notch the middle of the window. The traffic lights move to (26, 24) and the drag strip deepens to match, so they sit inside the window's margin instead of against its corner. Adds Gemini, Claude, ChatGPT, Linear, ClickUp, HubSpot, Shopify and Cloudflare to the host table.
This commit is contained in:
@@ -15,6 +15,8 @@ pub type Stage = (f64, f64, f64, f64);
|
||||
|
||||
pub struct AppState {
|
||||
pub dir: PathBuf,
|
||||
/// Corner radius the window's inner frame is currently drawn with.
|
||||
pub radius: Mutex<f64>,
|
||||
pub config: Mutex<Config>,
|
||||
pub active: Mutex<Option<String>>,
|
||||
pub stage: Mutex<Stage>,
|
||||
@@ -65,6 +67,7 @@ pub fn build_state(handle: &AppHandle) -> Result<AppState, String> {
|
||||
let config = config::load(&dir)?;
|
||||
Ok(AppState {
|
||||
dir,
|
||||
radius: Mutex::new(12.0),
|
||||
config: Mutex::new(config),
|
||||
active: Mutex::new(None),
|
||||
stage: Mutex::new((240.0, 38.0, 800.0, 600.0)),
|
||||
@@ -88,13 +91,15 @@ pub fn set_stage(
|
||||
y: f64,
|
||||
width: f64,
|
||||
height: f64,
|
||||
radius: f64,
|
||||
app: AppHandle,
|
||||
state: State<'_, AppState>,
|
||||
) {
|
||||
let stage = (x, y, width.max(0.0), height.max(0.0));
|
||||
*state.stage.lock().unwrap() = stage;
|
||||
*state.radius.lock().unwrap() = radius;
|
||||
let active = state.active.lock().unwrap().clone();
|
||||
webviews::set_stage(&app, active.as_deref(), stage);
|
||||
webviews::set_stage(&app, active.as_deref(), stage, radius);
|
||||
}
|
||||
|
||||
/// Creates every app's webview: the active one first, the rest staggered.
|
||||
@@ -122,6 +127,7 @@ pub fn bootstrap(app: AppHandle, state: State<'_, AppState>) -> Result<(), Strin
|
||||
if let Some(id) = &first {
|
||||
if let Some(a) = cfg.app(id) {
|
||||
webviews::create(&app, a, &cfg, stage)?;
|
||||
webviews::set_corner_radius(&app, &a.id, *state.radius.lock().unwrap());
|
||||
*state.active.lock().unwrap() = Some(id.clone());
|
||||
webviews::show_only(&app, Some(id), &cfg, stage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user