sculpt: don't constrain '+' menu to avail space

Sculpt used to restrict the size of leitzentrale windows to the screen
area that is not obstructed by the menu and log. This is useful for the
runtime view and the inspect window. However, the menu should be allowed
to use the entire screen because it overlays the other content.

Before this patch, the menu wouldn't be displayed completely on small
resolutions (e.g., 1024x768 when using the VESA driver) because the log
at the bottom of the screen imposed the size constraint on the menu.
With the patch, the menu is able to overlay the log window.
This commit is contained in:
Norman Feske 2019-02-23 20:24:16 +01:00 committed by Christian Helmuth
parent 2163ce25f6
commit b7f5aae64a
1 changed files with 9 additions and 4 deletions

View File

@ -704,12 +704,17 @@ void Sculpt::Main::_handle_window_layout()
};
auto win_size = [&] (Xml_node win) {
return Area(win.attribute_value("width", 0UL),
win.attribute_value("height", 0UL)); };
/* window size limited to space unobstructed by the menu and log */
auto constrained_win_size = [&] (Xml_node win) {
unsigned const inspect_w = inspect_p2.x() - inspect_p1.x(),
inspect_h = inspect_p2.y() - inspect_p1.y();
return Area(min(inspect_w, win.attribute_value("width", 0UL)),
min(inspect_h, win.attribute_value("height", 0UL)));
Area const size = win_size(win);
return Area(min(inspect_w, size.w()), min(inspect_h, size.h()));
};
_with_window(window_list, Label("gui -> menu -> "), [&] (Xml_node win) {
@ -718,7 +723,7 @@ void Sculpt::Main::_handle_window_layout()
/* calculate centered runtime view within the available main (inspect) area */
Rect runtime_view;
_with_window(window_list, runtime_view_label, [&] (Xml_node win) {
Area const size = win_size(win);
Area const size = constrained_win_size(win);
Point const pos = Rect(inspect_p1, inspect_p2).center(size);
runtime_view = Rect(pos, size);
});
@ -747,7 +752,7 @@ void Sculpt::Main::_handle_window_layout()
_with_window(window_list, runtime_view_label, [&] (Xml_node win) {
/* center runtime view within the available main (inspect) area */
Area const size = win_size(win);
Area const size = constrained_win_size(win);
Point const pos = Rect(inspect_p1, inspect_p2).center(size);
gen_window(win, Rect(pos, size));