Ensure the titlebar stays large enough even with small ui sizes
This commit is contained in:
parent
a526f23c81
commit
c2d6d24952
1 changed files with 13 additions and 7 deletions
|
@ -31,9 +31,9 @@ use std::sync::Arc;
|
||||||
use call::ActiveCall;
|
use call::ActiveCall;
|
||||||
use client::{Client, UserStore};
|
use client::{Client, UserStore};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
div, rems, AppContext, Component, Div, InteractiveComponent, Model, ParentComponent, Render,
|
div, px, rems, AppContext, Component, Div, InteractiveComponent, Model, ParentComponent,
|
||||||
Stateful, StatefulInteractiveComponent, Styled, Subscription, ViewContext, VisualContext,
|
Render, Stateful, StatefulInteractiveComponent, Styled, Subscription, ViewContext,
|
||||||
WeakView, WindowBounds,
|
VisualContext, WeakView, WindowBounds,
|
||||||
};
|
};
|
||||||
use project::Project;
|
use project::Project;
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
|
@ -88,12 +88,17 @@ impl Render for CollabTitlebarItem {
|
||||||
h_stack()
|
h_stack()
|
||||||
.id("titlebar")
|
.id("titlebar")
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.when(
|
|
||||||
!matches!(cx.window_bounds(), WindowBounds::Fullscreen),
|
|
||||||
|s| s.pl_20(),
|
|
||||||
)
|
|
||||||
.w_full()
|
.w_full()
|
||||||
.h(rems(1.75))
|
.h(rems(1.75))
|
||||||
|
// Set a non-scaling min-height here to ensure the titlebar is
|
||||||
|
// always at least the height of the traffic lights.
|
||||||
|
.min_h(px(32.))
|
||||||
|
.when(
|
||||||
|
!matches!(cx.window_bounds(), WindowBounds::Fullscreen),
|
||||||
|
// Use pixels here instead of a rem-based size because the macOS traffic
|
||||||
|
// lights are a static size, and don't scale with the rest of the UI.
|
||||||
|
|s| s.pl(px(68.)),
|
||||||
|
)
|
||||||
.bg(cx.theme().colors().title_bar_background)
|
.bg(cx.theme().colors().title_bar_background)
|
||||||
.on_click(|_, event, cx| {
|
.on_click(|_, event, cx| {
|
||||||
if event.up.click_count == 2 {
|
if event.up.click_count == 2 {
|
||||||
|
@ -102,6 +107,7 @@ impl Render for CollabTitlebarItem {
|
||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
h_stack()
|
h_stack()
|
||||||
|
.gap_1()
|
||||||
// TODO - Add player menu
|
// TODO - Add player menu
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue