Add a way to put the "ExtraButtons" in a popup menu, use on control mapping screen

This commit is contained in:
Henrik Rydgård committed 2025-11-15 20:44:14 +01:00
1 parent 09d195c9ef
commit 8b52cf67af
16 files changed
+71 -19

No files matched your search

+13 -3
View File
@@ -58,16 +58,26 @@ void UITabbedBaseDialogScreen::CreateViews() {
if (flags_ & TabDialogFlags::HorizontalOnlyIcons) {
tabHolderFlags |= TabHolderFlags::HorizontalOnlyIcons;
}
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, tabHolderFlags, filterNotice_, new LinearLayoutParams(1.0f));
std::function<void()> contextMenu;
if (flags_ & TabDialogFlags::ContextMenuInPortrait) {
contextMenu = [this]() {
this->screenManager()->push(new PopupCallbackScreen([this](UI::ViewGroup *parent) {
CreateExtraButtons(parent, 0);
}, nullptr));
};
}
tabHolder_ = new TabHolder(ORIENT_HORIZONTAL, 200, tabHolderFlags, filterNotice_, contextMenu, new LinearLayoutParams(1.0f));
verticalLayout->Add(tabHolder_);
CreateExtraButtons(verticalLayout, 0);
if (!(flags_ & TabDialogFlags::ContextMenuInPortrait)) {
CreateExtraButtons(verticalLayout, 0);
}
root_->Add(verticalLayout);
} else {
TabHolderFlags tabHolderFlags = TabHolderFlags::Default;
if (flags_ & TabDialogFlags::VerticalShowIcons) {
tabHolderFlags |= TabHolderFlags::VerticalShowIcons;
}
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 300, tabHolderFlags, filterNotice_, new AnchorLayoutParams(10, 0, 10, 0));
tabHolder_ = new TabHolder(ORIENT_VERTICAL, 300, tabHolderFlags, filterNotice_, nullptr, new AnchorLayoutParams(10, 0, 10, 0));
CreateExtraButtons(tabHolder_->Container(), 10);
tabHolder_->AddBack(this);
root_->Add(tabHolder_);