From 3ee4d90c19f788e4dbd8b39feee30fc4362df711 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 3 May 2022 18:04:53 +0200 Subject: [PATCH] Parameterize `avatar_margin` and assign it a default of 8 --- assets/themes/cave-dark.json | 1 + assets/themes/cave-light.json | 1 + assets/themes/dark.json | 1 + assets/themes/light.json | 1 + assets/themes/solarized-dark.json | 1 + assets/themes/solarized-light.json | 1 + assets/themes/sulphurpool-dark.json | 1 + assets/themes/sulphurpool-light.json | 1 + crates/theme/src/theme.rs | 1 + crates/workspace/src/workspace.rs | 2 +- styles/src/styleTree/workspace.ts | 1 + 11 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/themes/cave-dark.json b/assets/themes/cave-dark.json index a60802ac65..4b53480c79 100644 --- a/assets/themes/cave-dark.json +++ b/assets/themes/cave-dark.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#26232a", "padding": { diff --git a/assets/themes/cave-light.json b/assets/themes/cave-light.json index b18509d2a9..54e4e6eac8 100644 --- a/assets/themes/cave-light.json +++ b/assets/themes/cave-light.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#e2dfe7", "padding": { diff --git a/assets/themes/dark.json b/assets/themes/dark.json index 3a8b5cfa9f..91b0e57ac2 100644 --- a/assets/themes/dark.json +++ b/assets/themes/dark.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#2b2b2b", "padding": { diff --git a/assets/themes/light.json b/assets/themes/light.json index 80d755a4d9..b66a8fe9ec 100644 --- a/assets/themes/light.json +++ b/assets/themes/light.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#eaeaea", "padding": { diff --git a/assets/themes/solarized-dark.json b/assets/themes/solarized-dark.json index f494774ebf..92d340a9b4 100644 --- a/assets/themes/solarized-dark.json +++ b/assets/themes/solarized-dark.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#073642", "padding": { diff --git a/assets/themes/solarized-light.json b/assets/themes/solarized-light.json index 201d87bb9d..ee5acf2712 100644 --- a/assets/themes/solarized-light.json +++ b/assets/themes/solarized-light.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#eee8d5", "padding": { diff --git a/assets/themes/sulphurpool-dark.json b/assets/themes/sulphurpool-dark.json index b79eb48b64..7ae3c88703 100644 --- a/assets/themes/sulphurpool-dark.json +++ b/assets/themes/sulphurpool-dark.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#293256", "padding": { diff --git a/assets/themes/sulphurpool-light.json b/assets/themes/sulphurpool-light.json index 5e7fabc286..69eb194e3c 100644 --- a/assets/themes/sulphurpool-light.json +++ b/assets/themes/sulphurpool-light.json @@ -346,6 +346,7 @@ }, "titlebar": { "avatar_width": 18, + "avatar_margin": 8, "height": 33, "background": "#dfe2f1", "padding": { diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 45f7dcf5db..c0959a0e5e 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -53,6 +53,7 @@ pub struct Titlebar { pub height: f32, pub title: TextStyle, pub avatar_width: f32, + pub avatar_margin: f32, pub avatar_ribbon: AvatarRibbon, pub offline_icon: OfflineIcon, pub share_icon: Interactive, diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index f3fe7e3c02..d072c51550 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -1629,7 +1629,7 @@ impl Workspace { .constrained() .with_width(theme.workspace.titlebar.avatar_width) .contained() - .with_margin_left(2.) + .with_margin_left(theme.workspace.titlebar.avatar_margin) .boxed(); if let Some(peer_id) = peer_id { diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index 0a9b55078b..f74715ac0b 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -61,6 +61,7 @@ export default function workspace(theme: Theme) { statusBar: statusBar(theme), titlebar: { avatarWidth: 18, + avatarMargin: 8, height: 33, background: backgroundColor(theme, 100), padding: {