fix(chat): members popup actions use the Fluent menu row metrics
- Add people / Leave: 32 px rows, 18 px icon in a 20 px slot, inset rounded hover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -2,6 +2,10 @@ use gpui_kit::component::scroll::ScrollableElement as _;
2
2
use gpui_kit::assets::IconName;
3
3
use gpui_kit::component::button::{Button, ButtonVariants as _};
4
4
use gpui_kit::component::dialog::DialogFooter;
5
use gpui_kit::component::fluent::{
6
MENU_ICON_GLYPH, MENU_ICON_LABEL_GAP, MENU_ICON_SLOT, MENU_ITEM_GAP, MENU_ITEM_HEIGHT,
7
MENU_ITEM_PADDING_X, MENU_LIST_PADDING,
8
};
5
9
use gpui_kit::component::popover::{Popover, PopoverState};
6
10
use gpui_kit::component::{Sizable as _, WindowExt as _, h_flex, v_flex};
7
11
use gpui_kit::prelude::FluentBuilder as _;
@@ -27,8 +31,7 @@ const ROW_HEIGHT: f32 = 40.;
27
31
const OWN_ROW_HEIGHT: f32 = 43.;
28
32
const AVATAR_SIZE: f32 = 32.;
29
33
const EDGE_PADDING: f32 = 12.;
30
const ACTION_HEIGHT: f32 = 36.;
31
const ACTION_ICON: f32 = 20.;
34
const ACTION_RADIUS: f32 = 6.;
32
35
const REMOVE_BUTTON: f32 = 24.;
33
36
34
37
pub fn members_popover(app: &Entity<AppState>, chat_id: &str, trigger: Div) -> AnyElement {
@@ -105,7 +108,8 @@ fn members_panel(
105
108
)
106
109
.child(
107
110
v_flex()
108
.py(px(4.))
111
.p(MENU_LIST_PADDING)
112
.gap(MENU_ITEM_GAP)
109
113
.child({
110
114
let (app, popover, chat_id) =
111
115
(app.clone(), popover.clone(), chat_id.to_owned());
@@ -250,13 +254,22 @@ fn remove_button(
250
254
fn action_row(id: &'static str, icon_name: IconName, label: &'static str) -> Stateful<Div> {
251
255
h_flex()
252
256
.id(id)
253
.h(px(ACTION_HEIGHT))
254
.px(px(EDGE_PADDING))
255
.gap(px(8.))
257
.h(MENU_ITEM_HEIGHT)
258
.px(MENU_ITEM_PADDING_X)
259
.gap(MENU_ICON_LABEL_GAP)
256
260
.items_center()
261
.rounded(px(ACTION_RADIUS))
257
262
.text_size(px(14.))
258
263
.text_color(theme::text())
259
.child(icon(icon_name, ACTION_ICON, theme::text_soft()))
264
.child(
265
div()
266
.size(MENU_ICON_SLOT)
267
.flex_none()
268
.flex()
269
.items_center()
270
.justify_center()
271
.child(icon(icon_name, f32::from(MENU_ICON_GLYPH), theme::text_soft())),
272
)
260
273
.child(label)
261
274
}
262
275
@@ -2,6 +2,10 @@ use gpui_kit::component::scroll::ScrollableElement as _;2
use gpui_kit::assets::IconName;2
use gpui_kit::assets::IconName;3
use gpui_kit::component::button::{Button, ButtonVariants as _};3
use gpui_kit::component::button::{Button, ButtonVariants as _};4
use gpui_kit::component::dialog::DialogFooter;4
use gpui_kit::component::dialog::DialogFooter;5
use gpui_kit::component::fluent::{6
MENU_ICON_GLYPH, MENU_ICON_LABEL_GAP, MENU_ICON_SLOT, MENU_ITEM_GAP, MENU_ITEM_HEIGHT,7
MENU_ITEM_PADDING_X, MENU_LIST_PADDING,8
};5
use gpui_kit::component::popover::{Popover, PopoverState};9
use gpui_kit::component::popover::{Popover, PopoverState};6
use gpui_kit::component::{Sizable as _, WindowExt as _, h_flex, v_flex};10
use gpui_kit::component::{Sizable as _, WindowExt as _, h_flex, v_flex};7
use gpui_kit::prelude::FluentBuilder as _;11
use gpui_kit::prelude::FluentBuilder as _;@@ -27,8 +31,7 @@ const ROW_HEIGHT: f32 = 40.;27
const OWN_ROW_HEIGHT: f32 = 43.;31
const OWN_ROW_HEIGHT: f32 = 43.;28
const AVATAR_SIZE: f32 = 32.;32
const AVATAR_SIZE: f32 = 32.;29
const EDGE_PADDING: f32 = 12.;33
const EDGE_PADDING: f32 = 12.;30
const ACTION_HEIGHT: f32 = 36.;34
const ACTION_RADIUS: f32 = 6.;31
const ACTION_ICON: f32 = 20.;32
const REMOVE_BUTTON: f32 = 24.;35
const REMOVE_BUTTON: f32 = 24.;33
36
34
pub fn members_popover(app: &Entity<AppState>, chat_id: &str, trigger: Div) -> AnyElement {37
pub fn members_popover(app: &Entity<AppState>, chat_id: &str, trigger: Div) -> AnyElement {@@ -105,7 +108,8 @@ fn members_panel(105
)108
)106
.child(109
.child(107
v_flex()110
v_flex()108
.py(px(4.))111
.p(MENU_LIST_PADDING)112
.gap(MENU_ITEM_GAP)109
.child({113
.child({110
let (app, popover, chat_id) =114
let (app, popover, chat_id) =111
(app.clone(), popover.clone(), chat_id.to_owned());115
(app.clone(), popover.clone(), chat_id.to_owned());@@ -250,13 +254,22 @@ fn remove_button(250
fn action_row(id: &'static str, icon_name: IconName, label: &'static str) -> Stateful<Div> {254
fn action_row(id: &'static str, icon_name: IconName, label: &'static str) -> Stateful<Div> {251
h_flex()255
h_flex()252
.id(id)256
.id(id)253
.h(px(ACTION_HEIGHT))257
.h(MENU_ITEM_HEIGHT)254
.px(px(EDGE_PADDING))258
.px(MENU_ITEM_PADDING_X)255
.gap(px(8.))259
.gap(MENU_ICON_LABEL_GAP)256
.items_center()260
.items_center()261
.rounded(px(ACTION_RADIUS))257
.text_size(px(14.))262
.text_size(px(14.))258
.text_color(theme::text())263
.text_color(theme::text())259
.child(icon(icon_name, ACTION_ICON, theme::text_soft()))264
.child(265
div()266
.size(MENU_ICON_SLOT)267
.flex_none()268
.flex()269
.items_center()270
.justify_center()271
.child(icon(icon_name, f32::from(MENU_ICON_GLYPH), theme::text_soft())),272
)260
.child(label)273
.child(label)261
}274
}262
275