Skip to content

Commit

Permalink
ui: Use only one option for settings window (#1122)
Browse files Browse the repository at this point in the history
* rebase code

* remove unsused item

* restore "system" displaying on first boot

* restore popup menu functions (separate commit)

* restore snapshot function in popup menu

* get current index value from config file
  • Loading branch information
Fabxx authored Nov 19, 2023
1 parent b3fc80b commit b605381
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
25 changes: 6 additions & 19 deletions ui/xui/main-menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1184,34 +1184,21 @@ MainMenuScene::MainMenuScene()
m_next_view_index = m_current_view_index;
}

void MainMenuScene::ShowGeneral()
void MainMenuScene::ShowSettings()
{
SetNextViewIndexWithFocus(0);
SetNextViewIndexWithFocus(g_config.general.last_viewed_menu_index);
}
void MainMenuScene::ShowInput()
{
SetNextViewIndexWithFocus(1);
}
void MainMenuScene::ShowDisplay()
{
SetNextViewIndexWithFocus(2);
}
void MainMenuScene::ShowAudio()
{
SetNextViewIndexWithFocus(3);
}
void MainMenuScene::ShowNetwork()
{
SetNextViewIndexWithFocus(4);
}
void MainMenuScene::ShowSnapshots()

void MainMenuScene::ShowSnapshots()
{
SetNextViewIndexWithFocus(5);
}

void MainMenuScene::ShowSystem()
{
SetNextViewIndexWithFocus(6);
}

void MainMenuScene::ShowAbout()
{
SetNextViewIndexWithFocus(7);
Expand Down
8 changes: 2 additions & 6 deletions ui/xui/main-menu.hh
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,10 @@ protected:

public:
MainMenuScene();
void ShowGeneral();
void ShowInput();
void ShowDisplay();
void ShowAudio();
void ShowNetwork();
void ShowSnapshots();
void ShowSettings();
void ShowSystem();
void ShowAbout();
void ShowSnapshots();
void SetNextViewIndexWithFocus(int i);
void Show() override;
void Hide() override;
Expand Down
9 changes: 1 addition & 8 deletions ui/xui/menubar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,7 @@ void ShowMainMenu()

ImGui::Separator();

ImGui::MenuItem("Settings", NULL, false, false);
if (ImGui::MenuItem(" General")) g_main_menu.ShowGeneral();
if (ImGui::MenuItem(" Input")) g_main_menu.ShowInput();
if (ImGui::MenuItem(" Display")) g_main_menu.ShowDisplay();
if (ImGui::MenuItem(" Audio")) g_main_menu.ShowAudio();
if (ImGui::MenuItem(" Network")) g_main_menu.ShowNetwork();
if (ImGui::MenuItem(" Snapshots")) g_main_menu.ShowSnapshots();
if (ImGui::MenuItem(" System")) g_main_menu.ShowSystem();
if (ImGui::MenuItem("Settings...")) g_main_menu.ShowSettings();

ImGui::Separator();

Expand Down

0 comments on commit b605381

Please sign in to comment.