Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 31 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions crates/story/src/title_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use gpui_component::{
locale,
popup_menu::PopupMenuExt as _,
scroll::ScrollbarShow,
set_locale, ActiveTheme as _, ContextModal as _, IconName, Sizable as _, Theme, ThemeMode,
TitleBar,
set_locale, ActiveTheme as _, ContextModal as _, IconName, PixelsExt, Sizable as _, Theme,
ThemeMode, TitleBar,
};

use crate::{themes::ThemeSwitcher, SelectFont, SelectLocale, SelectRadius, SelectScrollbarShow};
Expand Down Expand Up @@ -219,8 +219,8 @@ impl FontSizeSelector {
impl Render for FontSizeSelector {
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let focus_handle = self.focus_handle.clone();
let font_size = cx.theme().font_size.0 as i32;
let radius = cx.theme().radius.0 as i32;
let font_size = cx.theme().font_size.as_f32() as i32;
let radius = cx.theme().radius.as_f32() as i32;
let scroll_show = cx.theme().scrollbar_show;

div()
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/chart/area_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
shape::Area,
Axis, AxisText, Grid, Plot, StrokeStyle, AXIS_GAP,
},
ActiveTheme,
ActiveTheme, PixelsExt,
};

#[derive(IntoPlot)]
Expand Down Expand Up @@ -94,8 +94,8 @@ where
return;
}

let width = bounds.size.width.0;
let height = bounds.size.height.0 - AXIS_GAP;
let width = bounds.size.width.as_f32();
let height = bounds.size.height.as_f32() - AXIS_GAP;

// X scale
let x = ScalePoint::new(self.data.iter().map(|v| x_fn(v)).collect(), vec![0., width]);
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/chart/bar_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
shape::Bar,
Axis, AxisText, Grid, Plot, AXIS_GAP,
},
ActiveTheme,
ActiveTheme, PixelsExt,
};

#[derive(IntoPlot)]
Expand Down Expand Up @@ -90,8 +90,8 @@ where
return;
};

let width = bounds.size.width.0;
let height = bounds.size.height.0 - AXIS_GAP;
let width = bounds.size.width.as_f32();
let height = bounds.size.height.as_f32() - AXIS_GAP;

// X scale
let x = ScaleBand::new(self.data.iter().map(|v| x_fn(v)).collect(), vec![0., width])
Expand Down
6 changes: 3 additions & 3 deletions crates/ui/src/chart/line_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
shape::Line,
Axis, AxisText, Grid, Plot, StrokeStyle, AXIS_GAP,
},
ActiveTheme,
ActiveTheme, PixelsExt,
};

#[derive(IntoPlot)]
Expand Down Expand Up @@ -85,8 +85,8 @@ where
return;
};

let width = bounds.size.width.0;
let height = bounds.size.height.0 - AXIS_GAP;
let width = bounds.size.width.as_f32();
let height = bounds.size.height.as_f32() - AXIS_GAP;

// X scale
let x = ScalePoint::new(self.data.iter().map(|v| x_fn(v)).collect(), vec![0., width]);
Expand Down
4 changes: 2 additions & 2 deletions crates/ui/src/chart/pie_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
shape::{Arc, Pie},
Plot,
},
ActiveTheme,
ActiveTheme, PixelsExt,
};

#[derive(IntoPlot)]
Expand Down Expand Up @@ -73,7 +73,7 @@ impl<T> Plot for PieChart<T> {
};

let outer_radius = if self.outer_radius.is_zero() {
bounds.size.height.0 * 0.4
bounds.size.height.as_f32() * 0.4
} else {
self.outer_radius
};
Expand Down
4 changes: 2 additions & 2 deletions crates/ui/src/dock/dock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ impl Dock {
.expect("DockArea is missing")
.read(cx);
let area_bounds = dock_area.bounds;
let mut left_dock_size = Pixels(0.0);
let mut right_dock_size = Pixels(0.0);
let mut left_dock_size = px(0.0);
let mut right_dock_size = px(0.0);

// Get the size of the left dock if it's open and not the current dock
if let Some(left_dock) = &dock_area.left_dock {
Expand Down
Loading