Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make buttons smaller, and everything a bit tighter #970

Merged
merged 2 commits into from
Jan 28, 2023
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
18 changes: 9 additions & 9 deletions Cargo.lock

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

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ arrow2_convert = { git = "https://github.com/rerun-io/arrow2-convert", rev = "7e
# arrow2 = { path = "../arrow2" }
# arrow2_convert = { path = "../arrow2-convert/arrow2_convert" }

# 2023-01-27 - add ability to disable the vertical line in indented blocks (e.g. our blurprint panel tree)
ecolor = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
eframe = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
egui = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
emath = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
epaint = { git = "https://github.com/emilk/egui", rev = "fe7ff6626652d2da6c1fa63b7b75131cd9d664ab" }
# 2023-01-27 - dragvalue/sliders use proportional font
ecolor = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
eframe = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
egui = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
egui_extras = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
egui-wgpu = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
emath = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
epaint = { git = "https://github.com/emilk/egui", rev = "e7c0547e23aa6139c51ecdd4bb1dc346bbcac22c" }
# ecolor = { path = "../../egui/crates/ecolor" }
# eframe = { path = "../../egui/crates/eframe" }
# egui = { path = "../../egui/crates/egui" }
Expand Down
3 changes: 2 additions & 1 deletion crates/re_ui/src/design_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ fn apply_design_tokens(ctx: &egui::Context) -> DesignTokens {
// Add stripes to grids and tables?
egui_style.visuals.striped = false;
egui_style.visuals.indent_has_left_vline = false;
egui_style.spacing.indent = 14.0;
egui_style.spacing.button_padding = egui::Vec2::new(1.0, 1.0); // Makes the icons in the blueprint panel align
egui_style.spacing.indent = 14.0; // From figma

egui_style.debug.show_blocking_widget = false; // turn this on to debug interaction problems

Expand Down
4 changes: 2 additions & 2 deletions crates/re_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ impl ReUi {
pub fn hovering_frame(&self) -> egui::Frame {
let style = self.egui_ctx.style();
egui::Frame {
inner_margin: egui::style::Margin::same(2.0),
outer_margin: egui::style::Margin::same(4.0),
inner_margin: egui::style::Margin::symmetric(4.0, 2.0),
outer_margin: egui::style::Margin::same(2.0),
rounding: Self::small_rounding().into(),
fill: style.visuals.window_fill(),
stroke: style.visuals.window_stroke(),
Expand Down
11 changes: 8 additions & 3 deletions crates/re_viewer/src/ui/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,14 @@ fn hovering_panel(
rect: egui::Rect,
add_contents: impl FnOnce(&mut egui::Ui),
) {
let mut ui = ui.child_ui(rect, egui::Layout::top_down(egui::Align::LEFT));
ui.horizontal(|ui| {
frame.show(ui, add_contents);
let height = 28.0; // TODO(emilk): remove this hard-coded monstrosity
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be easier once we have icons for for options and help

let mut max_rect = rect;
max_rect.max.y = max_rect.min.y + height;

ui.allocate_ui_at_rect(max_rect, |ui| {
ui.with_layout(egui::Layout::left_to_right(egui::Align::Center), |ui| {
frame.show(ui, add_contents);
});
});
}

Expand Down