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

Conversation

emilk
Copy link
Member

@emilk emilk commented Jan 27, 2023

Small tweaks

Before:
Screen Shot 2023-01-27 at 22 25 40

After:
Screen Shot 2023-01-27 at 22 40 49

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I've added a line to CHANGELOG.md (if this is a big enough change to warrant it)

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

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

a bit scary how much more values aren't from the design tokens
overall I like it but personally I think the selection highlight (like in the picture on the object path in the selection panel) is a bit too tight (is that egui::Frame::outer_margin? can't map all code changes to their respective visual changes tbh)

@emilk
Copy link
Member Author

emilk commented Jan 28, 2023

Yeah, we likely need to tweak this again. The button_padding is an egui thing that was made for buttons with frames. It basically adds an inner margin around buttons before adding the background frame. Without frames it just adds weird space around the text in buttons, making them not align with other text.

So making button_padding smaller makes buttons act more like any other text when not interacted, which is why things in the selection panel now line up better.

However, making button_padding smaller also makes the highlighted frame smaller, which can look weird. I might have to tweak this in egui, to allow for a growing frame on hover.

@emilk emilk merged commit cc227f8 into main Jan 28, 2023
@emilk emilk deleted the emilk/tweak-button-sizes branch January 28, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants