File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ struct config {
3535 float icon_padding = 4 ;
3636 float right_icon_padding = 20 ;
3737 float multibutton_line_gap = -6 ;
38+ float scrollbar_width = 6 ;
39+ float scrollbar_radius = 3 ;
3840
3941 std::string acrylic_color_light = " #fefefe00" ;
4042 std::string acrylic_color_dark = " #28282800" ;
Original file line number Diff line number Diff line change @@ -350,6 +350,21 @@ void mb_shell::menu_widget::render(ui::nanovg_context ctx) {
350350 bg_submenu->render (ctx2);
351351 }
352352 render_children (ctx2, rendering_submenus);
353+
354+ // scrollbar
355+ if (height->dest () < actual_height) {
356+ auto scrollbar_width = config::current->context_menu .theme .scrollbar_width ;
357+ auto scrollbar_height = height->dest () * height->dest () / actual_height;
358+ auto scrollbar_x = width->dest () - scrollbar_width - 2 + *x;
359+ auto scrollbar_y = *y - *scroll_top / (actual_height - height->dest ()) *
360+ (height->dest () - scrollbar_height);
361+
362+ float c = menu_render::current.value ()->light_color ? 0 : 1 ;
363+ ctx.fillColor (nvgRGBAf (c, c, c, 0.1 ));
364+ ctx.fillRoundedRect (scrollbar_x, scrollbar_y, scrollbar_width,
365+ scrollbar_height,
366+ config::current->context_menu .theme .scrollbar_radius );
367+ }
353368}
354369void mb_shell::menu_item_normal_widget::reset_appear_animation (float delay) {
355370 this ->opacity ->after_animate = [this ](float dest) {
You can’t perform that action at this time.
0 commit comments