Skip to content

Commit

Permalink
enhancement: GUI redesign, pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Dec 17, 2023
1 parent 3a31ce0 commit a71081a
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 49 deletions.
26 changes: 13 additions & 13 deletions src/osdep/gui/Navigation.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <guisan.hpp>
#include <guisan/sdl.hpp>
#include <guisan/sdl/sdltruetypefont.hpp>
#include "SelectorEntry.hpp"
#include "sysdeps.h"
#include "gui_handling.h"
Expand Down Expand Up @@ -42,12 +41,12 @@ static NavigationMap navMap[] =
{"Priority", "cboInactiveRunAtPrio", "cboActiveRunAtPrio", "Miscellaneous", "Savestates" },
{"Savestates", "State0", "State0", "Priority", "Virtual Keyboard"},
{"Virtual Keyboard", "chkVkEnabled", "chkVkEnabled", "Savestates", "Quit"},
{"Shutdown", "Start", "Quit", "Virtual Keyboard", "Paths"},
{"Quit", "Shutdown", "Restart", "Virtual Keyboard", "Paths"},
{"Restart", "Quit", "Help", "Virtual Keyboard", "Paths"},
{"Help", "Restart", "Reset", "Virtual Keyboard", "Paths"},
{"Reset", "Help", "Start", "Virtual Keyboard", "Paths"},
{"Start", "Reset", "Shutdown", "Virtual Keyboard", "Paths"},
{"Shutdown", "Start", "Quit", "Virtual Keyboard", "About"},
{"Quit", "Shutdown", "Restart", "Virtual Keyboard", "About"},
{"Restart", "Quit", "Help", "Virtual Keyboard", "About"},
{"Help", "Restart", "Reset", "Virtual Keyboard", "About"},
{"Reset", "Help", "Start", "Virtual Keyboard", "About"},
{"Start", "Reset", "Shutdown", "Virtual Keyboard", "About"},

// PanelPaths
{"cmdSystemROMs", "Paths", "Paths", "cmdRescanROMs", "cmdConfigPath"},
Expand Down Expand Up @@ -304,11 +303,12 @@ static NavigationMap navMap[] =
{ "sndEmulate", "Sound", "sldPaulaVol", "sndDisEmu", "chkAutoSwitching" },
{ "chkAutoSwitching", "Sound", "sldPaulaVol", "sndEmulate", "cboChannelMode" },
{ "cboChannelMode", "Sound", "cboSeparation", "chkAutoSwitching", "cboFrequency" },
{ "cboFrequency", "Sound", "cboStereoDelay", "cboChannelMode", "chkFloppySound" },
{ "cboFrequency", "Sound", "cboSwapChannels", "cboChannelMode", "chkFloppySound" },
{ "cboSwapChannels", "cboFrequency", "cboStereoDelay", "cboChannelMode", "chkFloppySound" },
{ "cboInterpol", "cboSeparation", "Sound", "sldMIDIVol", "cboFilter" },
{ "cboFilter", "cboStereoDelay", "Sound", "cboInterpol", "sldSoundBufferSize" },
{ "cboSeparation", "cboChannelMode", "cboInterpol", "chkAutoSwitching", "cboStereoDelay" },
{ "cboStereoDelay", "cboFrequency", "cboFilter", "cboSeparation", "chkFloppySound" },
{ "cboStereoDelay", "cboSwapChannels", "cboFilter", "cboSeparation", "chkFloppySound" },
{ "sldPaulaVol", "", "", "optSoundPush", "sldCDVol" },
{ "sldCDVol", "", "", "sldPaulaVol", "sldAHIVol" },
{ "sldAHIVol", "", "", "sldCDVol", "sldMIDIVol" },
Expand Down Expand Up @@ -535,7 +535,7 @@ static NavigationMap navMap[] =
{ "chkMinimizedDisableControllers", "chkInactiveDisableControllers", "Priority", "chkMinimizedDisableSound", "cboMinimizedRunAtPrio" },

// PanelSavestate
{ "State0", "Savestates", "Savestates", "LoadState", "State1" },
{ "State0", "Savestates", "Savestates", "cmdLoadState", "State1" },
{ "State1", "Savestates", "Savestates", "State0", "State2" },
{ "State2", "Savestates", "Savestates", "State1", "State3" },
{ "State3", "Savestates", "Savestates", "State2", "State4" },
Expand All @@ -549,9 +549,9 @@ static NavigationMap navMap[] =
{ "State11", "Savestates", "Savestates", "State10", "State12" },
{ "State12", "Savestates", "Savestates", "State11", "State13" },
{ "State13", "Savestates", "Savestates", "State12", "State14" },
{ "State14", "Savestates", "Savestates", "State13", "LoadState" },
{ "LoadState", "Savestates", "SaveState", "State14", "State0" },
{ "SaveState", "LoadState", "Savestates", "State14", "State0" },
{ "State14", "Savestates", "Savestates", "State13", "cmdLoadState" },
{ "cmdLoadState", "Savestates", "cmdSaveState", "State14", "State0" },
{ "cmdSaveState", "cmdLoadState", "Savestates", "State14", "State0" },

