Skip to content

Commit

Permalink
fix(shell): menu item layout
Browse files Browse the repository at this point in the history
close #43
  • Loading branch information
std-microblock committed Feb 4, 2025
1 parent 14cc6b5 commit ab4cdcb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/shell/contextmenu/menu_widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include <ranges>
#include <vector>

/*
| padding | icon_padding | icon | icon_padding | text_padding | text |
text_padding | right_icon_padding | right_icon | right_icon_padding |
*/
void mb_shell::menu_item_normal_widget::render(ui::nanovg_context ctx) {
super::render(ctx);
auto icon_width = config::current->context_menu.theme.font_size + 2;
Expand Down Expand Up @@ -210,9 +214,7 @@ float mb_shell::menu_item_normal_widget::measure_width(

// left icon
if (has_icon_padding || icon_img)
width += icon_padding * 2;
if (icon_img)
width += font_size + 2;
width += icon_padding * 2 + font_size + 2;

// text
ctx.vg.fontSize(font_size);
Expand Down

0 comments on commit ab4cdcb

Please sign in to comment.