fix(ui): islands spacing grid, call view as islands, unified call icons
- One spacing grid: list content edge 16, chat content edge 20 (header, pin banner, tabs, New post, messages, cards, composer) - Islands get 6 px above and below, rail sits flush with the list island, no negative margin - Rail items 48x52 with badges anchored to the icon - Close buttons 28x28 with equal top/right inset - Call view: stage and call chat are separate islands, no header/controls/panel lines, tiles without borders - Call controls use one icon set at one size (hand and reactions were an emoji and a Material symbol), camera menu joined to the camera button - Fix: conversation width calc counted a rail gap that no longer exists Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -18,7 +18,7 @@ use crate::theme;
18
18
19
19
const AVATAR_SIZE: f32 = 32.;
20
20
const KIND_MARKER_SIZE: f32 = 16.;
21
const BUTTON_SIZE: f32 = 28.;
21
const BUTTON_SIZE: f32 = 32.;
22
22
const MARK_READ_SIZE: f32 = 20.;
23
23
const FILTER_KEY: &str = "activity_filter";
24
24
@@ -92,7 +92,7 @@ impl ActivityPanel {
92
92
format!("activity-filter-{}", filter.label()).into(),
93
93
))
94
94
.h(px(24.))
95
.px(px(10.))
95
.px(px(12.))
96
96
.flex()
97
97
.items_center()
98
98
.rounded_full()
@@ -115,13 +115,11 @@ impl ActivityPanel {
115
115
});
116
116
v_flex()
117
117
.flex_none()
118
.pl(px(16.))
119
.pr(px(12.))
120
.pt(px(12.))
121
.pb(px(8.))
122
.gap(px(8.))
123
118
.child(
124
119
h_flex()
120
.h(px(52.))
121
.pl(px(16.))
122
.pr(px(12.))
125
123
.gap(px(4.))
126
124
.items_center()
127
125
.child(
@@ -139,7 +137,7 @@ impl ActivityPanel {
139
137
.h(px(BUTTON_SIZE))
140
138
.flex()
141
139
.items_center()
142
.rounded(px(6.))
140
.rounded(px(8.))
143
141
.cursor_pointer()
144
142
.text_size(px(12.))
145
143
.text_color(theme::accent_text())
@@ -158,7 +156,7 @@ impl ActivityPanel {
158
156
.flex_none()
159
157
.items_center()
160
158
.justify_center()
161
.rounded(px(6.))
159
.rounded(px(8.))
162
160
.cursor_pointer()
163
161
.hover(|button| button.bg(theme::surface_raised()))
164
162
.child(icon(IconName::Settings, 16., theme::text_muted()))
@@ -167,7 +165,13 @@ impl ActivityPanel {
167
165
})),
168
166
),
169
167
)
170
.child(h_flex().gap(px(6.)).children(pills))
168
.child(
169
h_flex()
170
.px(px(16.))
171
.pb(px(12.))
172
.gap(px(6.))
173
.children(pills),
174
)
171
175
}
172
176
173
177
fn row(
@@ -197,7 +201,7 @@ impl ActivityPanel {
197
201
.mx(px(6.))
198
202
.px(px(10.))
199
203
.py(px(8.))
200
.gap(px(10.))
204
.gap(px(12.))
201
205
.items_start()
202
206
.rounded(px(8.))
203
207
.cursor_pointer()
@@ -292,8 +296,6 @@ fn status_slot(
292
296
.items_center()
293
297
.justify_center()
294
298
.rounded(px(6.))
295
.border_1()
296
.border_color(theme::border_strong())
297
299
.bg(theme::surface_raised())
298
300
.cursor_pointer()
299
301
.child(icon(IconName::Check, 12., theme::text()))
@@ -18,7 +18,7 @@ use crate::theme;18
18
19
const AVATAR_SIZE: f32 = 32.;19
const AVATAR_SIZE: f32 = 32.;20
const KIND_MARKER_SIZE: f32 = 16.;20
const KIND_MARKER_SIZE: f32 = 16.;21
const BUTTON_SIZE: f32 = 28.;21
const BUTTON_SIZE: f32 = 32.;22
const MARK_READ_SIZE: f32 = 20.;22
const MARK_READ_SIZE: f32 = 20.;23
const FILTER_KEY: &str = "activity_filter";23
const FILTER_KEY: &str = "activity_filter";24
24
@@ -92,7 +92,7 @@ impl ActivityPanel {92
format!("activity-filter-{}", filter.label()).into(),92
format!("activity-filter-{}", filter.label()).into(),93
))93
))94
.h(px(24.))94
.h(px(24.))95
.px(px(10.))95
.px(px(12.))96
.flex()96
.flex()97
.items_center()97
.items_center()98
.rounded_full()98
.rounded_full()@@ -115,13 +115,11 @@ impl ActivityPanel {115
});115
});116
v_flex()116
v_flex()117
.flex_none()117
.flex_none()118
.pl(px(16.))119
.pr(px(12.))120
.pt(px(12.))121
.pb(px(8.))122
.gap(px(8.))123
.child(118
.child(124
h_flex()119
h_flex()120
.h(px(52.))121
.pl(px(16.))122
.pr(px(12.))125
.gap(px(4.))123
.gap(px(4.))126
.items_center()124
.items_center()127
.child(125
.child(@@ -139,7 +137,7 @@ impl ActivityPanel {139
.h(px(BUTTON_SIZE))137
.h(px(BUTTON_SIZE))140
.flex()138
.flex()141
.items_center()139
.items_center()142
.rounded(px(6.))140
.rounded(px(8.))143
.cursor_pointer()141
.cursor_pointer()144
.text_size(px(12.))142
.text_size(px(12.))145
.text_color(theme::accent_text())143
.text_color(theme::accent_text())@@ -158,7 +156,7 @@ impl ActivityPanel {158
.flex_none()156
.flex_none()159
.items_center()157
.items_center()160
.justify_center()158
.justify_center()161
.rounded(px(6.))159
.rounded(px(8.))162
.cursor_pointer()160
.cursor_pointer()163
.hover(|button| button.bg(theme::surface_raised()))161
.hover(|button| button.bg(theme::surface_raised()))164
.child(icon(IconName::Settings, 16., theme::text_muted()))162
.child(icon(IconName::Settings, 16., theme::text_muted()))@@ -167,7 +165,13 @@ impl ActivityPanel {167
})),165
})),168
),166
),169
)167
)170
.child(h_flex().gap(px(6.)).children(pills))168
.child(169
h_flex()170
.px(px(16.))171
.pb(px(12.))172
.gap(px(6.))173
.children(pills),174
)171
}175
}172
176
173
fn row(177
fn row(@@ -197,7 +201,7 @@ impl ActivityPanel {197
.mx(px(6.))201
.mx(px(6.))198
.px(px(10.))202
.px(px(10.))199
.py(px(8.))203
.py(px(8.))200
.gap(px(10.))204
.gap(px(12.))201
.items_start()205
.items_start()202
.rounded(px(8.))206
.rounded(px(8.))203
.cursor_pointer()207
.cursor_pointer()@@ -292,8 +296,6 @@ fn status_slot(292
.items_center()296
.items_center()293
.justify_center()297
.justify_center()294
.rounded(px(6.))298
.rounded(px(6.))295
.border_1()296
.border_color(theme::border_strong())297
.bg(theme::surface_raised())299
.bg(theme::surface_raised())298
.cursor_pointer()300
.cursor_pointer()299
.child(icon(IconName::Check, 12., theme::text()))301
.child(icon(IconName::Check, 12., theme::text()))@@ -26,9 +26,10 @@ const PREVIEW_HEIGHT: f32 = 120.;
26
26
const PREVIEW_GAP: f32 = 4.;
27
27
const PREVIEW_RADIUS: f32 = 10.;
28
28
const CHIP_WIDTH: f32 = 220.;
29
const CHIP_HEIGHT: f32 = 48.;
29
const CHIP_HEIGHT: f32 = 52.;
30
30
const CHIP_BADGE_SIZE: f32 = 30.;
31
31
const REMOVE_SIZE: f32 = 18.;
32
const CHIP_REMOVE_SIZE: f32 = 28.;
32
33
const TRAY_GAP: f32 = 8.;
33
34
const PROGRESS_HEIGHT: f32 = 2.;
34
35
@@ -780,15 +781,15 @@ type ItemAction<T> = fn(&mut T, u64, &mut Window, &mut Context<T>);
780
781
fn remove_button<T: 'static>(id: u64, remove: ItemAction<T>, cx: &mut Context<T>) -> Stateful<Div> {
781
782
div()
782
783
.id(ElementId::Name(format!("attachment-remove-{id}").into()))
783
.size(px(REMOVE_SIZE))
784
.size(px(CHIP_REMOVE_SIZE))
784
785
.flex_none()
785
786
.flex()
786
787
.items_center()
787
788
.justify_center()
788
.rounded_full()
789
.rounded(px(7.))
789
790
.cursor_pointer()
790
.hover(|button| button.bg(theme::row_hover()))
791
.child(icon(IconName::Close, 10., theme::text_muted()))
791
.hover(|button| button.bg(theme::popup_hover()))
792
.child(icon(IconName::Close, 14., theme::text_muted()))
792
793
.on_click(cx.listener(move |this, _, window, cx| remove(this, id, window, cx)))
793
794
}
794
795
@@ -904,10 +905,10 @@ fn chip<T: 'static>(
904
905
.w(px(CHIP_WIDTH))
905
906
.h(px(CHIP_HEIGHT))
906
907
.flex_none()
907
.gap(px(9.))
908
.px(px(9.))
908
.gap(px(12.))
909
.px(px(12.))
909
910
.items_center()
910
.rounded(px(8.))
911
.rounded(px(10.))
911
912
.overflow_hidden()
912
913
.bg(theme::popup_hover())
913
914
.border_1()
@@ -985,8 +986,8 @@ pub fn render_tray<T: 'static>(
985
986
.w_full()
986
987
.flex_wrap()
987
988
.gap(px(TRAY_GAP))
988
.px(px(12.))
989
.pt(px(10.))
989
.px(px(8.))
990
.pt(px(8.))
990
991
.pb(px(2.))
991
992
.children(elements),
992
993
)
@@ -26,9 +26,10 @@ const PREVIEW_HEIGHT: f32 = 120.;26
const PREVIEW_GAP: f32 = 4.;26
const PREVIEW_GAP: f32 = 4.;27
const PREVIEW_RADIUS: f32 = 10.;27
const PREVIEW_RADIUS: f32 = 10.;28
const CHIP_WIDTH: f32 = 220.;28
const CHIP_WIDTH: f32 = 220.;29
const CHIP_HEIGHT: f32 = 48.;29
const CHIP_HEIGHT: f32 = 52.;30
const CHIP_BADGE_SIZE: f32 = 30.;30
const CHIP_BADGE_SIZE: f32 = 30.;31
const REMOVE_SIZE: f32 = 18.;31
const REMOVE_SIZE: f32 = 18.;32
const CHIP_REMOVE_SIZE: f32 = 28.;32
const TRAY_GAP: f32 = 8.;33
const TRAY_GAP: f32 = 8.;33
const PROGRESS_HEIGHT: f32 = 2.;34
const PROGRESS_HEIGHT: f32 = 2.;34
35
@@ -780,15 +781,15 @@ type ItemAction<T> = fn(&mut T, u64, &mut Window, &mut Context<T>);780
fn remove_button<T: 'static>(id: u64, remove: ItemAction<T>, cx: &mut Context<T>) -> Stateful<Div> {781
fn remove_button<T: 'static>(id: u64, remove: ItemAction<T>, cx: &mut Context<T>) -> Stateful<Div> {781
div()782
div()782
.id(ElementId::Name(format!("attachment-remove-{id}").into()))783
.id(ElementId::Name(format!("attachment-remove-{id}").into()))783
.size(px(REMOVE_SIZE))784
.size(px(CHIP_REMOVE_SIZE))784
.flex_none()785
.flex_none()785
.flex()786
.flex()786
.items_center()787
.items_center()787
.justify_center()788
.justify_center()788
.rounded_full()789
.rounded(px(7.))789
.cursor_pointer()790
.cursor_pointer()790
.hover(|button| button.bg(theme::row_hover()))791
.hover(|button| button.bg(theme::popup_hover()))791
.child(icon(IconName::Close, 10., theme::text_muted()))792
.child(icon(IconName::Close, 14., theme::text_muted()))792
.on_click(cx.listener(move |this, _, window, cx| remove(this, id, window, cx)))793
.on_click(cx.listener(move |this, _, window, cx| remove(this, id, window, cx)))793
}794
}794
795
@@ -904,10 +905,10 @@ fn chip<T: 'static>(904
.w(px(CHIP_WIDTH))905
.w(px(CHIP_WIDTH))905
.h(px(CHIP_HEIGHT))906
.h(px(CHIP_HEIGHT))906
.flex_none()907
.flex_none()907
.gap(px(9.))908
.gap(px(12.))908
.px(px(9.))909
.px(px(12.))909
.items_center()910
.items_center()910
.rounded(px(8.))911
.rounded(px(10.))911
.overflow_hidden()912
.overflow_hidden()912
.bg(theme::popup_hover())913
.bg(theme::popup_hover())913
.border_1()914
.border_1()@@ -985,8 +986,8 @@ pub fn render_tray<T: 'static>(985
.w_full()986
.w_full()986
.flex_wrap()987
.flex_wrap()987
.gap(px(TRAY_GAP))988
.gap(px(TRAY_GAP))988
.px(px(12.))989
.px(px(8.))989
.pt(px(10.))990
.pt(px(8.))990
.pb(px(2.))991
.pb(px(2.))991
.children(elements),992
.children(elements),992
)993
)@@ -239,11 +239,11 @@ fn file_view(
239
239
.overflow_hidden()
240
240
.w(px(FILE_CARD_WIDTH))
241
241
.max_w(relative(1.))
242
.gap(px(10.))
242
.gap(px(12.))
243
243
.px(px(8.))
244
.py(px(7.))
244
.py(px(8.))
245
245
.items_center()
246
.rounded(px(9.))
246
.rounded(px(10.))
247
247
.bg(theme::surface())
248
248
.cursor_pointer()
249
249
.hover(|card| card.bg(theme::row_hover()))
@@ -239,11 +239,11 @@ fn file_view(239
.overflow_hidden()239
.overflow_hidden()240
.w(px(FILE_CARD_WIDTH))240
.w(px(FILE_CARD_WIDTH))241
.max_w(relative(1.))241
.max_w(relative(1.))242
.gap(px(10.))242
.gap(px(12.))243
.px(px(8.))243
.px(px(8.))244
.py(px(7.))244
.py(px(8.))245
.items_center()245
.items_center()246
.rounded(px(9.))246
.rounded(px(10.))247
.bg(theme::surface())247
.bg(theme::surface())248
.cursor_pointer()248
.cursor_pointer()249
.hover(|card| card.bg(theme::row_hover()))249
.hover(|card| card.bg(theme::row_hover()))@@ -78,7 +78,7 @@ pub fn hold_panel(app: &Entity<AppState>, model: &CallModel) -> Option<AnyElemen
78
78
.min_h_0()
79
79
.items_center()
80
80
.justify_center()
81
.gap(px(14.))
81
.gap(px(12.))
82
82
.child(
83
83
div()
84
84
.size(px(96.))
@@ -113,7 +113,7 @@ pub fn whiteboard_stage(app: &Entity<AppState>, model: &CallModel) -> Option<Any
113
113
.h_full()
114
114
.items_center()
115
115
.justify_center()
116
.gap(px(14.))
116
.gap(px(12.))
117
117
.rounded(px(STAGE_RADIUS))
118
118
.bg(hsla(0., 0., 0.04, 1.))
119
119
.text_color(theme::white())
@@ -179,12 +179,9 @@ pub fn consent_overlay(app: &Entity<AppState>, model: &CallModel) -> Option<AnyE
179
179
.max_w(relative(1.))
180
180
.p(px(20.))
181
181
.gap(px(12.))
182
.rounded(px(12.))
183
.bg(theme::background())
184
.border_1()
185
.border_color(theme::border_strong())
182
.rounded(px(10.))
183
.bg(theme::popup())
186
184
.text_color(theme::text())
187
.shadow_lg()
188
185
.occlude()
189
186
.child(
190
187
h_flex()
@@ -78,7 +78,7 @@ pub fn hold_panel(app: &Entity<AppState>, model: &CallModel) -> Option<AnyElemen78
.min_h_0()78
.min_h_0()79
.items_center()79
.items_center()80
.justify_center()80
.justify_center()81
.gap(px(14.))81
.gap(px(12.))82
.child(82
.child(83
div()83
div()84
.size(px(96.))84
.size(px(96.))@@ -113,7 +113,7 @@ pub fn whiteboard_stage(app: &Entity<AppState>, model: &CallModel) -> Option<Any113
.h_full()113
.h_full()114
.items_center()114
.items_center()115
.justify_center()115
.justify_center()116
.gap(px(14.))116
.gap(px(12.))117
.rounded(px(STAGE_RADIUS))117
.rounded(px(STAGE_RADIUS))118
.bg(hsla(0., 0., 0.04, 1.))118
.bg(hsla(0., 0., 0.04, 1.))119
.text_color(theme::white())119
.text_color(theme::white())@@ -179,12 +179,9 @@ pub fn consent_overlay(app: &Entity<AppState>, model: &CallModel) -> Option<AnyE179
.max_w(relative(1.))179
.max_w(relative(1.))180
.p(px(20.))180
.p(px(20.))181
.gap(px(12.))181
.gap(px(12.))182
.rounded(px(12.))182
.rounded(px(10.))183
.bg(theme::background())183
.bg(theme::popup())184
.border_1()185
.border_color(theme::border_strong())186
.text_color(theme::text())184
.text_color(theme::text())187
.shadow_lg()188
.occlude()185
.occlude()189
.child(186
.child(190
h_flex()187
h_flex()@@ -25,14 +25,14 @@ const PILL_HEIGHT: f32 = 26.;
25
25
const LOBBY_LIST_WIDTH: f32 = 340.;
26
26
const LOBBY_NAME_LIMIT: usize = 28;
27
27
const CAPTION_WIDTH: f32 = 720.;
28
const CAPTION_BOTTOM: f32 = 2. * 18. + CONTROL_SIZE + 1. + 16.;
28
const CAPTION_BOTTOM: f32 = 2. * 16. + CONTROL_SIZE + 16.;
29
29
const CAPTION_FADE_SECONDS: f32 = 1.;
30
30
const CAPTION_BACKGROUND: f32 = 0.72;
31
31
const FOCUS_RADIUS: f32 = 12.;
32
32
const FOCUS_AVATAR: f32 = 140.;
33
33
const CHIP_HEIGHT: f32 = 24.;
34
34
const MORE_SIZE: f32 = 28.;
35
const SMALL_CONTROL: f32 = 28.;
35
const CAMERA_MENU_WIDTH: f32 = 28.;
36
36
const NAME_LIMIT: usize = 32;
37
37
38
38
fn dark_text() -> Hsla {
@@ -40,7 +40,7 @@ fn dark_text() -> Hsla {
40
40
}
41
41
42
42
pub(super) fn pill(id: impl Into<ElementId>, label: &'static str, filled: bool) -> Stateful<Div> {
43
let (background, foreground) = if filled { (dark_text(), theme::white()) } else { (transparent_black(), dark_text()) };
43
let (background, foreground) = if filled { (dark_text(), theme::white()) } else { (dark_text().opacity(0.12), dark_text()) };
44
44
div()
45
45
.id(id)
46
46
.h(px(PILL_HEIGHT))
@@ -49,8 +49,6 @@ pub(super) fn pill(id: impl Into<ElementId>, label: &'static str, filled: bool)
49
49
.flex_none()
50
50
.items_center()
51
51
.rounded_full()
52
.border_1()
53
.border_color(dark_text())
54
52
.bg(background)
55
53
.text_color(foreground)
56
54
.text_size(px(BANNER_TEXT))
@@ -200,7 +198,7 @@ pub fn tile_menu(popup: PopupMenu, app: &Entity<AppState>, model: &CallModel, mr
200
198
201
199
fn more_overlay(app: &Entity<AppState>, model: &CallModel, mri: &str, name: &str, own: bool, group: SharedString) -> Div {
202
200
let (app, model, mri_owned, name) = (app.clone(), model.clone(), mri.to_owned(), name.to_owned());
203
div().absolute().top(px(10.)).right(px(38.)).opacity(0.).group_hover(group, |more| more.opacity(1.)).child(
201
div().absolute().top(px(6.)).right(px(38.)).opacity(0.).group_hover(group, |more| more.opacity(1.)).child(
204
202
Button::new(SharedString::from(format!("call-tile-more-{mri}")))
205
203
.icon(IconName::Ellipsis)
206
204
.ghost()
@@ -323,17 +321,17 @@ pub fn camera_menu_button(app: &Entity<AppState>, model: &CallModel, backgrounds
323
321
Button::new("call-camera-menu")
324
322
.ghost()
325
323
.p_0()
326
.size(px(SMALL_CONTROL))
324
.w(px(CAMERA_MENU_WIDTH))
325
.h(px(super::call_view::CONTROL_SIZE))
327
326
.rounded_full()
328
327
.child(
329
328
div()
330
329
.id("call-camera-menu-face")
331
.size(px(SMALL_CONTROL))
330
.w(px(CAMERA_MENU_WIDTH))
331
.h(px(super::call_view::CONTROL_SIZE))
332
332
.flex()
333
333
.items_center()
334
334
.justify_center()
335
.rounded_full()
336
.bg(theme::surface_raised())
337
335
.child(icon(IconName::ChevronUp, 16., theme::text())),
338
336
)
339
337
.dropdown_menu_with_anchor(Anchor::BottomLeft, move |popup, _, _| camera_menu(popup, &app, &model, &backgrounds))
@@ -375,7 +373,7 @@ pub fn captions_overlay(model: &CallModel, now: Instant) -> Option<AnyElement> {
375
373
.max_w_full()
376
374
.gap(px(4.))
377
375
.px(px(16.))
378
.py(px(10.))
376
.py(px(8.))
379
377
.rounded(px(10.))
380
378
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))
381
379
.text_color(theme::white())
@@ -454,8 +452,8 @@ pub fn render_focus_stage(app: &Entity<AppState>, state: &AppState, focus: &Focu
454
452
.child(
455
453
h_flex()
456
454
.absolute()
457
.top(px(14.))
458
.left(px(14.))
455
.top(px(12.))
456
.left(px(12.))
459
457
.gap(px(6.))
460
458
.when(focus.spotlight, |chips| chips.child(spotlight_chip()))
461
459
.when(focus.pinned, |chips| chips.child(pin_chip())),
@@ -463,10 +461,10 @@ pub fn render_focus_stage(app: &Entity<AppState>, state: &AppState, focus: &Focu
463
461
.child(
464
462
h_flex()
465
463
.absolute()
466
.left(px(14.))
467
.bottom(px(14.))
464
.left(px(12.))
465
.bottom(px(12.))
468
466
.gap(px(8.))
469
.px(px(10.))
467
.px(px(8.))
470
468
.py(px(4.))
471
469
.rounded(px(6.))
472
470
.bg(hsla(0., 0., 0., 0.6))
@@ -500,7 +498,7 @@ pub fn captions_hint_chip(model: &CallModel) -> Option<AnyElement> {
500
498
.justify_center()
501
499
.child(
502
500
div()
503
.px(px(14.))
501
.px(px(12.))
504
502
.py(px(6.))
505
503
.rounded_full()
506
504
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))
@@ -25,14 +25,14 @@ const PILL_HEIGHT: f32 = 26.;25
const LOBBY_LIST_WIDTH: f32 = 340.;25
const LOBBY_LIST_WIDTH: f32 = 340.;26
const LOBBY_NAME_LIMIT: usize = 28;26
const LOBBY_NAME_LIMIT: usize = 28;27
const CAPTION_WIDTH: f32 = 720.;27
const CAPTION_WIDTH: f32 = 720.;28
const CAPTION_BOTTOM: f32 = 2. * 18. + CONTROL_SIZE + 1. + 16.;28
const CAPTION_BOTTOM: f32 = 2. * 16. + CONTROL_SIZE + 16.;29
const CAPTION_FADE_SECONDS: f32 = 1.;29
const CAPTION_FADE_SECONDS: f32 = 1.;30
const CAPTION_BACKGROUND: f32 = 0.72;30
const CAPTION_BACKGROUND: f32 = 0.72;31
const FOCUS_RADIUS: f32 = 12.;31
const FOCUS_RADIUS: f32 = 12.;32
const FOCUS_AVATAR: f32 = 140.;32
const FOCUS_AVATAR: f32 = 140.;33
const CHIP_HEIGHT: f32 = 24.;33
const CHIP_HEIGHT: f32 = 24.;34
const MORE_SIZE: f32 = 28.;34
const MORE_SIZE: f32 = 28.;35
const SMALL_CONTROL: f32 = 28.;35
const CAMERA_MENU_WIDTH: f32 = 28.;36
const NAME_LIMIT: usize = 32;36
const NAME_LIMIT: usize = 32;37
37
38
fn dark_text() -> Hsla {38
fn dark_text() -> Hsla {@@ -40,7 +40,7 @@ fn dark_text() -> Hsla {40
}40
}41
41
42
pub(super) fn pill(id: impl Into<ElementId>, label: &'static str, filled: bool) -> Stateful<Div> {42
pub(super) fn pill(id: impl Into<ElementId>, label: &'static str, filled: bool) -> Stateful<Div> {43
let (background, foreground) = if filled { (dark_text(), theme::white()) } else { (transparent_black(), dark_text()) };43
let (background, foreground) = if filled { (dark_text(), theme::white()) } else { (dark_text().opacity(0.12), dark_text()) };44
div()44
div()45
.id(id)45
.id(id)46
.h(px(PILL_HEIGHT))46
.h(px(PILL_HEIGHT))@@ -49,8 +49,6 @@ pub(super) fn pill(id: impl Into<ElementId>, label: &'static str, filled: bool)49
.flex_none()49
.flex_none()50
.items_center()50
.items_center()51
.rounded_full()51
.rounded_full()52
.border_1()53
.border_color(dark_text())54
.bg(background)52
.bg(background)55
.text_color(foreground)53
.text_color(foreground)56
.text_size(px(BANNER_TEXT))54
.text_size(px(BANNER_TEXT))@@ -200,7 +198,7 @@ pub fn tile_menu(popup: PopupMenu, app: &Entity<AppState>, model: &CallModel, mr200
198
201
fn more_overlay(app: &Entity<AppState>, model: &CallModel, mri: &str, name: &str, own: bool, group: SharedString) -> Div {199
fn more_overlay(app: &Entity<AppState>, model: &CallModel, mri: &str, name: &str, own: bool, group: SharedString) -> Div {202
let (app, model, mri_owned, name) = (app.clone(), model.clone(), mri.to_owned(), name.to_owned());200
let (app, model, mri_owned, name) = (app.clone(), model.clone(), mri.to_owned(), name.to_owned());203
div().absolute().top(px(10.)).right(px(38.)).opacity(0.).group_hover(group, |more| more.opacity(1.)).child(201
div().absolute().top(px(6.)).right(px(38.)).opacity(0.).group_hover(group, |more| more.opacity(1.)).child(204
Button::new(SharedString::from(format!("call-tile-more-{mri}")))202
Button::new(SharedString::from(format!("call-tile-more-{mri}")))205
.icon(IconName::Ellipsis)203
.icon(IconName::Ellipsis)206
.ghost()204
.ghost()@@ -323,17 +321,17 @@ pub fn camera_menu_button(app: &Entity<AppState>, model: &CallModel, backgrounds323
Button::new("call-camera-menu")321
Button::new("call-camera-menu")324
.ghost()322
.ghost()325
.p_0()323
.p_0()326
.size(px(SMALL_CONTROL))324
.w(px(CAMERA_MENU_WIDTH))325
.h(px(super::call_view::CONTROL_SIZE))327
.rounded_full()326
.rounded_full()328
.child(327
.child(329
div()328
div()330
.id("call-camera-menu-face")329
.id("call-camera-menu-face")331
.size(px(SMALL_CONTROL))330
.w(px(CAMERA_MENU_WIDTH))331
.h(px(super::call_view::CONTROL_SIZE))332
.flex()332
.flex()333
.items_center()333
.items_center()334
.justify_center()334
.justify_center()335
.rounded_full()336
.bg(theme::surface_raised())337
.child(icon(IconName::ChevronUp, 16., theme::text())),335
.child(icon(IconName::ChevronUp, 16., theme::text())),338
)336
)339
.dropdown_menu_with_anchor(Anchor::BottomLeft, move |popup, _, _| camera_menu(popup, &app, &model, &backgrounds))337
.dropdown_menu_with_anchor(Anchor::BottomLeft, move |popup, _, _| camera_menu(popup, &app, &model, &backgrounds))@@ -375,7 +373,7 @@ pub fn captions_overlay(model: &CallModel, now: Instant) -> Option<AnyElement> {375
.max_w_full()373
.max_w_full()376
.gap(px(4.))374
.gap(px(4.))377
.px(px(16.))375
.px(px(16.))378
.py(px(10.))376
.py(px(8.))379
.rounded(px(10.))377
.rounded(px(10.))380
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))378
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))381
.text_color(theme::white())379
.text_color(theme::white())@@ -454,8 +452,8 @@ pub fn render_focus_stage(app: &Entity<AppState>, state: &AppState, focus: &Focu454
.child(452
.child(455
h_flex()453
h_flex()456
.absolute()454
.absolute()457
.top(px(14.))455
.top(px(12.))458
.left(px(14.))456
.left(px(12.))459
.gap(px(6.))457
.gap(px(6.))460
.when(focus.spotlight, |chips| chips.child(spotlight_chip()))458
.when(focus.spotlight, |chips| chips.child(spotlight_chip()))461
.when(focus.pinned, |chips| chips.child(pin_chip())),459
.when(focus.pinned, |chips| chips.child(pin_chip())),@@ -463,10 +461,10 @@ pub fn render_focus_stage(app: &Entity<AppState>, state: &AppState, focus: &Focu463
.child(461
.child(464
h_flex()462
h_flex()465
.absolute()463
.absolute()466
.left(px(14.))464
.left(px(12.))467
.bottom(px(14.))465
.bottom(px(12.))468
.gap(px(8.))466
.gap(px(8.))469
.px(px(10.))467
.px(px(8.))470
.py(px(4.))468
.py(px(4.))471
.rounded(px(6.))469
.rounded(px(6.))472
.bg(hsla(0., 0., 0., 0.6))470
.bg(hsla(0., 0., 0., 0.6))@@ -500,7 +498,7 @@ pub fn captions_hint_chip(model: &CallModel) -> Option<AnyElement> {500
.justify_center()498
.justify_center()501
.child(499
.child(502
div()500
div()503
.px(px(14.))501
.px(px(12.))504
.py(px(6.))502
.py(px(6.))505
.rounded_full()503
.rounded_full()506
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))504
.bg(hsla(0., 0., 0., CAPTION_BACKGROUND))@@ -20,7 +20,8 @@ use super::call_extras::{BackgroundMenu, consent_overlay, consult_banner, hold_p
20
20
use super::call_organizer::{camera_menu_button, captions_hint_chip, captions_overlay, lobby_banner, more_button, pin_chip, render_focus_stage, spotlight_chip, with_tile_menu};
21
21
use super::call_stage::render_stage;
22
22
use super::conversation::ConversationView;
23
use super::widgets::{count_badge, icon, symbol};
23
use super::shell::ISLAND_GAP;
24
use super::widgets::{count_badge, icon};
24
25
use crate::app_state::AppState;
25
26
use crate::call::TileSize;
26
27
use crate::call::{CHAT_OPEN_TILES, CallKind, CallModel, GridLayout, MAX_TILES, Tile, TileState, grid_layout, tile_size};
@@ -45,7 +46,7 @@ const STRIP_TILE: TileSize = TileSize {
45
46
height: 131.,
46
47
avatar: 56.,
47
48
};
48
const STRIP_GAP: f32 = 10.;
49
const STRIP_GAP: f32 = 12.;
49
50
const STRIP_VISIBLE: f32 = 4.;
50
51
const TILE_RADIUS: f32 = 12.;
51
52
const NAME_PLATE_BACKGROUND: f32 = 0.6;
@@ -58,7 +59,6 @@ const MAX_WINDOW_ITEMS: usize = 12;
58
59
pub const LOBBY_TEXT: &str = "Waiting in the lobby...";
59
60
pub const CHAT_PANEL_WIDTH: f32 = 320.;
60
61
const CHAT_HEADER_HEIGHT: f32 = 48.;
61
const HAND_GLYPH: &str = "\u{270B}";
62
62
const REACTION_RISE: f32 = 24.;
63
63
const REACTION_FADE_FROM: f32 = 0.75;
64
64
const REACTION_CELL: f32 = 40.;
@@ -98,15 +98,13 @@ fn reaction_chip(reaction: Reaction, serial: u64) -> AnyElement {
98
98
div()
99
99
.absolute()
100
100
.right(px(12.))
101
.bottom(px(34.))
101
.bottom(px(32.))
102
102
.size(px(36.))
103
103
.flex()
104
104
.items_center()
105
105
.justify_center()
106
106
.rounded_full()
107
.bg(theme::surface_raised())
108
.border_1()
109
.border_color(theme::border_strong())
107
.bg(theme::popup())
110
108
.text_size(px(20.))
111
109
.child(reaction_glyph(reaction))
112
110
.with_animation(
@@ -114,7 +112,7 @@ fn reaction_chip(reaction: Reaction, serial: u64) -> AnyElement {
114
112
Animation::new(REACTION_SHOWN),
115
113
|chip, delta| {
116
114
let fade = ((delta - REACTION_FADE_FROM) / (1. - REACTION_FADE_FROM)).clamp(0., 1.);
117
chip.bottom(px(34. + REACTION_RISE * delta)).opacity(1. - fade)
115
chip.bottom(px(32. + REACTION_RISE * delta)).opacity(1. - fade)
118
116
},
119
117
)
120
118
.into_any_element()
@@ -124,8 +122,8 @@ fn tile_overlays(extras: &TileExtras) -> Vec<AnyElement> {
124
122
let badges = (extras.hand.is_some() || extras.spotlight || extras.pinned).then(|| {
125
123
h_flex()
126
124
.absolute()
127
.top(px(10.))
128
.left(px(10.))
125
.top(px(8.))
126
.left(px(8.))
129
127
.gap(px(6.))
130
128
.children(extras.hand.map(|position| hand_badge(position, extras.own)))
131
129
.when(extras.spotlight, |row| row.child(spotlight_chip()))
@@ -183,8 +181,8 @@ fn speaking_ring(avatar: AnyElement, speaking: bool) -> Div {
183
181
fn mute_badge() -> Div {
184
182
div()
185
183
.absolute()
186
.top(px(10.))
187
.right(px(10.))
184
.top(px(8.))
185
.right(px(8.))
188
186
.size(px(24.))
189
187
.flex()
190
188
.items_center()
@@ -202,7 +200,7 @@ fn video_tile(size: TileSize, image: Arc<RenderImage>, name: &str, speaking: boo
202
200
.flex_none()
203
201
.overflow_hidden()
204
202
.rounded(px(TILE_RADIUS))
205
.bg(theme::surface())
203
.bg(theme::row_hover())
206
204
.border_2()
207
205
.border_color(if speaking { theme::green() } else { transparent_black() })
208
206
.child(
@@ -219,7 +217,7 @@ fn video_tile(size: TileSize, image: Arc<RenderImage>, name: &str, speaking: boo
219
217
.max_w(px(size.width - 24.))
220
218
.truncate()
221
219
.px(px(8.))
222
.py(px(3.))
220
.py(px(4.))
223
221
.rounded(px(6.))
224
222
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))
225
223
.text_size(px(12.))
@@ -242,8 +240,8 @@ fn tile(
242
240
) -> Div {
243
241
let badge = div()
244
242
.absolute()
245
.top(px(10.))
246
.right(px(10.))
243
.top(px(8.))
244
.right(px(8.))
247
245
.size(px(24.))
248
246
.flex()
249
247
.items_center()
@@ -259,9 +257,7 @@ fn tile(
259
257
.justify_center()
260
258
.gap(px(12.))
261
259
.rounded(px(12.))
262
.bg(theme::surface())
263
.border_1()
264
.border_color(theme::border())
260
.bg(theme::row_hover())
265
261
.child(speaking_ring(avatar, speaking))
266
262
.child(
267
263
v_flex()
@@ -289,9 +285,7 @@ fn overflow_tile(size: TileSize, hidden: usize) -> Div {
289
285
.items_center()
290
286
.justify_center()
291
287
.rounded(px(12.))
292
.bg(theme::surface())
293
.border_1()
294
.border_color(theme::border())
288
.bg(theme::row_hover())
295
289
.child(
296
290
div()
297
291
.text_size(px(size.avatar * 0.5))
@@ -491,8 +485,7 @@ fn sharing_banner(app: &Entity<AppState>, model: &CallModel, sound: bool) -> Opt
491
485
.flex()
492
486
.items_center()
493
487
.rounded_full()
494
.border_1()
495
.border_color(theme::on_accent())
488
.bg(theme::on_accent().opacity(0.2))
496
489
.cursor_pointer()
497
490
.hover(|button| button.opacity(0.9))
498
491
.child(if sound { "Computer sound on" } else { "Computer sound off" })
@@ -536,7 +529,8 @@ fn chat_button(app: &Entity<AppState>, open: bool, unread: u32) -> Stateful<Div>
536
529
fn hand_button(app: &Entity<AppState>, model: &CallModel) -> Stateful<Div> {
537
530
let raised = model.own_hand.is_some();
538
531
let background = if raised { theme::accent() } else { theme::surface_raised() };
539
let button = control_shell("call-hand", background).child(div().text_size(px(CONTROL_ICON)).child(HAND_GLYPH));
532
let foreground = if raised { theme::on_accent() } else { theme::text() };
533
let button = control_shell("call-hand", background).child(icon(IconName::Hand, CONTROL_ICON, foreground));
540
534
let tooltip = if raised { "Lower hand" } else { "Raise hand" };
541
535
let button = button.tooltip(move |window, cx| Tooltip::new(tooltip).build(window, cx));
542
536
if !model.can_react() {
@@ -551,7 +545,7 @@ fn hand_button(app: &Entity<AppState>, model: &CallModel) -> Stateful<Div> {
551
545
552
546
fn reactions_button(app: &Entity<AppState>, model: &CallModel) -> AnyElement {
553
547
let face = control_shell("call-reactions-face", theme::surface_raised())
554
.child(symbol("mood", CONTROL_ICON, theme::text()));
548
.child(icon(IconName::FaceSlightlySmiling, CONTROL_ICON, theme::text()));
555
549
if !model.can_react() {
556
550
return face.opacity(DISABLED_OPACITY).cursor_default().into_any_element();
557
551
}
@@ -804,8 +798,6 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E
804
798
.px(px(20.))
805
799
.gap(px(12.))
806
800
.items_center()
807
.border_b_1()
808
.border_color(theme::border())
809
801
.child(icon(IconName::Phone, 18., theme::accent_text()))
810
802
.child(
811
803
div()
@@ -838,14 +830,12 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E
838
830
let controls = h_flex()
839
831
.w_full()
840
832
.flex_none()
841
.py(px(18.))
833
.py(px(16.))
842
834
.gap(px(12.))
843
835
.items_center()
844
836
.justify_center()
845
.border_t_1()
846
.border_color(theme::border())
847
837
.child(mute_button(app, model, "call-mute", CONTROL_SIZE))
848
.child(h_flex().gap(px(2.)).items_center().child(camera_button(app, model)).children(camera_menu_button(app, model, BackgroundMenu::of(state))))
838
.child(h_flex().h(px(CONTROL_SIZE)).items_center().rounded_full().bg(theme::surface_raised()).child(camera_button(app, model)).children(camera_menu_button(app, model, BackgroundMenu::of(state))))
849
839
.child(share_button(app, model, state.call_share_sound))
850
840
.when(model.has_reaction_controls(), |row| row.child(hand_button(app, model)).child(reactions_button(app, model)))
851
841
.child(devices_button(app, model))
@@ -859,6 +849,8 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E
859
849
.flex_1()
860
850
.min_w_0()
861
851
.h_full()
852
.rounded(px(10.))
853
.overflow_hidden()
862
854
.bg(theme::surface())
863
855
.child(header)
864
856
.children(lobby_banner(app, model))
@@ -899,6 +891,7 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E
899
891
.flex_1()
900
892
.min_w_0()
901
893
.h_full()
894
.gap(px(ISLAND_GAP))
902
895
.child(column)
903
896
.children(chat.map(|chat| chat_panel(app, chat)))
904
897
.into_any_element(),
@@ -912,18 +905,18 @@ fn chat_panel(app: &Entity<AppState>, chat: Entity<ConversationView>) -> AnyElem
912
905
.w(px(CHAT_PANEL_WIDTH))
913
906
.h_full()
914
907
.flex_none()
915
.border_l_1()
916
.border_color(theme::border())
908
.rounded(px(10.))
909
.overflow_hidden()
910
.bg(theme::surface())
917
911
.child(
918
912
h_flex()
919
913
.w_full()
920
914
.h(px(CHAT_HEADER_HEIGHT))
921
915
.flex_none()
922
.px(px(16.))
916
.pl(px(20.))
917
.pr(px(12.))
923
918
.items_center()
924
919
.justify_between()
925
.border_b_1()
926
.border_color(theme::border())
927
920
.child(div().text_size(px(15.)).font_weight(FontWeight::SEMIBOLD).child("Chat"))
928
921
.child(
929
922
div()
@@ -932,11 +925,11 @@ fn chat_panel(app: &Entity<AppState>, chat: Entity<ConversationView>) -> AnyElem
932
925
.flex()
933
926
.items_center()
934
927
.justify_center()
935
.rounded_full()
928
.rounded(px(7.))
936
929
.cursor_pointer()
937
930
.hover(|button| button.bg(theme::row_hover()))
938
931
.tooltip(|window, cx| Tooltip::new("Close the chat").build(window, cx))
939
.child(icon(IconName::Close, 16., theme::text_muted()))
932
.child(icon(IconName::Close, 14., theme::text_muted()))
940
933
.on_click(move |_, _, cx| app.update(cx, |state, cx| state.toggle_call_chat(cx))),
941
934
),
942
935
)
@@ -20,7 +20,8 @@ use super::call_extras::{BackgroundMenu, consent_overlay, consult_banner, hold_p20
use super::call_organizer::{camera_menu_button, captions_hint_chip, captions_overlay, lobby_banner, more_button, pin_chip, render_focus_stage, spotlight_chip, with_tile_menu};20
use super::call_organizer::{camera_menu_button, captions_hint_chip, captions_overlay, lobby_banner, more_button, pin_chip, render_focus_stage, spotlight_chip, with_tile_menu};21
use super::call_stage::render_stage;21
use super::call_stage::render_stage;22
use super::conversation::ConversationView;22
use super::conversation::ConversationView;23
use super::widgets::{count_badge, icon, symbol};23
use super::shell::ISLAND_GAP;24
use super::widgets::{count_badge, icon};24
use crate::app_state::AppState;25
use crate::app_state::AppState;25
use crate::call::TileSize;26
use crate::call::TileSize;26
use crate::call::{CHAT_OPEN_TILES, CallKind, CallModel, GridLayout, MAX_TILES, Tile, TileState, grid_layout, tile_size};27
use crate::call::{CHAT_OPEN_TILES, CallKind, CallModel, GridLayout, MAX_TILES, Tile, TileState, grid_layout, tile_size};@@ -45,7 +46,7 @@ const STRIP_TILE: TileSize = TileSize {45
height: 131.,46
height: 131.,46
avatar: 56.,47
avatar: 56.,47
};48
};48
const STRIP_GAP: f32 = 10.;49
const STRIP_GAP: f32 = 12.;49
const STRIP_VISIBLE: f32 = 4.;50
const STRIP_VISIBLE: f32 = 4.;50
const TILE_RADIUS: f32 = 12.;51
const TILE_RADIUS: f32 = 12.;51
const NAME_PLATE_BACKGROUND: f32 = 0.6;52
const NAME_PLATE_BACKGROUND: f32 = 0.6;@@ -58,7 +59,6 @@ const MAX_WINDOW_ITEMS: usize = 12;58
pub const LOBBY_TEXT: &str = "Waiting in the lobby...";59
pub const LOBBY_TEXT: &str = "Waiting in the lobby...";59
pub const CHAT_PANEL_WIDTH: f32 = 320.;60
pub const CHAT_PANEL_WIDTH: f32 = 320.;60
const CHAT_HEADER_HEIGHT: f32 = 48.;61
const CHAT_HEADER_HEIGHT: f32 = 48.;61
const HAND_GLYPH: &str = "\u{270B}";62
const REACTION_RISE: f32 = 24.;62
const REACTION_RISE: f32 = 24.;63
const REACTION_FADE_FROM: f32 = 0.75;63
const REACTION_FADE_FROM: f32 = 0.75;64
const REACTION_CELL: f32 = 40.;64
const REACTION_CELL: f32 = 40.;@@ -98,15 +98,13 @@ fn reaction_chip(reaction: Reaction, serial: u64) -> AnyElement {98
div()98
div()99
.absolute()99
.absolute()100
.right(px(12.))100
.right(px(12.))101
.bottom(px(34.))101
.bottom(px(32.))102
.size(px(36.))102
.size(px(36.))103
.flex()103
.flex()104
.items_center()104
.items_center()105
.justify_center()105
.justify_center()106
.rounded_full()106
.rounded_full()107
.bg(theme::surface_raised())107
.bg(theme::popup())108
.border_1()109
.border_color(theme::border_strong())110
.text_size(px(20.))108
.text_size(px(20.))111
.child(reaction_glyph(reaction))109
.child(reaction_glyph(reaction))112
.with_animation(110
.with_animation(@@ -114,7 +112,7 @@ fn reaction_chip(reaction: Reaction, serial: u64) -> AnyElement {114
Animation::new(REACTION_SHOWN),112
Animation::new(REACTION_SHOWN),115
|chip, delta| {113
|chip, delta| {116
let fade = ((delta - REACTION_FADE_FROM) / (1. - REACTION_FADE_FROM)).clamp(0., 1.);114
let fade = ((delta - REACTION_FADE_FROM) / (1. - REACTION_FADE_FROM)).clamp(0., 1.);117
chip.bottom(px(34. + REACTION_RISE * delta)).opacity(1. - fade)115
chip.bottom(px(32. + REACTION_RISE * delta)).opacity(1. - fade)118
},116
},119
)117
)120
.into_any_element()118
.into_any_element()@@ -124,8 +122,8 @@ fn tile_overlays(extras: &TileExtras) -> Vec<AnyElement> {124
let badges = (extras.hand.is_some() || extras.spotlight || extras.pinned).then(|| {122
let badges = (extras.hand.is_some() || extras.spotlight || extras.pinned).then(|| {125
h_flex()123
h_flex()126
.absolute()124
.absolute()127
.top(px(10.))125
.top(px(8.))128
.left(px(10.))126
.left(px(8.))129
.gap(px(6.))127
.gap(px(6.))130
.children(extras.hand.map(|position| hand_badge(position, extras.own)))128
.children(extras.hand.map(|position| hand_badge(position, extras.own)))131
.when(extras.spotlight, |row| row.child(spotlight_chip()))129
.when(extras.spotlight, |row| row.child(spotlight_chip()))@@ -183,8 +181,8 @@ fn speaking_ring(avatar: AnyElement, speaking: bool) -> Div {183
fn mute_badge() -> Div {181
fn mute_badge() -> Div {184
div()182
div()185
.absolute()183
.absolute()186
.top(px(10.))184
.top(px(8.))187
.right(px(10.))185
.right(px(8.))188
.size(px(24.))186
.size(px(24.))189
.flex()187
.flex()190
.items_center()188
.items_center()@@ -202,7 +200,7 @@ fn video_tile(size: TileSize, image: Arc<RenderImage>, name: &str, speaking: boo202
.flex_none()200
.flex_none()203
.overflow_hidden()201
.overflow_hidden()204
.rounded(px(TILE_RADIUS))202
.rounded(px(TILE_RADIUS))205
.bg(theme::surface())203
.bg(theme::row_hover())206
.border_2()204
.border_2()207
.border_color(if speaking { theme::green() } else { transparent_black() })205
.border_color(if speaking { theme::green() } else { transparent_black() })208
.child(206
.child(@@ -219,7 +217,7 @@ fn video_tile(size: TileSize, image: Arc<RenderImage>, name: &str, speaking: boo219
.max_w(px(size.width - 24.))217
.max_w(px(size.width - 24.))220
.truncate()218
.truncate()221
.px(px(8.))219
.px(px(8.))222
.py(px(3.))220
.py(px(4.))223
.rounded(px(6.))221
.rounded(px(6.))224
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))222
.bg(hsla(0., 0., 0., NAME_PLATE_BACKGROUND))225
.text_size(px(12.))223
.text_size(px(12.))@@ -242,8 +240,8 @@ fn tile(242
) -> Div {240
) -> Div {243
let badge = div()241
let badge = div()244
.absolute()242
.absolute()245
.top(px(10.))243
.top(px(8.))246
.right(px(10.))244
.right(px(8.))247
.size(px(24.))245
.size(px(24.))248
.flex()246
.flex()249
.items_center()247
.items_center()@@ -259,9 +257,7 @@ fn tile(259
.justify_center()257
.justify_center()260
.gap(px(12.))258
.gap(px(12.))261
.rounded(px(12.))259
.rounded(px(12.))262
.bg(theme::surface())260
.bg(theme::row_hover())263
.border_1()264
.border_color(theme::border())265
.child(speaking_ring(avatar, speaking))261
.child(speaking_ring(avatar, speaking))266
.child(262
.child(267
v_flex()263
v_flex()@@ -289,9 +285,7 @@ fn overflow_tile(size: TileSize, hidden: usize) -> Div {289
.items_center()285
.items_center()290
.justify_center()286
.justify_center()291
.rounded(px(12.))287
.rounded(px(12.))292
.bg(theme::surface())288
.bg(theme::row_hover())293
.border_1()294
.border_color(theme::border())295
.child(289
.child(296
div()290
div()297
.text_size(px(size.avatar * 0.5))291
.text_size(px(size.avatar * 0.5))@@ -491,8 +485,7 @@ fn sharing_banner(app: &Entity<AppState>, model: &CallModel, sound: bool) -> Opt491
.flex()485
.flex()492
.items_center()486
.items_center()493
.rounded_full()487
.rounded_full()494
.border_1()488
.bg(theme::on_accent().opacity(0.2))495
.border_color(theme::on_accent())496
.cursor_pointer()489
.cursor_pointer()497
.hover(|button| button.opacity(0.9))490
.hover(|button| button.opacity(0.9))498
.child(if sound { "Computer sound on" } else { "Computer sound off" })491
.child(if sound { "Computer sound on" } else { "Computer sound off" })@@ -536,7 +529,8 @@ fn chat_button(app: &Entity<AppState>, open: bool, unread: u32) -> Stateful<Div>536
fn hand_button(app: &Entity<AppState>, model: &CallModel) -> Stateful<Div> {529
fn hand_button(app: &Entity<AppState>, model: &CallModel) -> Stateful<Div> {537
let raised = model.own_hand.is_some();530
let raised = model.own_hand.is_some();538
let background = if raised { theme::accent() } else { theme::surface_raised() };531
let background = if raised { theme::accent() } else { theme::surface_raised() };539
let button = control_shell("call-hand", background).child(div().text_size(px(CONTROL_ICON)).child(HAND_GLYPH));532
let foreground = if raised { theme::on_accent() } else { theme::text() };533
let button = control_shell("call-hand", background).child(icon(IconName::Hand, CONTROL_ICON, foreground));540
let tooltip = if raised { "Lower hand" } else { "Raise hand" };534
let tooltip = if raised { "Lower hand" } else { "Raise hand" };541
let button = button.tooltip(move |window, cx| Tooltip::new(tooltip).build(window, cx));535
let button = button.tooltip(move |window, cx| Tooltip::new(tooltip).build(window, cx));542
if !model.can_react() {536
if !model.can_react() {@@ -551,7 +545,7 @@ fn hand_button(app: &Entity<AppState>, model: &CallModel) -> Stateful<Div> {551
545
552
fn reactions_button(app: &Entity<AppState>, model: &CallModel) -> AnyElement {546
fn reactions_button(app: &Entity<AppState>, model: &CallModel) -> AnyElement {553
let face = control_shell("call-reactions-face", theme::surface_raised())547
let face = control_shell("call-reactions-face", theme::surface_raised())554
.child(symbol("mood", CONTROL_ICON, theme::text()));548
.child(icon(IconName::FaceSlightlySmiling, CONTROL_ICON, theme::text()));555
if !model.can_react() {549
if !model.can_react() {556
return face.opacity(DISABLED_OPACITY).cursor_default().into_any_element();550
return face.opacity(DISABLED_OPACITY).cursor_default().into_any_element();557
}551
}@@ -804,8 +798,6 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E804
.px(px(20.))798
.px(px(20.))805
.gap(px(12.))799
.gap(px(12.))806
.items_center()800
.items_center()807
.border_b_1()808
.border_color(theme::border())809
.child(icon(IconName::Phone, 18., theme::accent_text()))801
.child(icon(IconName::Phone, 18., theme::accent_text()))810
.child(802
.child(811
div()803
div()@@ -838,14 +830,12 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E838
let controls = h_flex()830
let controls = h_flex()839
.w_full()831
.w_full()840
.flex_none()832
.flex_none()841
.py(px(18.))833
.py(px(16.))842
.gap(px(12.))834
.gap(px(12.))843
.items_center()835
.items_center()844
.justify_center()836
.justify_center()845
.border_t_1()846
.border_color(theme::border())847
.child(mute_button(app, model, "call-mute", CONTROL_SIZE))837
.child(mute_button(app, model, "call-mute", CONTROL_SIZE))848
.child(h_flex().gap(px(2.)).items_center().child(camera_button(app, model)).children(camera_menu_button(app, model, BackgroundMenu::of(state))))838
.child(h_flex().h(px(CONTROL_SIZE)).items_center().rounded_full().bg(theme::surface_raised()).child(camera_button(app, model)).children(camera_menu_button(app, model, BackgroundMenu::of(state))))849
.child(share_button(app, model, state.call_share_sound))839
.child(share_button(app, model, state.call_share_sound))850
.when(model.has_reaction_controls(), |row| row.child(hand_button(app, model)).child(reactions_button(app, model)))840
.when(model.has_reaction_controls(), |row| row.child(hand_button(app, model)).child(reactions_button(app, model)))851
.child(devices_button(app, model))841
.child(devices_button(app, model))@@ -859,6 +849,8 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E859
.flex_1()849
.flex_1()860
.min_w_0()850
.min_w_0()861
.h_full()851
.h_full()852
.rounded(px(10.))853
.overflow_hidden()862
.bg(theme::surface())854
.bg(theme::surface())863
.child(header)855
.child(header)864
.children(lobby_banner(app, model))856
.children(lobby_banner(app, model))@@ -899,6 +891,7 @@ pub fn render_call_view(app: &Entity<AppState>, state: &AppState, chat: Option<E899
.flex_1()891
.flex_1()900
.min_w_0()892
.min_w_0()901
.h_full()893
.h_full()894
.gap(px(ISLAND_GAP))902
.child(column)895
.child(column)903
.children(chat.map(|chat| chat_panel(app, chat)))896
.children(chat.map(|chat| chat_panel(app, chat)))904
.into_any_element(),897
.into_any_element(),@@ -912,18 +905,18 @@ fn chat_panel(app: &Entity<AppState>, chat: Entity<ConversationView>) -> AnyElem912
.w(px(CHAT_PANEL_WIDTH))905
.w(px(CHAT_PANEL_WIDTH))913
.h_full()906
.h_full()914
.flex_none()907
.flex_none()915
.border_l_1()908
.rounded(px(10.))916
.border_color(theme::border())909
.overflow_hidden()910
.bg(theme::surface())917
.child(911
.child(918
h_flex()912
h_flex()919
.w_full()913
.w_full()920
.h(px(CHAT_HEADER_HEIGHT))914
.h(px(CHAT_HEADER_HEIGHT))921
.flex_none()915
.flex_none()922
.px(px(16.))916
.pl(px(20.))917
.pr(px(12.))923
.items_center()918
.items_center()924
.justify_between()919
.justify_between()925
.border_b_1()926
.border_color(theme::border())927
.child(div().text_size(px(15.)).font_weight(FontWeight::SEMIBOLD).child("Chat"))920
.child(div().text_size(px(15.)).font_weight(FontWeight::SEMIBOLD).child("Chat"))928
.child(921
.child(929
div()922
div()@@ -932,11 +925,11 @@ fn chat_panel(app: &Entity<AppState>, chat: Entity<ConversationView>) -> AnyElem932
.flex()925
.flex()933
.items_center()926
.items_center()934
.justify_center()927
.justify_center()935
.rounded_full()928
.rounded(px(7.))936
.cursor_pointer()929
.cursor_pointer()937
.hover(|button| button.bg(theme::row_hover()))930
.hover(|button| button.bg(theme::row_hover()))938
.tooltip(|window, cx| Tooltip::new("Close the chat").build(window, cx))931
.tooltip(|window, cx| Tooltip::new("Close the chat").build(window, cx))939
.child(icon(IconName::Close, 16., theme::text_muted()))932
.child(icon(IconName::Close, 14., theme::text_muted()))940
.on_click(move |_, _, cx| app.update(cx, |state, cx| state.toggle_call_chat(cx))),933
.on_click(move |_, _, cx| app.update(cx, |state, cx| state.toggle_call_chat(cx))),941
),934
),942
)935
)@@ -61,7 +61,7 @@ fn call_row(
61
61
.mx(px(6.))
62
62
.h(px(CALL_ROW_HEIGHT))
63
63
.px(px(10.))
64
.gap(px(10.))
64
.gap(px(12.))
65
65
.items_center()
66
66
.rounded(px(8.))
67
67
.cursor_pointer()
@@ -153,7 +153,7 @@ fn join_button(id: &'static str, label: &'static str, primary: bool) -> Stateful
153
153
div()
154
154
.id(id)
155
155
.h(px(28.))
156
.px(px(10.))
156
.px(px(12.))
157
157
.flex()
158
158
.items_center()
159
159
.rounded(px(7.))
@@ -172,7 +172,7 @@ fn join_buttons(state: &Entity<AppState>, meet_now_pending: bool) -> impl IntoEl
172
172
let paste_state = state.clone();
173
173
h_flex()
174
174
.w_full()
175
.px(px(12.))
175
.px(px(16.))
176
176
.pb(px(8.))
177
177
.gap(px(8.))
178
178
.flex_wrap()
@@ -246,7 +246,7 @@ fn agenda_row(state: &Entity<AppState>, row: &AgendaRow, joinable: bool) -> AnyE
246
246
.mx(px(6.))
247
247
.h(px(AGENDA_ROW_HEIGHT))
248
248
.px(px(10.))
249
.gap(px(10.))
249
.gap(px(12.))
250
250
.items_center()
251
251
.rounded(px(8.))
252
252
.cursor_pointer()
@@ -61,7 +61,7 @@ fn call_row(61
.mx(px(6.))61
.mx(px(6.))62
.h(px(CALL_ROW_HEIGHT))62
.h(px(CALL_ROW_HEIGHT))63
.px(px(10.))63
.px(px(10.))64
.gap(px(10.))64
.gap(px(12.))65
.items_center()65
.items_center()66
.rounded(px(8.))66
.rounded(px(8.))67
.cursor_pointer()67
.cursor_pointer()@@ -153,7 +153,7 @@ fn join_button(id: &'static str, label: &'static str, primary: bool) -> Stateful153
div()153
div()154
.id(id)154
.id(id)155
.h(px(28.))155
.h(px(28.))156
.px(px(10.))156
.px(px(12.))157
.flex()157
.flex()158
.items_center()158
.items_center()159
.rounded(px(7.))159
.rounded(px(7.))@@ -172,7 +172,7 @@ fn join_buttons(state: &Entity<AppState>, meet_now_pending: bool) -> impl IntoEl172
let paste_state = state.clone();172
let paste_state = state.clone();173
h_flex()173
h_flex()174
.w_full()174
.w_full()175
.px(px(12.))175
.px(px(16.))176
.pb(px(8.))176
.pb(px(8.))177
.gap(px(8.))177
.gap(px(8.))178
.flex_wrap()178
.flex_wrap()@@ -246,7 +246,7 @@ fn agenda_row(state: &Entity<AppState>, row: &AgendaRow, joinable: bool) -> AnyE246
.mx(px(6.))246
.mx(px(6.))247
.h(px(AGENDA_ROW_HEIGHT))247
.h(px(AGENDA_ROW_HEIGHT))248
.px(px(10.))248
.px(px(10.))249
.gap(px(10.))249
.gap(px(12.))250
.items_center()250
.items_center()251
.rounded(px(8.))251
.rounded(px(8.))252
.cursor_pointer()252
.cursor_pointer()@@ -17,7 +17,7 @@ const TAB_HEIGHT: f32 = 28.;
17
17
const TAB_GAP: f32 = 4.;
18
18
const TAB_PADDING: f32 = 12.;
19
19
const TAB_TEXT_SIZE: f32 = 12.5;
20
const BAR_PADDING: f32 = 16.;
20
const BAR_PADDING: f32 = 20.;
21
21
const CHAR_WIDTH: f32 = 6.5;
22
22
const ARROW_WIDTH: f32 = 14.;
23
23
const OVERFLOW_WIDTH: f32 = 44.;
@@ -109,7 +109,7 @@ fn tab_label(
109
109
.h(px(TAB_HEIGHT))
110
110
.flex_none()
111
111
.items_center()
112
.gap(px(3.))
112
.gap(px(4.))
113
113
.px(px(TAB_PADDING))
114
114
.rounded(px(7.))
115
115
.cursor_pointer()
@@ -17,7 +17,7 @@ const TAB_HEIGHT: f32 = 28.;17
const TAB_GAP: f32 = 4.;17
const TAB_GAP: f32 = 4.;18
const TAB_PADDING: f32 = 12.;18
const TAB_PADDING: f32 = 12.;19
const TAB_TEXT_SIZE: f32 = 12.5;19
const TAB_TEXT_SIZE: f32 = 12.5;20
const BAR_PADDING: f32 = 16.;20
const BAR_PADDING: f32 = 20.;21
const CHAR_WIDTH: f32 = 6.5;21
const CHAR_WIDTH: f32 = 6.5;22
const ARROW_WIDTH: f32 = 14.;22
const ARROW_WIDTH: f32 = 14.;23
const OVERFLOW_WIDTH: f32 = 44.;23
const OVERFLOW_WIDTH: f32 = 44.;@@ -109,7 +109,7 @@ fn tab_label(109
.h(px(TAB_HEIGHT))109
.h(px(TAB_HEIGHT))110
.flex_none()110
.flex_none()111
.items_center()111
.items_center()112
.gap(px(3.))112
.gap(px(4.))113
.px(px(TAB_PADDING))113
.px(px(TAB_PADDING))114
.rounded(px(7.))114
.rounded(px(7.))115
.cursor_pointer()115
.cursor_pointer()@@ -2151,7 +2151,7 @@ impl Composer {
2151
2151
.mx(px(6.))
2152
2152
.px(px(6.))
2153
2153
.h(px(POPUP_ROW_HEIGHT))
2154
.gap(px(10.))
2154
.gap(px(8.))
2155
2155
.items_center()
2156
2156
.rounded(px(6.))
2157
2157
.cursor_pointer()
@@ -2309,11 +2309,9 @@ impl Composer {
2309
2309
.child("Formatted from Markdown")
2310
2310
.child(
2311
2311
div()
2312
.px(px(5.))
2313
.py(px(1.))
2312
.px(px(4.))
2313
.py(px(2.))
2314
2314
.rounded(px(4.))
2315
.border_1()
2316
.border_color(theme::border_strong())
2317
2315
.bg(theme::surface_raised())
2318
2316
.text_size(px(11.))
2319
2317
.text_color(theme::text())
@@ -2328,16 +2326,13 @@ impl Composer {
2328
2326
Some(
2329
2327
h_flex()
2330
2328
.w_full()
2331
.mb(px(6.))
2332
.gap(px(10.))
2329
.h(px(52.))
2330
.mb(px(8.))
2331
.gap(px(12.))
2333
2332
.items_center()
2334
.pl(px(10.))
2335
.pr(px(4.))
2336
.py(px(6.))
2337
.rounded(px(8.))
2338
.bg(theme::surface())
2339
.border_1()
2340
.border_color(theme::border())
2333
.px(px(12.))
2334
.rounded(px(10.))
2335
.bg(theme::row_hover())
2341
2336
.child(match edit.scheduled {
2342
2337
Some(_) => symbol("schedule_send", 14., theme::accent_text()).into_any_element(),
2343
2338
None => icon(IconName::Pencil, 14., theme::accent_text()).into_any_element(),
@@ -2371,11 +2366,12 @@ impl Composer {
2371
2366
.child(
2372
2367
div()
2373
2368
.id("edit-close")
2374
.size(px(24.))
2369
.size(px(28.))
2370
.flex_none()
2375
2371
.flex()
2376
2372
.items_center()
2377
2373
.justify_center()
2378
.rounded(px(6.))
2374
.rounded(px(7.))
2379
2375
.cursor_pointer()
2380
2376
.hover(|button| button.bg(theme::row_hover()))
2381
2377
.child(icon(IconName::Close, 14., theme::text_muted()))
@@ -2389,16 +2385,13 @@ impl Composer {
2389
2385
Some(
2390
2386
h_flex()
2391
2387
.w_full()
2392
.mb(px(6.))
2393
.gap(px(10.))
2388
.h(px(52.))
2389
.mb(px(8.))
2390
.gap(px(12.))
2394
2391
.items_center()
2395
.pl(px(10.))
2396
.pr(px(4.))
2397
.py(px(6.))
2398
.rounded(px(8.))
2399
.bg(theme::surface())
2400
.border_1()
2401
.border_color(theme::border())
2392
.px(px(12.))
2393
.rounded(px(10.))
2394
.bg(theme::row_hover())
2402
2395
.child(icon(IconName::Undo2, 14., theme::accent_text()))
2403
2396
.child(
2404
2397
v_flex()
@@ -2423,11 +2416,12 @@ impl Composer {
2423
2416
.child(
2424
2417
div()
2425
2418
.id("reply-close")
2426
.size(px(24.))
2419
.size(px(28.))
2420
.flex_none()
2427
2421
.flex()
2428
2422
.items_center()
2429
2423
.justify_center()
2430
.rounded(px(6.))
2424
.rounded(px(7.))
2431
2425
.cursor_pointer()
2432
2426
.hover(|button| button.bg(theme::row_hover()))
2433
2427
.child(icon(IconName::Close, 14., theme::text_muted()))
@@ -2572,7 +2566,7 @@ impl Render for Composer {
2572
2566
let (inset, top, bottom) = if self.inline {
2573
2567
(0., 0., 0.)
2574
2568
} else {
2575
(24., 8., 12.)
2569
(20., 8., 16.)
2576
2570
};
2577
2571
v_flex()
2578
2572
.w_full()
@@ -2151,7 +2151,7 @@ impl Composer {2151
.mx(px(6.))2151
.mx(px(6.))2152
.px(px(6.))2152
.px(px(6.))2153
.h(px(POPUP_ROW_HEIGHT))2153
.h(px(POPUP_ROW_HEIGHT))2154
.gap(px(10.))2154
.gap(px(8.))2155
.items_center()2155
.items_center()2156
.rounded(px(6.))2156
.rounded(px(6.))2157
.cursor_pointer()2157
.cursor_pointer()@@ -2309,11 +2309,9 @@ impl Composer {2309
.child("Formatted from Markdown")2309
.child("Formatted from Markdown")2310
.child(2310
.child(2311
div()2311
div()2312
.px(px(5.))2312
.px(px(4.))2313
.py(px(1.))2313
.py(px(2.))2314
.rounded(px(4.))2314
.rounded(px(4.))2315
.border_1()2316
.border_color(theme::border_strong())2317
.bg(theme::surface_raised())2315
.bg(theme::surface_raised())2318
.text_size(px(11.))2316
.text_size(px(11.))2319
.text_color(theme::text())2317
.text_color(theme::text())@@ -2328,16 +2326,13 @@ impl Composer {2328
Some(2326
Some(2329
h_flex()2327
h_flex()2330
.w_full()2328
.w_full()2331
.mb(px(6.))2329
.h(px(52.))2332
.gap(px(10.))2330
.mb(px(8.))2331
.gap(px(12.))2333
.items_center()2332
.items_center()2334
.pl(px(10.))2333
.px(px(12.))2335
.pr(px(4.))2334
.rounded(px(10.))2336
.py(px(6.))2335
.bg(theme::row_hover())2337
.rounded(px(8.))2338
.bg(theme::surface())2339
.border_1()2340
.border_color(theme::border())2341
.child(match edit.scheduled {2336
.child(match edit.scheduled {2342
Some(_) => symbol("schedule_send", 14., theme::accent_text()).into_any_element(),2337
Some(_) => symbol("schedule_send", 14., theme::accent_text()).into_any_element(),2343
None => icon(IconName::Pencil, 14., theme::accent_text()).into_any_element(),2338
None => icon(IconName::Pencil, 14., theme::accent_text()).into_any_element(),@@ -2371,11 +2366,12 @@ impl Composer {2371
.child(2366
.child(2372
div()2367
div()2373
.id("edit-close")2368
.id("edit-close")2374
.size(px(24.))2369
.size(px(28.))2370
.flex_none()2375
.flex()2371
.flex()2376
.items_center()2372
.items_center()2377
.justify_center()2373
.justify_center()2378
.rounded(px(6.))2374
.rounded(px(7.))2379
.cursor_pointer()2375
.cursor_pointer()2380
.hover(|button| button.bg(theme::row_hover()))2376
.hover(|button| button.bg(theme::row_hover()))2381
.child(icon(IconName::Close, 14., theme::text_muted()))2377
.child(icon(IconName::Close, 14., theme::text_muted()))@@ -2389,16 +2385,13 @@ impl Composer {2389
Some(2385
Some(2390
h_flex()2386
h_flex()2391
.w_full()2387
.w_full()2392
.mb(px(6.))2388
.h(px(52.))2393
.gap(px(10.))2389
.mb(px(8.))2390
.gap(px(12.))2394
.items_center()2391
.items_center()2395
.pl(px(10.))2392
.px(px(12.))2396
.pr(px(4.))2393
.rounded(px(10.))2397
.py(px(6.))2394
.bg(theme::row_hover())2398
.rounded(px(8.))2399
.bg(theme::surface())2400
.border_1()2401
.border_color(theme::border())2402
.child(icon(IconName::Undo2, 14., theme::accent_text()))2395
.child(icon(IconName::Undo2, 14., theme::accent_text()))2403
.child(2396
.child(2404
v_flex()2397
v_flex()@@ -2423,11 +2416,12 @@ impl Composer {2423
.child(2416
.child(2424
div()2417
div()2425
.id("reply-close")2418
.id("reply-close")2426
.size(px(24.))2419
.size(px(28.))2420
.flex_none()2427
.flex()2421
.flex()2428
.items_center()2422
.items_center()2429
.justify_center()2423
.justify_center()2430
.rounded(px(6.))2424
.rounded(px(7.))2431
.cursor_pointer()2425
.cursor_pointer()2432
.hover(|button| button.bg(theme::row_hover()))2426
.hover(|button| button.bg(theme::row_hover()))2433
.child(icon(IconName::Close, 14., theme::text_muted()))2427
.child(icon(IconName::Close, 14., theme::text_muted()))@@ -2572,7 +2566,7 @@ impl Render for Composer {2572
let (inset, top, bottom) = if self.inline {2566
let (inset, top, bottom) = if self.inline {2573
(0., 0., 0.)2567
(0., 0., 0.)2574
} else {2568
} else {2575
(24., 8., 12.)2569
(20., 8., 16.)2576
};2570
};2577
v_flex()2571
v_flex()2578
.w_full()2572
.w_full()@@ -31,7 +31,7 @@ use super::call_controls::header_call_controls;
31
31
use super::channel_tabs::ChannelPane;
32
32
use super::composer::{Composer, ComposerEvent, EditPreview, Outgoing, ReplyPreview};
33
33
use super::message_actions::{Action, MessageMenu, QUICK_REACTION_COUNT};
34
use super::message_row::{render_message_row, render_skeleton_row};
34
use super::message_row::{AVATAR_GAP, AVATAR_SIZE, render_message_row, render_skeleton_row};
35
35
use super::new_chat::{NewChatDraft, NewChatEvent, composer_placeholder, existing_one_on_one};
36
36
use super::post_card::render_post;
37
37
use super::profile_card::opens_profile;
@@ -700,10 +700,15 @@ impl ConversationView {
700
700
.map(|face| face.name.clone())
701
701
.collect::<Vec<_>>(),
702
702
);
703
let text_inset = match self.current.as_ref().map(|current| ¤t.mode) {
704
Some(ViewMode::Flat) => AVATAR_SIZE + AVATAR_GAP,
705
_ => 0.,
706
};
703
707
h_flex()
704
708
.h(px(TYPING_LINE_HEIGHT))
705
709
.flex_none()
706
.px(px(24.))
710
.pl(px(20. + text_inset))
711
.pr(px(20.))
707
712
.gap(px(6.))
708
713
.items_center()
709
714
.when(!faces.is_empty(), |line| {
@@ -2835,8 +2840,8 @@ impl ConversationView {
2835
2840
v_flex()
2836
2841
.items_center()
2837
2842
.gap(px(6.))
2838
.px(px(28.))
2839
.py(px(18.))
2843
.px(px(24.))
2844
.py(px(16.))
2840
2845
.rounded(px(12.))
2841
2846
.bg(black().opacity(0.55))
2842
2847
.child(symbol("upload", 28., theme::accent_text()))
@@ -2868,7 +2873,7 @@ impl ConversationView {
2868
2873
h_flex()
2869
2874
.w_full()
2870
2875
.flex_none()
2871
.px(px(24.))
2876
.px(px(20.))
2872
2877
.py(px(4.))
2873
2878
.gap(px(8.))
2874
2879
.items_center()
@@ -3154,7 +3159,7 @@ impl Render for ConversationView {
3154
3159
if let Some(notice) = &self.notice {
3155
3160
root = root.child(
3156
3161
h_flex()
3157
.px_4()
3162
.px(px(20.))
3158
3163
.py_1()
3159
3164
.gap(px(8.))
3160
3165
.items_center()
@@ -31,7 +31,7 @@ use super::call_controls::header_call_controls;31
use super::channel_tabs::ChannelPane;31
use super::channel_tabs::ChannelPane;32
use super::composer::{Composer, ComposerEvent, EditPreview, Outgoing, ReplyPreview};32
use super::composer::{Composer, ComposerEvent, EditPreview, Outgoing, ReplyPreview};33
use super::message_actions::{Action, MessageMenu, QUICK_REACTION_COUNT};33
use super::message_actions::{Action, MessageMenu, QUICK_REACTION_COUNT};34
use super::message_row::{render_message_row, render_skeleton_row};34
use super::message_row::{AVATAR_GAP, AVATAR_SIZE, render_message_row, render_skeleton_row};35
use super::new_chat::{NewChatDraft, NewChatEvent, composer_placeholder, existing_one_on_one};35
use super::new_chat::{NewChatDraft, NewChatEvent, composer_placeholder, existing_one_on_one};36
use super::post_card::render_post;36
use super::post_card::render_post;37
use super::profile_card::opens_profile;37
use super::profile_card::opens_profile;@@ -700,10 +700,15 @@ impl ConversationView {700
.map(|face| face.name.clone())700
.map(|face| face.name.clone())701
.collect::<Vec<_>>(),701
.collect::<Vec<_>>(),702
);702
);703
let text_inset = match self.current.as_ref().map(|current| ¤t.mode) {704
Some(ViewMode::Flat) => AVATAR_SIZE + AVATAR_GAP,705
_ => 0.,706
};703
h_flex()707
h_flex()704
.h(px(TYPING_LINE_HEIGHT))708
.h(px(TYPING_LINE_HEIGHT))705
.flex_none()709
.flex_none()706
.px(px(24.))710
.pl(px(20. + text_inset))711
.pr(px(20.))707
.gap(px(6.))712
.gap(px(6.))708
.items_center()713
.items_center()709
.when(!faces.is_empty(), |line| {714
.when(!faces.is_empty(), |line| {@@ -2835,8 +2840,8 @@ impl ConversationView {2835
v_flex()2840
v_flex()2836
.items_center()2841
.items_center()2837
.gap(px(6.))2842
.gap(px(6.))2838
.px(px(28.))2843
.px(px(24.))2839
.py(px(18.))2844
.py(px(16.))2840
.rounded(px(12.))2845
.rounded(px(12.))2841
.bg(black().opacity(0.55))2846
.bg(black().opacity(0.55))2842
.child(symbol("upload", 28., theme::accent_text()))2847
.child(symbol("upload", 28., theme::accent_text()))@@ -2868,7 +2873,7 @@ impl ConversationView {2868
h_flex()2873
h_flex()2869
.w_full()2874
.w_full()2870
.flex_none()2875
.flex_none()2871
.px(px(24.))2876
.px(px(20.))2872
.py(px(4.))2877
.py(px(4.))2873
.gap(px(8.))2878
.gap(px(8.))2874
.items_center()2879
.items_center()@@ -3154,7 +3159,7 @@ impl Render for ConversationView {3154
if let Some(notice) = &self.notice {3159
if let Some(notice) = &self.notice {3155
root = root.child(3160
root = root.child(3156
h_flex()3161
h_flex()3157
.px_4()3162
.px(px(20.))3158
.py_1()3163
.py_1()3159
.gap(px(8.))3164
.gap(px(8.))3160
.items_center()3165
.items_center()@@ -223,9 +223,9 @@ impl ConversationView {
223
223
h_flex()
224
224
.w_full()
225
225
.flex_none()
226
.px(px(24.))
227
.pt(px(2.))
228
.pb(px(4.))
226
.px(px(20.))
227
.pt(px(12.))
228
.pb(px(12.))
229
229
.child(
230
230
h_flex()
231
231
.id("new-post")
@@ -256,7 +256,7 @@ impl ConversationView {
256
256
.focus_handle(cx)
257
257
.contains_focused(window, cx);
258
258
let subject = (!editing).then(|| {
259
div().w_full().px(px(24.)).pt(px(10.)).child(
259
div().w_full().px(px(20.)).pt(px(12.)).child(
260
260
div()
261
261
.w_full()
262
262
.h(px(36.))
@@ -287,8 +287,8 @@ impl ConversationView {
287
287
.child(
288
288
h_flex()
289
289
.w_full()
290
.px(px(24.))
291
.pb(px(10.))
290
.px(px(20.))
291
.pb(px(12.))
292
292
.justify_end()
293
293
.child(
294
294
Button::new("cancel-new-post")
@@ -223,9 +223,9 @@ impl ConversationView {223
h_flex()223
h_flex()224
.w_full()224
.w_full()225
.flex_none()225
.flex_none()226
.px(px(24.))226
.px(px(20.))227
.pt(px(2.))227
.pt(px(12.))228
.pb(px(4.))228
.pb(px(12.))229
.child(229
.child(230
h_flex()230
h_flex()231
.id("new-post")231
.id("new-post")@@ -256,7 +256,7 @@ impl ConversationView {256
.focus_handle(cx)256
.focus_handle(cx)257
.contains_focused(window, cx);257
.contains_focused(window, cx);258
let subject = (!editing).then(|| {258
let subject = (!editing).then(|| {259
div().w_full().px(px(24.)).pt(px(10.)).child(259
div().w_full().px(px(20.)).pt(px(12.)).child(260
div()260
div()261
.w_full()261
.w_full()262
.h(px(36.))262
.h(px(36.))@@ -287,8 +287,8 @@ impl ConversationView {287
.child(287
.child(288
h_flex()288
h_flex()289
.w_full()289
.w_full()290
.px(px(24.))290
.px(px(20.))291
.pb(px(10.))291
.pb(px(12.))292
.justify_end()292
.justify_end()293
.child(293
.child(294
Button::new("cancel-new-post")294
Button::new("cancel-new-post")@@ -17,7 +17,7 @@ const THUMB_WIDTH_COMPACT: f32 = 72.;
17
17
const THUMB_MIN_HEIGHT: f32 = 48.;
18
18
const THUMB_MAX_HEIGHT: f32 = 112.;
19
19
const THUMB_RADIUS: f32 = 6.;
20
const CLOSE_SIZE: f32 = 22.;
20
const CLOSE_SIZE: f32 = 28.;
21
21
const JOIN_CHIP_HEIGHT: f32 = 24.;
22
22
23
23
pub type CloseHandler = Rc<dyn Fn(&mut Window, &mut App)>;
@@ -97,16 +97,16 @@ pub fn link_preview_card(
97
97
div()
98
98
.id(ElementId::Name(format!("{id}-close").into()))
99
99
.absolute()
100
.top(px(4.))
101
.right(px(4.))
100
.top(px(8.))
101
.right(px(8.))
102
102
.size(px(CLOSE_SIZE))
103
103
.flex()
104
104
.items_center()
105
105
.justify_center()
106
.rounded(px(6.))
106
.rounded(px(7.))
107
107
.cursor_pointer()
108
.hover(|button| button.bg(theme::row_hover()))
109
.child(icon(IconName::Close, 12., theme::text_muted()))
108
.hover(|button| button.bg(theme::popup_hover()))
109
.child(icon(IconName::Close, 14., theme::text_muted()))
110
110
.on_click(move |_, window, cx| {
111
111
cx.stop_propagation();
112
112
close(window, cx);
@@ -119,10 +119,10 @@ pub fn link_preview_card(
119
119
.when(compact, |card| card.w_full())
120
120
.when(!compact, |card| card.w(px(CARD_WIDTH)))
121
121
.max_w(relative(1.))
122
.gap(px(10.))
122
.gap(px(12.))
123
123
.p(px(8.))
124
124
.items_start()
125
.rounded(px(9.))
125
.rounded(px(10.))
126
126
.bg(theme::surface())
127
127
.cursor_pointer()
128
128
.hover(|card| card.bg(theme::row_hover()))
@@ -167,8 +167,8 @@ pub fn meeting_join_chip(id: String, url: String) -> AnyElement {
167
167
.flex_none()
168
168
.self_start()
169
169
.h(px(JOIN_CHIP_HEIGHT))
170
.px(px(10.))
171
.gap(px(5.))
170
.px(px(12.))
171
.gap(px(4.))
172
172
.items_center()
173
173
.rounded_full()
174
174
.bg(theme::accent())
@@ -17,7 +17,7 @@ const THUMB_WIDTH_COMPACT: f32 = 72.;17
const THUMB_MIN_HEIGHT: f32 = 48.;17
const THUMB_MIN_HEIGHT: f32 = 48.;18
const THUMB_MAX_HEIGHT: f32 = 112.;18
const THUMB_MAX_HEIGHT: f32 = 112.;19
const THUMB_RADIUS: f32 = 6.;19
const THUMB_RADIUS: f32 = 6.;20
const CLOSE_SIZE: f32 = 22.;20
const CLOSE_SIZE: f32 = 28.;21
const JOIN_CHIP_HEIGHT: f32 = 24.;21
const JOIN_CHIP_HEIGHT: f32 = 24.;22
22
23
pub type CloseHandler = Rc<dyn Fn(&mut Window, &mut App)>;23
pub type CloseHandler = Rc<dyn Fn(&mut Window, &mut App)>;@@ -97,16 +97,16 @@ pub fn link_preview_card(97
div()97
div()98
.id(ElementId::Name(format!("{id}-close").into()))98
.id(ElementId::Name(format!("{id}-close").into()))99
.absolute()99
.absolute()100
.top(px(4.))100
.top(px(8.))101
.right(px(4.))101
.right(px(8.))102
.size(px(CLOSE_SIZE))102
.size(px(CLOSE_SIZE))103
.flex()103
.flex()104
.items_center()104
.items_center()105
.justify_center()105
.justify_center()106
.rounded(px(6.))106
.rounded(px(7.))107
.cursor_pointer()107
.cursor_pointer()108
.hover(|button| button.bg(theme::row_hover()))108
.hover(|button| button.bg(theme::popup_hover()))109
.child(icon(IconName::Close, 12., theme::text_muted()))109
.child(icon(IconName::Close, 14., theme::text_muted()))110
.on_click(move |_, window, cx| {110
.on_click(move |_, window, cx| {111
cx.stop_propagation();111
cx.stop_propagation();112
close(window, cx);112
close(window, cx);@@ -119,10 +119,10 @@ pub fn link_preview_card(119
.when(compact, |card| card.w_full())119
.when(compact, |card| card.w_full())120
.when(!compact, |card| card.w(px(CARD_WIDTH)))120
.when(!compact, |card| card.w(px(CARD_WIDTH)))121
.max_w(relative(1.))121
.max_w(relative(1.))122
.gap(px(10.))122
.gap(px(12.))123
.p(px(8.))123
.p(px(8.))124
.items_start()124
.items_start()125
.rounded(px(9.))125
.rounded(px(10.))126
.bg(theme::surface())126
.bg(theme::surface())127
.cursor_pointer()127
.cursor_pointer()128
.hover(|card| card.bg(theme::row_hover()))128
.hover(|card| card.bg(theme::row_hover()))@@ -167,8 +167,8 @@ pub fn meeting_join_chip(id: String, url: String) -> AnyElement {167
.flex_none()167
.flex_none()168
.self_start()168
.self_start()169
.h(px(JOIN_CHIP_HEIGHT))169
.h(px(JOIN_CHIP_HEIGHT))170
.px(px(10.))170
.px(px(12.))171
.gap(px(5.))171
.gap(px(4.))172
.items_center()172
.items_center()173
.rounded_full()173
.rounded_full()174
.bg(theme::accent())174
.bg(theme::accent())@@ -24,8 +24,8 @@ use crate::theme;
24
24
25
25
pub type RowAction = Option<Box<dyn Fn(&mut App)>>;
26
26
27
const AVATAR_SIZE: f32 = 28.;
28
const AVATAR_GAP: f32 = 8.;
27
pub(super) const AVATAR_SIZE: f32 = 28.;
28
pub(super) const AVATAR_GAP: f32 = 8.;
29
29
const SERIES_START_GAP: f32 = 8.;
30
30
pub(super) const BODY_SIZE: f32 = 13.5;
31
31
const MAX_WIDTH_RATIO: f32 = 0.7;
@@ -62,13 +62,13 @@ pub struct RowActions {
62
62
const TOOLBAR_LIFT: f32 = 22.;
63
63
64
64
fn separator_pill(label: &str, fill: Hsla, text_color: Hsla) -> Div {
65
h_flex().w_full().justify_center().mt(px(14.)).mb(px(6.)).child(
65
h_flex().w_full().justify_center().mt(px(12.)).mb(px(6.)).child(
66
66
div()
67
.h(px(22.))
68
.px(px(10.))
67
.h(px(24.))
68
.px(px(8.))
69
69
.flex()
70
70
.items_center()
71
.rounded(px(11.))
71
.rounded(px(12.))
72
72
.bg(fill)
73
73
.text_size(px(11.))
74
74
.text_color(text_color)
@@ -103,8 +103,8 @@ fn bubble(
103
103
.rounded_tr(px(corners.top_right))
104
104
.rounded_br(px(corners.bottom_right))
105
105
.rounded_bl(px(corners.bottom_left))
106
.px(px(11.))
107
.py(px(7.))
106
.px(px(12.))
107
.py(px(8.))
108
108
.text_size(px(BODY_SIZE))
109
109
.line_height(relative(1.45));
110
110
if row.deleted {
@@ -225,8 +225,8 @@ fn bubble(
225
225
element = element.child(
226
226
div()
227
227
.absolute()
228
.right(px(9.))
229
.bottom(px(5.))
228
.right(px(8.))
229
.bottom(px(4.))
230
230
.child(bubble_meta(row, own, saved)),
231
231
);
232
232
}
@@ -369,7 +369,7 @@ pub fn render_skeleton_row(skeleton: &Skeleton, index: usize) -> AnyElement {
369
369
div()
370
370
.id(ElementId::Name(format!("row-{index}").into()))
371
371
.w_full()
372
.px(px(24.))
372
.px(px(20.))
373
373
.pt(px(SERIES_START_GAP))
374
374
.child(pulse("skeleton", line))
375
375
.into_any_element()
@@ -580,7 +580,7 @@ pub fn render_message_row(
580
580
} else {
581
581
px(SERIES_START_GAP)
582
582
};
583
let mut container = v_flex().w_full().px(px(24.));
583
let mut container = v_flex().w_full().px(px(20.));
584
584
if let Some(day) = &row.day_header {
585
585
container = container.child(day_separator(day));
586
586
}
@@ -24,8 +24,8 @@ use crate::theme;24
24
25
pub type RowAction = Option<Box<dyn Fn(&mut App)>>;25
pub type RowAction = Option<Box<dyn Fn(&mut App)>>;26
26
27
const AVATAR_SIZE: f32 = 28.;27
pub(super) const AVATAR_SIZE: f32 = 28.;28
const AVATAR_GAP: f32 = 8.;28
pub(super) const AVATAR_GAP: f32 = 8.;29
const SERIES_START_GAP: f32 = 8.;29
const SERIES_START_GAP: f32 = 8.;30
pub(super) const BODY_SIZE: f32 = 13.5;30
pub(super) const BODY_SIZE: f32 = 13.5;31
const MAX_WIDTH_RATIO: f32 = 0.7;31
const MAX_WIDTH_RATIO: f32 = 0.7;@@ -62,13 +62,13 @@ pub struct RowActions {62
const TOOLBAR_LIFT: f32 = 22.;62
const TOOLBAR_LIFT: f32 = 22.;63
63
64
fn separator_pill(label: &str, fill: Hsla, text_color: Hsla) -> Div {64
fn separator_pill(label: &str, fill: Hsla, text_color: Hsla) -> Div {65
h_flex().w_full().justify_center().mt(px(14.)).mb(px(6.)).child(65
h_flex().w_full().justify_center().mt(px(12.)).mb(px(6.)).child(66
div()66
div()67
.h(px(22.))67
.h(px(24.))68
.px(px(10.))68
.px(px(8.))69
.flex()69
.flex()70
.items_center()70
.items_center()71
.rounded(px(11.))71
.rounded(px(12.))72
.bg(fill)72
.bg(fill)73
.text_size(px(11.))73
.text_size(px(11.))74
.text_color(text_color)74
.text_color(text_color)@@ -103,8 +103,8 @@ fn bubble(103
.rounded_tr(px(corners.top_right))103
.rounded_tr(px(corners.top_right))104
.rounded_br(px(corners.bottom_right))104
.rounded_br(px(corners.bottom_right))105
.rounded_bl(px(corners.bottom_left))105
.rounded_bl(px(corners.bottom_left))106
.px(px(11.))106
.px(px(12.))107
.py(px(7.))107
.py(px(8.))108
.text_size(px(BODY_SIZE))108
.text_size(px(BODY_SIZE))109
.line_height(relative(1.45));109
.line_height(relative(1.45));110
if row.deleted {110
if row.deleted {@@ -225,8 +225,8 @@ fn bubble(225
element = element.child(225
element = element.child(226
div()226
div()227
.absolute()227
.absolute()228
.right(px(9.))228
.right(px(8.))229
.bottom(px(5.))229
.bottom(px(4.))230
.child(bubble_meta(row, own, saved)),230
.child(bubble_meta(row, own, saved)),231
);231
);232
}232
}@@ -369,7 +369,7 @@ pub fn render_skeleton_row(skeleton: &Skeleton, index: usize) -> AnyElement {369
div()369
div()370
.id(ElementId::Name(format!("row-{index}").into()))370
.id(ElementId::Name(format!("row-{index}").into()))371
.w_full()371
.w_full()372
.px(px(24.))372
.px(px(20.))373
.pt(px(SERIES_START_GAP))373
.pt(px(SERIES_START_GAP))374
.child(pulse("skeleton", line))374
.child(pulse("skeleton", line))375
.into_any_element()375
.into_any_element()@@ -580,7 +580,7 @@ pub fn render_message_row(580
} else {580
} else {581
px(SERIES_START_GAP)581
px(SERIES_START_GAP)582
};582
};583
let mut container = v_flex().w_full().px(px(24.));583
let mut container = v_flex().w_full().px(px(20.));584
if let Some(day) = &row.day_header {584
if let Some(day) = &row.day_header {585
container = container.child(day_separator(day));585
container = container.child(day_separator(day));586
}586
}@@ -435,7 +435,7 @@ impl NewChatDraft {
435
435
.id(ElementId::Name(format!("new-chat-chip-{index}").into()))
436
436
.h(px(26.))
437
437
.pl(px(3.))
438
.pr(px(6.))
438
.pr(px(4.))
439
439
.gap(px(6.))
440
440
.items_center()
441
441
.rounded(px(13.))
@@ -459,7 +459,7 @@ impl NewChatDraft {
459
459
.id(ElementId::Name(
460
460
format!("new-chat-chip-remove-{index}").into(),
461
461
))
462
.size(px(16.))
462
.size(px(18.))
463
463
.flex()
464
464
.items_center()
465
465
.justify_center()
@@ -490,7 +490,7 @@ impl NewChatDraft {
490
490
.id(ElementId::Name(format!("new-chat-result-{index}").into()))
491
491
.px(px(6.))
492
492
.h(px(POPUP_ROW_HEIGHT))
493
.gap(px(10.))
493
.gap(px(8.))
494
494
.items_center()
495
495
.rounded(px(6.))
496
496
.cursor_pointer()
@@ -628,10 +628,8 @@ impl NewChatDraft {
628
628
.flex_none()
629
629
.px(px(20.))
630
630
.py(px(8.))
631
.gap(px(10.))
631
.gap(px(8.))
632
632
.items_center()
633
.border_b_1()
634
.border_color(theme::border())
635
633
.child(
636
634
div()
637
635
.text_size(px(14.))
@@ -642,16 +640,16 @@ impl NewChatDraft {
642
640
div()
643
641
.flex_1()
644
642
.h(px(32.))
645
.px(px(10.))
643
.px(px(12.))
646
644
.flex()
647
645
.items_center()
648
646
.rounded(px(8.))
649
.bg(theme::surface())
647
.bg(theme::surface_raised())
650
648
.border_1()
651
649
.border_color(if focused {
652
650
theme::accent()
653
651
} else {
654
theme::border_strong()
652
transparent_black()
655
653
})
656
654
.child(
657
655
div()
@@ -435,7 +435,7 @@ impl NewChatDraft {435
.id(ElementId::Name(format!("new-chat-chip-{index}").into()))435
.id(ElementId::Name(format!("new-chat-chip-{index}").into()))436
.h(px(26.))436
.h(px(26.))437
.pl(px(3.))437
.pl(px(3.))438
.pr(px(6.))438
.pr(px(4.))439
.gap(px(6.))439
.gap(px(6.))440
.items_center()440
.items_center()441
.rounded(px(13.))441
.rounded(px(13.))@@ -459,7 +459,7 @@ impl NewChatDraft {459
.id(ElementId::Name(459
.id(ElementId::Name(460
format!("new-chat-chip-remove-{index}").into(),460
format!("new-chat-chip-remove-{index}").into(),461
))461
))462
.size(px(16.))462
.size(px(18.))463
.flex()463
.flex()464
.items_center()464
.items_center()465
.justify_center()465
.justify_center()@@ -490,7 +490,7 @@ impl NewChatDraft {490
.id(ElementId::Name(format!("new-chat-result-{index}").into()))490
.id(ElementId::Name(format!("new-chat-result-{index}").into()))491
.px(px(6.))491
.px(px(6.))492
.h(px(POPUP_ROW_HEIGHT))492
.h(px(POPUP_ROW_HEIGHT))493
.gap(px(10.))493
.gap(px(8.))494
.items_center()494
.items_center()495
.rounded(px(6.))495
.rounded(px(6.))496
.cursor_pointer()496
.cursor_pointer()@@ -628,10 +628,8 @@ impl NewChatDraft {628
.flex_none()628
.flex_none()629
.px(px(20.))629
.px(px(20.))630
.py(px(8.))630
.py(px(8.))631
.gap(px(10.))631
.gap(px(8.))632
.items_center()632
.items_center()633
.border_b_1()634
.border_color(theme::border())635
.child(633
.child(636
div()634
div()637
.text_size(px(14.))635
.text_size(px(14.))@@ -642,16 +640,16 @@ impl NewChatDraft {642
div()640
div()643
.flex_1()641
.flex_1()644
.h(px(32.))642
.h(px(32.))645
.px(px(10.))643
.px(px(12.))646
.flex()644
.flex()647
.items_center()645
.items_center()648
.rounded(px(8.))646
.rounded(px(8.))649
.bg(theme::surface())647
.bg(theme::surface_raised())650
.border_1()648
.border_1()651
.border_color(if focused {649
.border_color(if focused {652
theme::accent()650
theme::accent()653
} else {651
} else {654
theme::border_strong()652
transparent_black()655
})653
})656
.child(654
.child(657
div()655
div()@@ -7,9 +7,9 @@ use super::message_actions::Action;
7
7
use super::widgets::icon;
8
8
use crate::theme;
9
9
10
const BANNER_HEIGHT: f32 = 36.;
10
const BANNER_HEIGHT: f32 = 40.;
11
11
const BANNER_PADDING: f32 = 12.;
12
const BUTTON_SIZE: f32 = 24.;
12
const BUTTON_SIZE: f32 = 28.;
13
13
const FALLBACK_PREVIEW: &str = "Pinned message";
14
14
15
15
pub struct PinBannerData {
@@ -45,7 +45,7 @@ fn icon_button(id: &'static str, glyph: IconName, action: Action) -> Stateful<Di
45
45
.flex_none()
46
46
.items_center()
47
47
.justify_center()
48
.rounded(px(6.))
48
.rounded(px(7.))
49
49
.cursor_pointer()
50
50
.hover(|button| button.bg(theme::popup_hover()))
51
51
.child(icon(glyph, 14., theme::text_muted()))
@@ -73,9 +73,10 @@ pub fn render_pin_banner(data: PinBannerData, actions: PinBannerActions) -> AnyE
73
73
.group("pin-banner")
74
74
.h(px(BANNER_HEIGHT))
75
75
.flex_none()
76
.mx(px(16.))
77
.mb(px(4.))
78
.px(px(BANNER_PADDING))
76
.mx(px(20.))
77
.mb(px(8.))
78
.pl(px(BANNER_PADDING))
79
.pr(px(6.))
79
80
.gap(px(8.))
80
81
.items_center()
81
82
.rounded(px(8.))
@@ -7,9 +7,9 @@ use super::message_actions::Action;7
use super::widgets::icon;7
use super::widgets::icon;8
use crate::theme;8
use crate::theme;9
9
10
const BANNER_HEIGHT: f32 = 36.;10
const BANNER_HEIGHT: f32 = 40.;11
const BANNER_PADDING: f32 = 12.;11
const BANNER_PADDING: f32 = 12.;12
const BUTTON_SIZE: f32 = 24.;12
const BUTTON_SIZE: f32 = 28.;13
const FALLBACK_PREVIEW: &str = "Pinned message";13
const FALLBACK_PREVIEW: &str = "Pinned message";14
14
15
pub struct PinBannerData {15
pub struct PinBannerData {@@ -45,7 +45,7 @@ fn icon_button(id: &'static str, glyph: IconName, action: Action) -> Stateful<Di45
.flex_none()45
.flex_none()46
.items_center()46
.items_center()47
.justify_center()47
.justify_center()48
.rounded(px(6.))48
.rounded(px(7.))49
.cursor_pointer()49
.cursor_pointer()50
.hover(|button| button.bg(theme::popup_hover()))50
.hover(|button| button.bg(theme::popup_hover()))51
.child(icon(glyph, 14., theme::text_muted()))51
.child(icon(glyph, 14., theme::text_muted()))@@ -73,9 +73,10 @@ pub fn render_pin_banner(data: PinBannerData, actions: PinBannerActions) -> AnyE73
.group("pin-banner")73
.group("pin-banner")74
.h(px(BANNER_HEIGHT))74
.h(px(BANNER_HEIGHT))75
.flex_none()75
.flex_none()76
.mx(px(16.))76
.mx(px(20.))77
.mb(px(4.))77
.mb(px(8.))78
.px(px(BANNER_PADDING))78
.pl(px(BANNER_PADDING))79
.pr(px(6.))79
.gap(px(8.))80
.gap(px(8.))80
.items_center()81
.items_center()81
.rounded(px(8.))82
.rounded(px(8.))@@ -385,7 +385,7 @@ pub fn render_post(
385
385
card = card.children(reply_footer(index, open_reply, reply_editor));
386
386
div()
387
387
.w_full()
388
.px(px(24.))
388
.px(px(20.))
389
389
.pt(px(CARD_GAP))
390
390
.child(card)
391
391
.into_any_element()
@@ -385,7 +385,7 @@ pub fn render_post(385
card = card.children(reply_footer(index, open_reply, reply_editor));385
card = card.children(reply_footer(index, open_reply, reply_editor));386
div()386
div()387
.w_full()387
.w_full()388
.px(px(24.))388
.px(px(20.))389
.pt(px(CARD_GAP))389
.pt(px(CARD_GAP))390
.child(card)390
.child(card)391
.into_any_element()391
.into_any_element()@@ -13,8 +13,8 @@ use crate::sidebar_model::{any_unread_channel, unread_chat_count};
13
13
use crate::theme;
14
14
15
15
pub const RAIL_WIDTH: f32 = 56.;
16
const ITEM_WIDTH: f32 = 44.;
17
const ITEM_HEIGHT: f32 = 48.;
16
const ITEM_WIDTH: f32 = 48.;
17
const ITEM_HEIGHT: f32 = 52.;
18
18
const ICON_SIZE: f32 = 20.;
19
19
20
20
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -137,8 +137,8 @@ impl RailView {
137
137
.flex_none()
138
138
.items_center()
139
139
.justify_center()
140
.gap(px(3.))
141
.rounded(px(8.))
140
.gap(px(4.))
141
.rounded(px(10.))
142
142
.cursor_pointer()
143
143
.when(active, |button| button.bg(theme::surface_raised()))
144
144
.when(!active, |button| button.hover(|button| button.bg(theme::row_hover())))
@@ -164,15 +164,15 @@ fn badge(badge: RailBadge) -> Div {
164
164
RailBadge::None => div(),
165
165
RailBadge::Dot => div()
166
166
.absolute()
167
.top(px(6.))
168
.right(px(9.))
167
.top(px(8.))
168
.left(px(31.))
169
169
.size(px(7.))
170
170
.rounded_full()
171
171
.bg(theme::accent()),
172
172
RailBadge::Count(count) => div()
173
173
.absolute()
174
.top(px(3.))
175
.right(px(5.))
174
.top(px(5.))
175
.left(px(28.))
176
176
.min_w(px(16.))
177
177
.h(px(16.))
178
178
.px(px(4.))
@@ -205,9 +205,8 @@ impl Render for RailView {
205
205
.h_full()
206
206
.flex_none()
207
207
.items_center()
208
.gap(px(4.))
209
.pt(px(2.))
210
.mr(px(-6.))
208
.gap(px(2.))
209
.pt(px(0.))
211
210
.children(
212
211
rail_items(activity_unread, unread_chats as usize, channel_dot)
213
212
.iter()
@@ -13,8 +13,8 @@ use crate::sidebar_model::{any_unread_channel, unread_chat_count};13
use crate::theme;13
use crate::theme;14
14
15
pub const RAIL_WIDTH: f32 = 56.;15
pub const RAIL_WIDTH: f32 = 56.;16
const ITEM_WIDTH: f32 = 44.;16
const ITEM_WIDTH: f32 = 48.;17
const ITEM_HEIGHT: f32 = 48.;17
const ITEM_HEIGHT: f32 = 52.;18
const ICON_SIZE: f32 = 20.;18
const ICON_SIZE: f32 = 20.;19
19
20
#[derive(Debug, Clone, Copy, PartialEq, Eq)]20
#[derive(Debug, Clone, Copy, PartialEq, Eq)]@@ -137,8 +137,8 @@ impl RailView {137
.flex_none()137
.flex_none()138
.items_center()138
.items_center()139
.justify_center()139
.justify_center()140
.gap(px(3.))140
.gap(px(4.))141
.rounded(px(8.))141
.rounded(px(10.))142
.cursor_pointer()142
.cursor_pointer()143
.when(active, |button| button.bg(theme::surface_raised()))143
.when(active, |button| button.bg(theme::surface_raised()))144
.when(!active, |button| button.hover(|button| button.bg(theme::row_hover())))144
.when(!active, |button| button.hover(|button| button.bg(theme::row_hover())))@@ -164,15 +164,15 @@ fn badge(badge: RailBadge) -> Div {164
RailBadge::None => div(),164
RailBadge::None => div(),165
RailBadge::Dot => div()165
RailBadge::Dot => div()166
.absolute()166
.absolute()167
.top(px(6.))167
.top(px(8.))168
.right(px(9.))168
.left(px(31.))169
.size(px(7.))169
.size(px(7.))170
.rounded_full()170
.rounded_full()171
.bg(theme::accent()),171
.bg(theme::accent()),172
RailBadge::Count(count) => div()172
RailBadge::Count(count) => div()173
.absolute()173
.absolute()174
.top(px(3.))174
.top(px(5.))175
.right(px(5.))175
.left(px(28.))176
.min_w(px(16.))176
.min_w(px(16.))177
.h(px(16.))177
.h(px(16.))178
.px(px(4.))178
.px(px(4.))@@ -205,9 +205,8 @@ impl Render for RailView {205
.h_full()205
.h_full()206
.flex_none()206
.flex_none()207
.items_center()207
.items_center()208
.gap(px(4.))208
.gap(px(2.))209
.pt(px(2.))209
.pt(px(0.))210
.mr(px(-6.))211
.children(210
.children(212
rail_items(activity_unread, unread_chats as usize, channel_dot)211
rail_items(activity_unread, unread_chats as usize, channel_dot)213
.iter()212
.iter()@@ -173,7 +173,7 @@ fn tab_button(tab: &ReactionTab, active: bool, select_tab: SelectTab) -> Statefu
173
173
format!("reaction-tab-{}", glyph.as_deref().unwrap_or("all")).into(),
174
174
))
175
175
.h(px(TAB_HEIGHT))
176
.px(px(10.))
176
.px(px(12.))
177
177
.gap(px(4.))
178
178
.items_center()
179
179
.rounded(px(7.))
@@ -198,7 +198,7 @@ fn entry_row(entry: &ReactionEntry, directory: &Directory) -> Div {
198
198
h_flex()
199
199
.h(px(ENTRY_HEIGHT))
200
200
.px(px(8.))
201
.gap(px(10.))
201
.gap(px(8.))
202
202
.items_center()
203
203
.child(person_avatar(
204
204
directory,
@@ -173,7 +173,7 @@ fn tab_button(tab: &ReactionTab, active: bool, select_tab: SelectTab) -> Statefu173
format!("reaction-tab-{}", glyph.as_deref().unwrap_or("all")).into(),173
format!("reaction-tab-{}", glyph.as_deref().unwrap_or("all")).into(),174
))174
))175
.h(px(TAB_HEIGHT))175
.h(px(TAB_HEIGHT))176
.px(px(10.))176
.px(px(12.))177
.gap(px(4.))177
.gap(px(4.))178
.items_center()178
.items_center()179
.rounded(px(7.))179
.rounded(px(7.))@@ -198,7 +198,7 @@ fn entry_row(entry: &ReactionEntry, directory: &Directory) -> Div {198
h_flex()198
h_flex()199
.h(px(ENTRY_HEIGHT))199
.h(px(ENTRY_HEIGHT))200
.px(px(8.))200
.px(px(8.))201
.gap(px(10.))201
.gap(px(8.))202
.items_center()202
.items_center()203
.child(person_avatar(203
.child(person_avatar(204
directory,204
directory,@@ -54,7 +54,7 @@ impl SavedPanel {
54
54
.h(px(52.))
55
55
.flex_none()
56
56
.pl(px(16.))
57
.pr(px(10.))
57
.pr(px(12.))
58
58
.gap(px(8.))
59
59
.items_center()
60
60
.child(
@@ -93,7 +93,7 @@ impl SavedPanel {
93
93
.relative()
94
94
.mx(px(6.))
95
95
.p(px(10.))
96
.gap(px(10.))
96
.gap(px(12.))
97
97
.items_start()
98
98
.rounded(px(8.))
99
99
.cursor_pointer()
@@ -108,7 +108,7 @@ impl SavedPanel {
108
108
v_flex()
109
109
.flex_1()
110
110
.min_w_0()
111
.gap(px(3.))
111
.gap(px(4.))
112
112
.child(
113
113
h_flex()
114
114
.gap(px(6.))
@@ -54,7 +54,7 @@ impl SavedPanel {54
.h(px(52.))54
.h(px(52.))55
.flex_none()55
.flex_none()56
.pl(px(16.))56
.pl(px(16.))57
.pr(px(10.))57
.pr(px(12.))58
.gap(px(8.))58
.gap(px(8.))59
.items_center()59
.items_center()60
.child(60
.child(@@ -93,7 +93,7 @@ impl SavedPanel {93
.relative()93
.relative()94
.mx(px(6.))94
.mx(px(6.))95
.p(px(10.))95
.p(px(10.))96
.gap(px(10.))96
.gap(px(12.))97
.items_start()97
.items_start()98
.rounded(px(8.))98
.rounded(px(8.))99
.cursor_pointer()99
.cursor_pointer()@@ -108,7 +108,7 @@ impl SavedPanel {108
v_flex()108
v_flex()109
.flex_1()109
.flex_1()110
.min_w_0()110
.min_w_0()111
.gap(px(3.))111
.gap(px(4.))112
.child(112
.child(113
h_flex()113
h_flex()114
.gap(px(6.))114
.gap(px(6.))@@ -476,22 +476,20 @@ impl AppShell {
476
476
.w_full()
477
477
.gap(px(ISLAND_GAP))
478
478
.pr(px(ISLAND_GAP))
479
.child(self.rail.clone())
479
.py(px(ISLAND_GAP))
480
480
.child(
481
self.sidebar
482
.clone()
483
.cached(StyleRefinement::default().w(px(SIDEBAR_WIDTH)).h_full().flex_none()),
481
h_flex()
482
.h_full()
483
.flex_none()
484
.child(self.rail.clone())
485
.child(
486
self.sidebar
487
.clone()
488
.cached(StyleRefinement::default().w(px(SIDEBAR_WIDTH)).h_full().flex_none()),
489
),
484
490
)
485
491
.child(match call_view {
486
Some(call_view) => h_flex()
487
.flex_1()
488
.min_w_0()
489
.h_full()
490
.rounded(px(10.))
491
.bg(theme::surface())
492
.overflow_hidden()
493
.child(call_view)
494
.into_any_element(),
492
Some(call_view) => call_view,
495
493
None => self
496
494
.conversation
497
495
.clone()
@@ -476,22 +476,20 @@ impl AppShell {476
.w_full()476
.w_full()477
.gap(px(ISLAND_GAP))477
.gap(px(ISLAND_GAP))478
.pr(px(ISLAND_GAP))478
.pr(px(ISLAND_GAP))479
.child(self.rail.clone())479
.py(px(ISLAND_GAP))480
.child(480
.child(481
self.sidebar481
h_flex()482
.clone()482
.h_full()483
.cached(StyleRefinement::default().w(px(SIDEBAR_WIDTH)).h_full().flex_none()),483
.flex_none()484
.child(self.rail.clone())485
.child(486
self.sidebar487
.clone()488
.cached(StyleRefinement::default().w(px(SIDEBAR_WIDTH)).h_full().flex_none()),489
),484
)490
)485
.child(match call_view {491
.child(match call_view {486
Some(call_view) => h_flex()492
Some(call_view) => call_view,487
.flex_1()488
.min_w_0()489
.h_full()490
.rounded(px(10.))491
.bg(theme::surface())492
.overflow_hidden()493
.child(call_view)494
.into_any_element(),495
None => self493
None => self496
.conversation494
.conversation497
.clone()495
.clone()@@ -48,7 +48,7 @@ const TEAMS_LABEL: &str = "Teams";
48
48
const HIDDEN_TEAMS_LABEL: &str = "Hidden teams";
49
49
const TEAM_ROW_HEIGHT: f32 = 40.;
50
50
const REVEAL_ROW_HEIGHT: f32 = 32.;
51
const NEW_CHAT_BUTTON_SIZE: f32 = 34.;
51
const NEW_CHAT_BUTTON_SIZE: f32 = 32.;
52
52
const MENU_ICON_SIZE: f32 = 15.;
53
53
const MUTED_ICON_SIZE: f32 = 13.;
54
54
const NOTIFICATION_ICON_SIZE: f32 = 13.;
@@ -525,7 +525,7 @@ impl SidebarView {
525
525
.mx(px(6.))
526
526
.h(px(ROW_HEIGHT))
527
527
.px(px(10.))
528
.gap(px(10.))
528
.gap(px(12.))
529
529
.items_center()
530
530
.rounded(px(8.))
531
531
.bg(theme::surface_raised())
@@ -570,9 +570,8 @@ impl SidebarView {
570
570
.id(SharedString::from(format!("section-{}", section.id)))
571
571
.h(px(SECTION_HEIGHT))
572
572
.mt(px(SECTION_GAP))
573
.mx(px(4.))
574
.pl(px(8.))
575
.pr(px(10.))
573
.mx(px(6.))
574
.px(px(10.))
576
575
.gap(px(6.))
577
576
.items_center()
578
577
.rounded(px(6.))
@@ -636,7 +635,7 @@ impl SidebarView {
636
635
div()
637
636
.id(SharedString::from(format!("see-more-{}", section.id)))
638
637
.mx(px(6.))
639
.pl(px(56.))
638
.pl(px(10. + AVATAR_SIZE + 12.))
640
639
.h(px(SEE_MORE_HEIGHT))
641
640
.flex()
642
641
.items_center()
@@ -773,7 +772,7 @@ impl SidebarView {
773
772
.mx(px(6.))
774
773
.h(px(ROW_HEIGHT))
775
774
.px(px(10.))
776
.gap(px(10.))
775
.gap(px(12.))
777
776
.items_center()
778
777
.rounded(px(8.))
779
778
.cursor_pointer()
@@ -889,8 +888,8 @@ impl SidebarView {
889
888
list = with_spacer(list, &mut skipped_height);
890
889
list = list.child(
891
890
div()
892
.ml(px(44.))
893
.mr(px(20.))
891
.ml(px(16.))
892
.mr(px(16.))
894
893
.h(px(HINT_HEIGHT))
895
894
.flex()
896
895
.items_center()
@@ -958,7 +957,7 @@ impl SidebarView {
958
957
.mx(px(6.))
959
958
.h(px(PINNED_CHANNEL_HEIGHT))
960
959
.px(px(10.))
961
.gap(px(10.))
960
.gap(px(12.))
962
961
.items_center()
963
962
.rounded(px(8.))
964
963
.cursor_pointer()
@@ -1038,7 +1037,7 @@ impl SidebarView {
1038
1037
div()
1039
1038
.h(px(SECTION_HEIGHT))
1040
1039
.mt(px(SECTION_GAP))
1041
.px(px(12.))
1040
.px(px(16.))
1042
1041
.flex()
1043
1042
.items_center()
1044
1043
.text_size(px(12.))
@@ -48,7 +48,7 @@ const TEAMS_LABEL: &str = "Teams";48
const HIDDEN_TEAMS_LABEL: &str = "Hidden teams";48
const HIDDEN_TEAMS_LABEL: &str = "Hidden teams";49
const TEAM_ROW_HEIGHT: f32 = 40.;49
const TEAM_ROW_HEIGHT: f32 = 40.;50
const REVEAL_ROW_HEIGHT: f32 = 32.;50
const REVEAL_ROW_HEIGHT: f32 = 32.;51
const NEW_CHAT_BUTTON_SIZE: f32 = 34.;51
const NEW_CHAT_BUTTON_SIZE: f32 = 32.;52
const MENU_ICON_SIZE: f32 = 15.;52
const MENU_ICON_SIZE: f32 = 15.;53
const MUTED_ICON_SIZE: f32 = 13.;53
const MUTED_ICON_SIZE: f32 = 13.;54
const NOTIFICATION_ICON_SIZE: f32 = 13.;54
const NOTIFICATION_ICON_SIZE: f32 = 13.;@@ -525,7 +525,7 @@ impl SidebarView {525
.mx(px(6.))525
.mx(px(6.))526
.h(px(ROW_HEIGHT))526
.h(px(ROW_HEIGHT))527
.px(px(10.))527
.px(px(10.))528
.gap(px(10.))528
.gap(px(12.))529
.items_center()529
.items_center()530
.rounded(px(8.))530
.rounded(px(8.))531
.bg(theme::surface_raised())531
.bg(theme::surface_raised())@@ -570,9 +570,8 @@ impl SidebarView {570
.id(SharedString::from(format!("section-{}", section.id)))570
.id(SharedString::from(format!("section-{}", section.id)))571
.h(px(SECTION_HEIGHT))571
.h(px(SECTION_HEIGHT))572
.mt(px(SECTION_GAP))572
.mt(px(SECTION_GAP))573
.mx(px(4.))573
.mx(px(6.))574
.pl(px(8.))574
.px(px(10.))575
.pr(px(10.))576
.gap(px(6.))575
.gap(px(6.))577
.items_center()576
.items_center()578
.rounded(px(6.))577
.rounded(px(6.))@@ -636,7 +635,7 @@ impl SidebarView {636
div()635
div()637
.id(SharedString::from(format!("see-more-{}", section.id)))636
.id(SharedString::from(format!("see-more-{}", section.id)))638
.mx(px(6.))637
.mx(px(6.))639
.pl(px(56.))638
.pl(px(10. + AVATAR_SIZE + 12.))640
.h(px(SEE_MORE_HEIGHT))639
.h(px(SEE_MORE_HEIGHT))641
.flex()640
.flex()642
.items_center()641
.items_center()@@ -773,7 +772,7 @@ impl SidebarView {773
.mx(px(6.))772
.mx(px(6.))774
.h(px(ROW_HEIGHT))773
.h(px(ROW_HEIGHT))775
.px(px(10.))774
.px(px(10.))776
.gap(px(10.))775
.gap(px(12.))777
.items_center()776
.items_center()778
.rounded(px(8.))777
.rounded(px(8.))779
.cursor_pointer()778
.cursor_pointer()@@ -889,8 +888,8 @@ impl SidebarView {889
list = with_spacer(list, &mut skipped_height);888
list = with_spacer(list, &mut skipped_height);890
list = list.child(889
list = list.child(891
div()890
div()892
.ml(px(44.))891
.ml(px(16.))893
.mr(px(20.))892
.mr(px(16.))894
.h(px(HINT_HEIGHT))893
.h(px(HINT_HEIGHT))895
.flex()894
.flex()896
.items_center()895
.items_center()@@ -958,7 +957,7 @@ impl SidebarView {958
.mx(px(6.))957
.mx(px(6.))959
.h(px(PINNED_CHANNEL_HEIGHT))958
.h(px(PINNED_CHANNEL_HEIGHT))960
.px(px(10.))959
.px(px(10.))961
.gap(px(10.))960
.gap(px(12.))962
.items_center()961
.items_center()963
.rounded(px(8.))962
.rounded(px(8.))964
.cursor_pointer()963
.cursor_pointer()@@ -1038,7 +1037,7 @@ impl SidebarView {1038
div()1037
div()1039
.h(px(SECTION_HEIGHT))1038
.h(px(SECTION_HEIGHT))1040
.mt(px(SECTION_GAP))1039
.mt(px(SECTION_GAP))1041
.px(px(12.))1040
.px(px(16.))1042
.flex()1041
.flex()1043
.items_center()1042
.items_center()1044
.text_size(px(12.))1043
.text_size(px(12.))@@ -48,7 +48,7 @@ pub fn page_header(title: &str) -> Div {
48
48
.items_center()
49
49
.gap(px(6.))
50
50
.pl(px(16.))
51
.pr(px(10.))
51
.pr(px(12.))
52
52
.child(
53
53
div()
54
54
.flex_1()
@@ -48,7 +48,7 @@ pub fn page_header(title: &str) -> Div {48
.items_center()48
.items_center()49
.gap(px(6.))49
.gap(px(6.))50
.pl(px(16.))50
.pl(px(16.))51
.pr(px(10.))51
.pr(px(12.))52
.child(52
.child(53
div()53
div()54
.flex_1()54
.flex_1()