Switch ControlMappingScreen to a two-pane layout

This commit is contained in:
Henrik Rydgård
2025-11-25 19:07:52 +01:00
parent 1d23a58a4e
commit 2c75946e6c
4 changed files with 55 additions and 44 deletions
+10 -2
View File
@@ -36,9 +36,17 @@ void UITwoPaneBaseDialogScreen::CreateViews() {
BeforeCreateViews();
auto createContentViews = [this](UI::ViewGroup *parent) {
auto createContentViews = [this, portrait](UI::ViewGroup *parent) {
if (flags_ & TwoPaneFlags::ContentsCanScroll) {
ScrollView *contentScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, Margins(8)));
Margins margins(8, 8, 8, 0);
if (flags_ & TwoPaneFlags::SettingsToTheRight) {
// If settings are in context menu, we want to avoid double margins on the sides.
margins.left = 0;
} else {
margins.right = 0;
}
ScrollView *contentScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT, 1.0f, margins));
parent->Add(contentScroll);
CreateContentViews(contentScroll);
} else {