Skip to content

button: Add chevron and hamburger symbol#933

Open
RobLoach wants to merge 2 commits intoImmediate-Mode-UI:masterfrom
RobLoach:more-symbols
Open

button: Add chevron and hamburger symbol#933
RobLoach wants to merge 2 commits intoImmediate-Mode-UI:masterfrom
RobLoach:more-symbols

Conversation

@RobLoach
Copy link
Copy Markdown
Contributor

@RobLoach RobLoach commented Mar 26, 2026

This adds chevron and hamburger symbols that can be used.

Screenshot from 2026-03-26 12-58-12

Copy link
Copy Markdown
Contributor

@rswinkle rswinkle left a comment

Choose a reason for hiding this comment

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

I only ran compiled and ran it in a few backends but I don't think we really need more. The code looks pretty simple. Nice with the Hamburger, now we can have a menu button like that without having to resort to a separate image or Awesome Font.

Copy link
Copy Markdown
Contributor

@rswinkle rswinkle left a comment

Choose a reason for hiding this comment

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

Take two, actually checking the "Viewed" check boxes this time.

@RobLoach
Copy link
Copy Markdown
Contributor Author

Four questions....

  1. Should we switch the X from using the font to draw an actual X?
  2. Sleep also brought up a good point that the line thickness is hard-coded. Think we should change that?
  3. Any other symbols you could think of?
  4. Any places you think these should be used?

@rswinkle
Copy link
Copy Markdown
Contributor

Four questions....

  1. Should we switch the X from using the font to draw an actual X?

Hmm, either that or at least change to using a capital 'X'?

  1. Sleep also brought up a good point that the line thickness is hard-coded. Think we should change that?

If he's commented in this PR I can't see it.

But if you're talking about something like this:

nk_draw_symbol(out, type, *content, bg, sym, 1, font);
to
nk_draw_symbol(out, type, *content, bg, sym, style->border, font);
or
nk_draw_symbol(out, type, *content, bg, sym, (style->border > 0.0f) ? style->border : 1.0f, font);

Or maybe just putting that ternary statement at the top of draw_symbol then we can decide about the individual calls to draw_symbol whenever (there's only about 5 of them).

I think that's fine.

  1. Any other symbols you could think of?

Not anything as useful and easy to make as the hamburger. The only maybe I see here is the staggered hamburger. Probably not worth it.

  1. Any places you think these should be used?

Besides what you added to Overview? I mean maybe some people would like them better for tree/tabs (why are they called trees but the style struct in nk_style_tab?) instead of our current filled triangles?

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.

2 participants