Use the common tabdialog class for GestureMappingScreen

This commit is contained in:
Henrik Rydgård committed 2025-10-29 08:39:59 +01:00
1 parent 1f35cf8538
commit 243c784666
2 files changed
+12 -12

No files matched your search

+6 -10
View File
@@ -2035,22 +2035,18 @@ void HostnameSelectScreen::OnCompleted(DialogResult result) {
*value_ = StripSpaces(addrView_->GetText());
}
void GestureMappingScreen::CreateViews() {
void GestureMappingScreen::CreateTabs() {
auto co = GetI18NCategory(I18NCat::CONTROLS);
AddTab("Gesture", co->T("Gesture"), [this](UI::LinearLayout *parent) { CreateGestureTab(parent); });
}
void GestureMappingScreen::CreateGestureTab(UI::LinearLayout *vert) {
using namespace UI;
auto di = GetI18NCategory(I18NCat::DIALOG);
auto co = GetI18NCategory(I18NCat::CONTROLS);
auto mc = GetI18NCategory(I18NCat::MAPPABLECONTROLS);
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
AddStandardBack(root_);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, TabHolderFlags::Default, nullptr, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
ScrollView *rightPanel = new ScrollView(ORIENT_VERTICAL);
tabHolder->AddTab(co->T("Gesture"), rightPanel);
LinearLayout *vert = rightPanel->Add(new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT)));
vert->SetSpacing(0);
static const char *gestureButton[ARRAY_SIZE(GestureKey::keyList)+1];
gestureButton[0] = "None";
for (int i = 1; i < ARRAY_SIZE(gestureButton); ++i) {
+6 -2
View File
@@ -184,12 +184,16 @@ private:
};
class GestureMappingScreen : public UIBaseDialogScreen {
class GestureMappingScreen : public UITabbedBaseDialogScreen {
public:
GestureMappingScreen(const Path &gamePath) : UIBaseDialogScreen(gamePath) {}
GestureMappingScreen(const Path &gamePath) : UITabbedBaseDialogScreen(gamePath) {}
void CreateViews() override;
void CreateTabs() override;
const char *tag() const override { return "GestureMapping"; }
bool ShowSearchControls() const override { return false; }
protected:
void CreateGestureTab(UI::LinearLayout *parent);
};
class RestoreSettingsScreen : public PopupScreen {