Skip to content

Commit 9741629

Browse files
committed
cargo: update egui to 0.29.1
Signed-off-by: Florian Lehner <[email protected]>
1 parent a5928e2 commit 9741629

File tree

8 files changed

+410
-408
lines changed

8 files changed

+410
-408
lines changed

Cargo.lock

Lines changed: 340 additions & 378 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ anyhow = "1.0.71"
3838
smallvec = "1.11.1"
3939
arc-swap = "1.6.0"
4040
base64 = "0.22.0"
41-
egui = "0.26.1"
42-
egui_plot = "0.26.1"
43-
egui_extras = { version = "0.26.1", features = ["image"] }
44-
egui_commonmark = "0.12.0"
45-
egui-phosphor = "0.4.0"
41+
egui = "0.29.1"
42+
egui_plot = "0.29.0"
43+
egui_extras = { version = "0.29.1", features = ["image"] }
44+
egui_commonmark = "0.18.0"
45+
egui-phosphor = "0.7.3"
4646
fallible-iterator = "0.3.0"
4747
chrono = "0.4.31"
4848
indexmap = "2.1.0"
@@ -74,7 +74,7 @@ default-features = false
7474
features = ["zstd", "jemalloc"]
7575

7676
[dependencies.eframe]
77-
version = "0.26.1"
77+
version = "0.29.1"
7878
default-features = false
7979
features = ["default_fonts", "x11"]
8080

src/ui/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ impl DevfilerUi {
150150
static ADD_DATA_MD: &str = include_str!("./add-data.md");
151151

152152
egui::ScrollArea::vertical().show(ui, |ui| {
153-
CommonMarkViewer::new("add-data-viewer").show(ui, &mut self.md_cache, ADD_DATA_MD);
153+
CommonMarkViewer::new().show(ui, &mut self.md_cache, ADD_DATA_MD);
154154
});
155155
}
156156

157157
fn samples_widget(&mut self, ui: &mut Ui) -> (UtcTimestamp, UtcTimestamp) {
158158
let plot = Plot::new("trace_counts")
159159
.custom_x_axes(vec![timeaxis::mk_time_axis(Axis::X)])
160160
.custom_y_axes(vec![AxisHints::new_y().label("Samples")])
161-
.y_axis_width(2)
161+
.y_axis_min_width(2.0)
162162
.x_grid_spacer(timeaxis::mk_time_grid)
163163
.allow_drag([true, false])
164164
.height(100.0)

src/ui/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn gui_thread(collector: crate::collector::Collector) -> Result<(), eframe::
5555
egui_extras::install_image_loaders(&cc.egui_ctx);
5656
load_phosphor_icons(&cc.egui_ctx);
5757
tokio::spawn(background_ui_waker(cc.egui_ctx.clone()));
58-
Box::new(app::DevfilerUi::new(collector))
58+
Ok(Box::new(app::DevfilerUi::new(collector)))
5959
}),
6060
)
6161
}

