Update imports, tab height const
This commit is contained in:
parent
286f654517
commit
30b01b9bc0
2 changed files with 6 additions and 9 deletions
|
@ -53,10 +53,7 @@ use std::{
|
||||||
time::{Duration, Instant},
|
time::{Duration, Instant},
|
||||||
};
|
};
|
||||||
use theme::ThemeSettings;
|
use theme::ThemeSettings;
|
||||||
use ui::{
|
use ui::{prelude::*, Tab, TabBar, Tooltip};
|
||||||
h_stack, prelude::*, v_stack, Button, ButtonLike, Icon, IconButton, IconElement, Label, TabBar,
|
|
||||||
Tooltip, TAB_HEIGHT_IN_REMS,
|
|
||||||
};
|
|
||||||
use util::{paths::CONVERSATIONS_DIR, post_inc, ResultExt, TryFutureExt};
|
use util::{paths::CONVERSATIONS_DIR, post_inc, ResultExt, TryFutureExt};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
use workspace::{
|
use workspace::{
|
||||||
|
@ -1129,13 +1126,13 @@ impl Render for AssistantPanel {
|
||||||
.border()
|
.border()
|
||||||
.border_color(gpui::red())
|
.border_color(gpui::red())
|
||||||
} else {
|
} else {
|
||||||
let header = TabBar::new("assistant_header")
|
let header = ui::TabBar::new("assistant_header")
|
||||||
.start_child(
|
.start_child(
|
||||||
h_stack().gap_1().child(Self::render_hamburger_button(cx)), // .children(title),
|
h_stack().gap_1().child(Self::render_hamburger_button(cx)), // .children(title),
|
||||||
)
|
)
|
||||||
.children(self.active_editor().map(|editor| {
|
.children(self.active_editor().map(|editor| {
|
||||||
h_stack()
|
h_stack()
|
||||||
.h(rems(TAB_HEIGHT_IN_REMS))
|
.h(rems(ui::Tab::HEIGHT_IN_REMS))
|
||||||
.flex_1()
|
.flex_1()
|
||||||
.px_2()
|
.px_2()
|
||||||
.child(Label::new(editor.read(cx).title(cx)).into_element())
|
.child(Label::new(editor.read(cx).title(cx)).into_element())
|
||||||
|
|
|
@ -3,8 +3,6 @@ use gpui::{AnyElement, IntoElement, Stateful};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
pub const TAB_HEIGHT_IN_REMS: f32 = 30. / 16.;
|
|
||||||
|
|
||||||
/// The position of a [`Tab`] within a list of tabs.
|
/// The position of a [`Tab`] within a list of tabs.
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum TabPosition {
|
pub enum TabPosition {
|
||||||
|
@ -50,6 +48,8 @@ impl Tab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const HEIGHT_IN_REMS: f32 = 30. / 16.;
|
||||||
|
|
||||||
pub fn position(mut self, position: TabPosition) -> Self {
|
pub fn position(mut self, position: TabPosition) -> Self {
|
||||||
self.position = position;
|
self.position = position;
|
||||||
self
|
self
|
||||||
|
@ -112,7 +112,7 @@ impl RenderOnce for Tab {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.div
|
self.div
|
||||||
.h(rems(TAB_HEIGHT_IN_REMS))
|
.h(rems(Self::HEIGHT_IN_REMS))
|
||||||
.bg(tab_bg)
|
.bg(tab_bg)
|
||||||
.border_color(cx.theme().colors().border)
|
.border_color(cx.theme().colors().border)
|
||||||
.map(|this| match self.position {
|
.map(|this| match self.position {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue