ppsspp/UI/TabbedDialogScreen.h
Henrik Rydgård 88b4991753
UI fixes: Rework savedata manager a bit, default keyboard focus to Cancel in confirmation dialogs (#19771)
* Savedata manager screen: Use TabbedUIDialogScreenWithGameBackground

This fixes some minor UI issues on this screen.

* PromptScreen (used for "Are you sure?"): Default keyboard focus to Cancel

Fixes #19770
2024-12-28 10:36:05 +01:00

40 lines
1.3 KiB
C++

#pragma once
#include "ppsspp_config.h"
#include "Common/UI/UIScreen.h"
#include "Common/System/System.h"
#include "Core/ConfigValues.h"
#include "UI/MiscScreens.h"
class TabbedUIDialogScreenWithGameBackground : public UIDialogScreenWithGameBackground {
public:
TabbedUIDialogScreenWithGameBackground(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {}
UI::LinearLayout *AddTab(const char *tag, std::string_view title, bool isSearch = false);
void CreateViews() override;
protected:
// Load data and define your tabs here.
virtual void PreCreateViews() {}
virtual void CreateTabs() = 0;
virtual void CreateExtraButtons(UI::LinearLayout *verticalLayout, int margins) {}
virtual bool ShowSearchControls() const { return true; }
void RecreateViews() override;
void sendMessage(UIMessage message, const char *value) override;
SettingInfoMessage *settingInfo_ = nullptr;
private:
void ApplySearchFilter();
UI::TabHolder *tabHolder_ = nullptr;
std::vector<UI::LinearLayout *> settingTabContents_;
std::vector<UI::TextView *> settingTabFilterNotices_;
UI::Choice *clearSearchChoice_ = nullptr;
UI::TextView *noSearchResults_ = nullptr;
// If we recreate the views while this is active we show it again
std::string oldSettingInfo_;
std::string searchFilter_;
};