src/ui/tabs/executables.rs

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,48 @@ impl ExecutablesTab {
108108

109109
ui.separator();
110110
let bar_size = Vec2::new(ui.available_width(), 20.0);
111-
let bar_rect = Rect::from_min_size(ui.next_widget_position(), bar_size);
112-
ui.allocate_ui_at_rect(bar_rect, |ui| {
113-
ui.columns(3, |ui| {
114-
ui[0].with_layout(Layout::left_to_right(Align::Center), |ui| {
115-
ui.label(format!("{} executables", self.last_exe_count));
116-
});
117-
ui[1].with_layout(Layout::centered_and_justified(Direction::TopDown), |ui| {
118-
ui.label(ingest_status);
119-
});
120-
ui[2].with_layout(Layout::right_to_left(Align::Center), |ui| {
121-
let hint = format!("{} Filter ...", icons::FUNNEL);
122-
clearable_line_edit(ui, &hint, &mut self.filter);
123-
});
111+
112+
// Allocate space for the entire bar
113+
let (_rect, _) = ui.allocate_space(bar_size);
114+
115+
// Create the horizontal layout directly inside the main UI
116+
ui.horizontal(|ui| {
117+
// Set the width of each column
118+
let available_width = ui.available_width();
119+
let col_width = available_width / 3.0;
120+
121+
// First column - left aligned
122+
ui.with_layout(Layout::left_to_right(Align::Center), |ui| {
123+
ui.allocate_ui_with_layout(
124+
Vec2::new(col_width, bar_size.y),
125+
Layout::left_to_right(Align::Center),
126+
|ui| {
127+
ui.label(format!("{} executables", self.last_exe_count));
128+
},
129+
);
130+
});
131+
132+
// Second column - centered
133+
ui.with_layout(Layout::centered_and_justified(Direction::TopDown), |ui| {
134+
ui.allocate_ui_with_layout(
135+
Vec2::new(col_width, bar_size.y),
136+
Layout::centered_and_justified(Direction::TopDown),
137+
|ui| {
138+
ui.label(ingest_status);
139+
},
140+
);
141+
});
142+
143+
// Third column - right aligned
144+
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
145+
ui.allocate_ui_with_layout(
146+
Vec2::new(col_width, bar_size.y),
147+
Layout::right_to_left(Align::Center),
148+
|ui| {
149+
let hint = format!("{} Filter ...", icons::FUNNEL);
150+
clearable_line_edit(ui, &hint, &mut self.filter);
151+
},
152+
);
124153
});
125154
});
126155

@@ -169,9 +198,15 @@ impl ExecutablesTab {
169198
painter.rect_stroke(rect, Rounding::ZERO, Stroke::new(1.0, Color32::BLACK));
170199

171200
if matches!(response.hover_pos(), Some(p) if rect.contains(p)) {
172-
show_tooltip_at_pointer(ui.ctx(), Id::new("executable-bar-tooltip"), |ui| {
173-
ui.label(format!("{}: {:.0}", name, humanize_count(value)));
174-
});
201+
let tooltip_id = Id::new("executable-bar-tooltip");
202+
show_tooltip_at_pointer(
203+
ui.ctx(),
204+
egui::LayerId::new(egui::Order::Tooltip, tooltip_id),
205+
tooltip_id,
206+
|ui: &mut Ui| {
207+
ui.label(format!("{}: {:.0}", name, humanize_count(value)));
208+
},
209+
);
175210
}
176211

177212
offset += width;

src/ui/tabs/flamegraph.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ impl FlameGraphWidget {
243243
if let Some(hover_pos) = cursor_hover_pos {
244244
if screen_rect.contains(hover_pos) {
245245
let id = Id::new("flamegraph-tooltip");
246-
show_tooltip_at_pointer(ctx, id, |ui| self.draw_tooltip(ui, cfg, root, flame));
246+
show_tooltip_at_pointer(
247+
ctx,
248+
egui::LayerId::new(egui::Order::Tooltip, id),
249+
id,
250+
|ui: &mut Ui| self.draw_tooltip(ui, cfg, root, flame),
251+
);
247252

248253
if clicked && flame.weight >= 1 {
249254
self.x_zoom = root.weight as f32 / flame.weight as f32;
@@ -315,7 +320,7 @@ impl FlameGraphWidget {
315320
});
316321
ui.horizontal(|ui| {
317322
ui.strong("Location:");
318-
ui.add(Label::new(&flame.text).wrap(true));
323+
ui.add(Label::new(&flame.text).wrap());
319324
});
320325
});
321326
}

src/ui/tabs/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl TabWidget for MetricsTab {
8181
Plot::new("metrics")
8282
.custom_x_axes(vec![timeaxis::mk_time_axis(Axis::X)])
8383
.custom_y_axes(vec![AxisHints::new_y().label("Value")])
84-
.y_axis_width(5)
84+
.y_axis_min_width(5.0)
8585
.x_grid_spacer(timeaxis::mk_time_grid)
8686
.legend(Legend::default())
8787
.label_formatter(|name, val| {

src/ui/timeaxis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pub fn mk_time_grid(input: GridInput) -> Vec<GridMark> {
6767
marks
6868
}
6969

70-
pub fn mk_time_axis(axis: Axis) -> AxisHints {
71-
AxisHints::new(axis).formatter(|x, _, _| {
70+
pub fn mk_time_axis(axis: Axis) -> AxisHints<'static> {
71+
AxisHints::new(axis).formatter(|x, _| {
7272
let t = ts2chrono(x.value as i64);
7373

7474
let has_seconds = t.second() != 0;

0 commit comments

Comments
 (0)