From 0ff755b236c43e01da25ec2ff1e1e696c48e02bb Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 15 Sep 2022 16:27:05 +0200 Subject: [PATCH] menu_view: remove minor code redundancy This is a follow-up commit for "menu_view: configurable alpha channel and bg color", which simplifies the code. The '_no_alpha' surface is not needed because the 'Gui_buffer' provides a 0x0 alpha surface when using the opaque mode. --- repos/gems/src/app/menu_view/main.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/repos/gems/src/app/menu_view/main.cc b/repos/gems/src/app/menu_view/main.cc index afc4804d4e..ae04f2f673 100644 --- a/repos/gems/src/app/menu_view/main.cc +++ b/repos/gems/src/app/menu_view/main.cc @@ -41,11 +41,6 @@ struct Menu_view::Main Constructible _buffer { }; - /** - * Alpha surface used when operating in opaque mode - */ - Surface _no_alpha { nullptr, Area(0,0) }; - Gui::Session::View_handle _view_handle = _gui.create_view(); /** @@ -422,7 +417,7 @@ void Menu_view::Main::_handle_frame_timer() // don't perform a full dialog update _buffer->apply_to_surface([&] (Surface &pixel, Surface &alpha) { - _root_widget.draw(pixel, _opaque ? _no_alpha : alpha, Point(0, 0)); + _root_widget.draw(pixel, alpha, Point(0, 0)); }); _buffer->flush_surface();