Skip to content

Commit

Permalink
fixed vertical alignment and updated test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Jan 11, 2025
1 parent fcd8925 commit 1a57030
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6426,7 +6426,6 @@ dependencies = [
"anyhow",
"criterion",
"egui",
"egui_kittest",
"itertools 0.13.0",
"nohash-hasher",
"once_cell",
Expand Down
3 changes: 2 additions & 1 deletion crates/viewer/re_time_panel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ serde.workspace = true
vec1.workspace = true

[dev-dependencies]
re_viewer_context = { workspace = true, features = ["testing"] }

anyhow.workspace = true
criterion.workspace = true
egui_kittest.workspace = true
rand.workspace = true

[lib]
Expand Down
6 changes: 5 additions & 1 deletion crates/viewer/re_time_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,13 @@ impl TimePanel {
let timeline_rect = {
let top = ui.min_rect().bottom();

ui.add_space(-4.0); // hack to vertically center the text

let size = egui::vec2(self.prev_col_width, 28.0);
ui.allocate_ui_with_layout(size, egui::Layout::top_down(egui::Align::LEFT), |ui| {
ui.set_min_size(size);
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
ui.add_space(4.0); // hack to vertically center the text
ui.spacing_mut().item_spacing.y = 0.0;

ui.full_span_scope(0.0..=time_x_left, |ui| {
self.filter_state.ui(
Expand All @@ -461,6 +463,8 @@ impl TimePanel {
.strong(),
);
});

ui.add_space(2.0); // hack to vertically center the text
})
.response
.on_hover_text(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a57030

Please sign in to comment.