// Virtual Keyboard
{ "chkVkEnabled", "Virtual Keyboard", "Virtual Keyboard", "chkRetroArchVkbd", "chkVkHires"},
Expand Down
2 changes: 1 addition & 1 deletion src/osdep/gui/PanelHWInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "blkdev.h"
#include "gui_handling.h"

#define MAX_INFOS 10
#define MAX_INFOS 20

enum { COL_TYPE, COL_NAME, COL_START, COL_END, COL_SIZE, COL_ID, COL_COUNT };

Expand Down
39 changes: 39 additions & 0 deletions src/osdep/gui/PanelPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ static gcn::Label* lblRetroArchFile;
static gcn::TextField* txtRetroArchFile;
static gcn::Button* cmdRetroArchFile;

static gcn::Label* lblWHDBootPath;
static gcn::TextField* txtWHDBootPath;
static gcn::Button* cmdWHDBootPath;

static gcn::CheckBox* chkEnableLogging;
static gcn::Label* lblLogfilePath;
static gcn::TextField* txtLogfilePath;
Expand Down Expand Up @@ -120,6 +124,16 @@ class FolderButtonActionListener : public gcn::ActionListener
cmdRetroArchFile->requestFocus();
}

else if (actionEvent.getSource() == cmdWHDBootPath)
{
get_whdbootpath(tmp, MAX_DPATH);
if (SelectFolder("Folder for WHDBoot files", tmp))
{
set_whdbootpath(tmp);
}
cmdWHDBootPath->requestFocus();
}

