fix(composer): emoji and attach icons share one 20 px size
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -9,7 +9,7 @@ use std::time::{Duration, Instant};
9
9
use chrono::{DateTime, Utc};
10
10
use gpui_kit::assets::IconName;
11
11
use gpui_kit::component::{
12
ActiveTheme as _,
12
ActiveTheme as _, Sizable as _,
13
13
button::{Button, ButtonVariants as _},
14
14
h_flex,
15
15
input::{
@@ -63,6 +63,9 @@ const MENTION_QUERY_MAX_WORDS: usize = 3;
63
63
const POPUP_WIDTH: f32 = 380.;
64
64
const POPUP_ROW_HEIGHT: f32 = 44.;
65
65
const DEMO_UPLOAD_STEPS: u8 = 10;
66
const COMPOSER_ICON_SIZE: f32 = 20.;
67
/// gpui-kit draws a `Size::Size` button's icon at this fraction of the button size.
68
const BUTTON_ICON_SCALE: f32 = 0.75;
66
69
const DEMO_UPLOAD_STEP: Duration = Duration::from_millis(120);
67
70
const DEMO_FAILURE_STEP: u8 = 6;
68
71
const HISTORY_LIMIT: usize = 200;
@@ -2469,9 +2472,10 @@ impl Render for Composer {
2469
2472
.trigger(
2470
2473
Button::new("composer-fun")
2471
2474
.ghost()
2475
.with_size(px(COMPOSER_ICON_SIZE / BUTTON_ICON_SCALE))
2472
2476
.size(px(32.))
2473
2477
.tooltip("Emoji, GIFs und Sticker")
2474
.icon(symbol("mood", 20., theme::text_muted())),
2478
.icon(symbol("mood", COMPOSER_ICON_SIZE, theme::text_muted())),
2475
2479
)
2476
2480
.on_open_change(move |open, window, cx| {
2477
2481
if *open {
@@ -2496,7 +2500,7 @@ impl Render for Composer {
2496
2500
.cursor_pointer()
2497
2501
.hover(|button| button.bg(theme::row_hover()))
2498
2502
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))
2499
.child(symbol("attach_file", 20., theme::text_muted()))
2503
.child(symbol("attach_file", COMPOSER_ICON_SIZE, theme::text_muted()))
2500
2504
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))
2501
2505
});
2502
2506
let composer = cx.weak_entity();
@@ -9,7 +9,7 @@ use std::time::{Duration, Instant};9
use chrono::{DateTime, Utc};9
use chrono::{DateTime, Utc};10
use gpui_kit::assets::IconName;10
use gpui_kit::assets::IconName;11
use gpui_kit::component::{11
use gpui_kit::component::{12
ActiveTheme as _,12
ActiveTheme as _, Sizable as _,13
button::{Button, ButtonVariants as _},13
button::{Button, ButtonVariants as _},14
h_flex,14
h_flex,15
input::{15
input::{@@ -63,6 +63,9 @@ const MENTION_QUERY_MAX_WORDS: usize = 3;63
const POPUP_WIDTH: f32 = 380.;63
const POPUP_WIDTH: f32 = 380.;64
const POPUP_ROW_HEIGHT: f32 = 44.;64
const POPUP_ROW_HEIGHT: f32 = 44.;65
const DEMO_UPLOAD_STEPS: u8 = 10;65
const DEMO_UPLOAD_STEPS: u8 = 10;66
const COMPOSER_ICON_SIZE: f32 = 20.;67
/// gpui-kit draws a `Size::Size` button's icon at this fraction of the button size.68
const BUTTON_ICON_SCALE: f32 = 0.75;66
const DEMO_UPLOAD_STEP: Duration = Duration::from_millis(120);69
const DEMO_UPLOAD_STEP: Duration = Duration::from_millis(120);67
const DEMO_FAILURE_STEP: u8 = 6;70
const DEMO_FAILURE_STEP: u8 = 6;68
const HISTORY_LIMIT: usize = 200;71
const HISTORY_LIMIT: usize = 200;@@ -2469,9 +2472,10 @@ impl Render for Composer {2469
.trigger(2472
.trigger(2470
Button::new("composer-fun")2473
Button::new("composer-fun")2471
.ghost()2474
.ghost()2475
.with_size(px(COMPOSER_ICON_SIZE / BUTTON_ICON_SCALE))2472
.size(px(32.))2476
.size(px(32.))2473
.tooltip("Emoji, GIFs und Sticker")2477
.tooltip("Emoji, GIFs und Sticker")2474
.icon(symbol("mood", 20., theme::text_muted())),2478
.icon(symbol("mood", COMPOSER_ICON_SIZE, theme::text_muted())),2475
)2479
)2476
.on_open_change(move |open, window, cx| {2480
.on_open_change(move |open, window, cx| {2477
if *open {2481
if *open {@@ -2496,7 +2500,7 @@ impl Render for Composer {2496
.cursor_pointer()2500
.cursor_pointer()2497
.hover(|button| button.bg(theme::row_hover()))2501
.hover(|button| button.bg(theme::row_hover()))2498
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))2502
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))2499
.child(symbol("attach_file", 20., theme::text_muted()))2503
.child(symbol("attach_file", COMPOSER_ICON_SIZE, theme::text_muted()))2500
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))2504
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))2501
});2505
});2502
let composer = cx.weak_entity();2506
let composer = cx.weak_entity();