else if (actionEvent.getSource() == cmdLogfilePath)
{
const char* filter[] = { "amiberry.log", "\0" };
Expand Down Expand Up @@ -351,6 +365,17 @@ void InitPanelPaths(const config_category& category)
cmdRetroArchFile->setBaseColor(gui_baseCol);
cmdRetroArchFile->addActionListener(folderButtonActionListener);

lblWHDBootPath = new gcn::Label("WHDBoot files:");
txtWHDBootPath = new gcn::TextField();
txtWHDBootPath->setSize(textFieldWidth, TEXTFIELD_HEIGHT);
txtWHDBootPath->setBackgroundColor(colTextboxBackground);

cmdWHDBootPath = new gcn::Button("...");
cmdWHDBootPath->setId("cmdWHDBootPath");
cmdWHDBootPath->setSize(SMALL_BUTTON_WIDTH, SMALL_BUTTON_HEIGHT);
cmdWHDBootPath->setBaseColor(gui_baseCol);
cmdWHDBootPath->addActionListener(folderButtonActionListener);

enableLoggingActionListener = new EnableLoggingActionListener();
chkEnableLogging = new gcn::CheckBox("Enable logging", true);
chkEnableLogging->setId("chkEnableLogging");
Expand Down Expand Up @@ -409,6 +434,13 @@ void InitPanelPaths(const config_category& category)
category.panel->add(cmdRetroArchFile, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);
yPos += txtRetroArchFile->getHeight() + DISTANCE_NEXT_Y;

category.panel->add(lblWHDBootPath, DISTANCE_BORDER, yPos);
yPos += lblWHDBootPath->getHeight() + DISTANCE_NEXT_Y / 2;
category.panel->add(txtWHDBootPath, DISTANCE_BORDER, yPos);
category.panel->add(cmdWHDBootPath, DISTANCE_BORDER + textFieldWidth + DISTANCE_NEXT_X, yPos);

yPos += txtWHDBootPath->getHeight() + DISTANCE_NEXT_Y * 5;

category.panel->add(lblLogfilePath, DISTANCE_BORDER, yPos);
category.panel->add(chkEnableLogging, lblLogfilePath->getX() + lblLogfilePath->getWidth() + DISTANCE_NEXT_X * 3, yPos);
yPos += lblLogfilePath->getHeight() + DISTANCE_NEXT_Y / 2;
Expand Down Expand Up @@ -475,6 +507,10 @@ void ExitPanelPaths()
delete txtRetroArchFile;
delete cmdRetroArchFile;

delete lblWHDBootPath;
delete txtWHDBootPath;
delete cmdWHDBootPath;

delete chkEnableLogging;
delete lblLogfilePath;
delete txtLogfilePath;
Expand Down Expand Up @@ -516,6 +552,9 @@ void RefreshPanelPaths()
get_retroarch_file(tmp, MAX_DPATH);
txtRetroArchFile->setText(tmp);

get_whdbootpath(tmp, MAX_DPATH);
txtWHDBootPath->setText(tmp);

chkEnableLogging->setSelected(get_logfile_enabled());
get_logfile_path(tmp, MAX_DPATH);
txtLogfilePath->setText(tmp);
Expand Down
2 changes: 1 addition & 1 deletion src/osdep/gui/PanelPrio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void InitPanelPrio(const config_category& category)
grpWhenActive->add(chkActiveDisableSound, DISTANCE_BORDER, posY);
grpWhenActive->setMovable(false);
grpWhenActive->setTitleBarHeight(TITLEBAR_HEIGHT);
grpWhenActive->setSize(cboActiveRunAtPrio->getWidth() + DISTANCE_BORDER * 2, TITLEBAR_HEIGHT + chkActiveDisableSound->getY() + chkActiveDisableSound->getHeight() + DISTANCE_NEXT_Y * 3);
grpWhenActive->setSize(cboActiveRunAtPrio->getWidth() + DISTANCE_BORDER * 3, TITLEBAR_HEIGHT + chkActiveDisableSound->getY() + chkActiveDisableSound->getHeight() + DISTANCE_NEXT_Y * 3);
grpWhenActive->setBaseColor(gui_baseCol);
category.panel->add(grpWhenActive);

Expand Down
21 changes: 8 additions & 13 deletions src/osdep/gui/PanelRTG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class RTGActionListener : public gcn::ActionListener
auto selected_board = cboBoard->getSelected();
if (selected_board == 0)
{
changed_prefs.rtgboards[0].rtgmem_type = 1;
changed_prefs.rtgboards[0].rtgmem_type = GFXBOARD_UAE_Z3;
changed_prefs.rtgboards[0].rtgmem_size = 0;
}
else
Expand All @@ -112,7 +112,6 @@ class RTGActionListener : public gcn::ActionListener
else if (action_event.getSource() == sldGfxmem)
{
changed_prefs.rtgboards[0].rtgmem_size = memsizes[msi_gfx[static_cast<int>(sldGfxmem->getValue())]];
changed_prefs.rtgboards[0].rtgmem_type = GFXBOARD_UAE_Z3;
}

else if (action_event.getSource() == chkRtgMatchDepth)
Expand Down Expand Up @@ -195,33 +194,29 @@ RTGActionListener* rtg_action_listener;

void InitPanelRTG(const config_category& category)
{
int sld_width;
int marker_length;

sld_width = 110;
marker_length = 20;
int marker_length = 20;

rtg_action_listener = new RTGActionListener();

lblBoard = new gcn::Label("Board:");
lblBoard = new gcn::Label("RTG Graphics Board:");
lblBoard->setAlignment(gcn::Graphics::LEFT);

cboBoard = new gcn::DropDown(&rtg_boards_list);
cboBoard->setSize(250, cboBoard->getHeight());
cboBoard->setSize(300, cboBoard->getHeight());
cboBoard->setBaseColor(gui_baseCol);
cboBoard->setBackgroundColor(colTextboxBackground);
cboBoard->setId("cboBoard");
cboBoard->addActionListener(rtg_action_listener);

lblGfxmem = new gcn::Label("VRAM size:");
lblGfxsize = new gcn::Label("None ");
sldGfxmem = new gcn::Slider(0, 8);
sldGfxmem->setSize(sld_width, SLIDER_HEIGHT);
sldGfxmem->setSize(cboBoard->getWidth() - lblGfxmem->getWidth() - lblGfxsize->getWidth(), SLIDER_HEIGHT);
sldGfxmem->setBaseColor(gui_baseCol);
sldGfxmem->setMarkerLength(marker_length);
sldGfxmem->setStepLength(1);
sldGfxmem->setId("Gfxmem");
sldGfxmem->addActionListener(rtg_action_listener);
lblGfxsize = new gcn::Label("None ");

chkRtgMatchDepth = new gcn::CheckBox("Match host and RTG color depth if possible");
chkRtgMatchDepth->setId("chkRtgMatchDepth");
Expand Down Expand Up @@ -301,7 +296,7 @@ void InitPanelRTG(const config_category& category)
auto posY = DISTANCE_BORDER;

category.panel->add(lblBoard, DISTANCE_BORDER, posY);
category.panel->add(lblRtgColorModes, lblBoard->getX() + lblBoard->getWidth() + DISTANCE_NEXT_X * 20, posY);
category.panel->add(lblRtgColorModes, lblBoard->getX() + lblBoard->getWidth() + DISTANCE_NEXT_X * 18, posY);
posY += lblBoard->getHeight() + DISTANCE_NEXT_Y;

category.panel->add(cboBoard, DISTANCE_BORDER, posY);
Expand All @@ -310,7 +305,7 @@ void InitPanelRTG(const config_category& category)

category.panel->add(lblGfxmem, DISTANCE_BORDER, posY);
category.panel->add(sldGfxmem, lblGfxmem->getWidth() + DISTANCE_NEXT_X + 8, posY);
category.panel->add(lblGfxsize, lblGfxmem->getWidth() + DISTANCE_NEXT_X + sldGfxmem->getWidth() + 12, posY);
category.panel->add(lblGfxsize, sldGfxmem->getX() + sldGfxmem->getWidth() + 8, posY);
category.panel->add(cboRtg32bitModes, cboRtg16bitModes->getX(), posY);
posY += sldGfxmem->getHeight() + DISTANCE_NEXT_Y * 2;

Expand Down
14 changes: 7 additions & 7 deletions src/osdep/gui/PanelSavestate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void InitPanelSavestate(const config_category& category)

lblTimestamp = new gcn::Label("Thu Aug 23 14:55:02 2001");

grpNumber = new gcn::Window("Number");
grpNumber = new gcn::Window("Slot");
grpNumber->add(optState0, 10, 10);
grpNumber->add(optState1, optState0->getX(), optState0->getY() + optState0->getHeight() + DISTANCE_NEXT_Y);
grpNumber->add(optState2, optState0->getX(), optState1->getY() + optState1->getHeight() + DISTANCE_NEXT_Y);
Expand All @@ -232,32 +232,32 @@ void InitPanelSavestate(const config_category& category)
grpNumber->add(optState13, optState0->getX(), optState12->getY() + optState12->getHeight() + DISTANCE_NEXT_Y);
grpNumber->add(optState14, optState0->getX(), optState13->getY() + optState13->getHeight() + DISTANCE_NEXT_Y);
grpNumber->setMovable(false);
grpNumber->setSize(BUTTON_WIDTH, optState14->getY() + TITLEBAR_HEIGHT * 2 + DISTANCE_NEXT_Y);
grpNumber->setSize(BUTTON_WIDTH - 20, TITLEBAR_HEIGHT + optState14->getY() + optState14->getHeight() + DISTANCE_NEXT_Y);
grpNumber->setTitleBarHeight(TITLEBAR_HEIGHT);
grpNumber->setBaseColor(gui_baseCol);

grpScreenshot = new gcn::Window("State screen");
grpScreenshot = new gcn::Window("State screenshot");
grpScreenshot->setMovable(false);
grpScreenshot->setSize(464, 410);
grpScreenshot->setSize(category.panel->getWidth() - grpNumber->getWidth() - DISTANCE_BORDER * 2 - DISTANCE_NEXT_X, grpNumber->getHeight());
grpScreenshot->setTitleBarHeight(TITLEBAR_HEIGHT);
grpScreenshot->setBaseColor(gui_baseCol);

cmdLoadState = new gcn::Button("Load State");
cmdLoadState->setSize(BUTTON_WIDTH + 10, BUTTON_HEIGHT);
cmdLoadState->setBaseColor(gui_baseCol);
cmdLoadState->setId("LoadState");
cmdLoadState->setId("cmdLoadState");
cmdLoadState->addActionListener(savestateActionListener);

cmdSaveState = new gcn::Button("Save State");
cmdSaveState->setSize(BUTTON_WIDTH + 10, BUTTON_HEIGHT);
cmdSaveState->setBaseColor(gui_baseCol);
cmdSaveState->setId("SaveState");
cmdSaveState->setId("cmdSaveState");
cmdSaveState->addActionListener(savestateActionListener);

category.panel->add(grpNumber, DISTANCE_BORDER, DISTANCE_BORDER);
category.panel->add(grpScreenshot, grpNumber->getX() + grpNumber->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
category.panel->add(lblTimestamp, grpScreenshot->getX(), grpScreenshot->getY() + grpScreenshot->getHeight() + DISTANCE_NEXT_Y);
const auto posY = category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT;
const auto posY = lblTimestamp->getY() + lblTimestamp->getHeight() + DISTANCE_NEXT_Y;
category.panel->add(cmdLoadState, grpScreenshot->getX(), posY);
category.panel->add(cmdSaveState, cmdLoadState->getX() + cmdLoadState->getWidth() + DISTANCE_NEXT_X, posY);

Expand Down
Loading

0 comments on commit a71081a

Please sign in to comment.