Increased textfield size in Misc panel, code modernization
This commit is contained in:
parent
91ebf45a0f
commit
ac4db4a223
2 changed files with 12 additions and 12 deletions
|
@ -217,7 +217,7 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
||||||
lblOpenGUI->setAlignment(gcn::Graphics::RIGHT);
|
lblOpenGUI->setAlignment(gcn::Graphics::RIGHT);
|
||||||
txtOpenGUI = new gcn::TextField();
|
txtOpenGUI = new gcn::TextField();
|
||||||
txtOpenGUI->setEnabled(false);
|
txtOpenGUI->setEnabled(false);
|
||||||
txtOpenGUI->setSize(85, TEXTFIELD_HEIGHT);
|
txtOpenGUI->setSize(105, TEXTFIELD_HEIGHT);
|
||||||
txtOpenGUI->setBackgroundColor(colTextboxBackground);
|
txtOpenGUI->setBackgroundColor(colTextboxBackground);
|
||||||
cmdOpenGUI = new gcn::Button("...");
|
cmdOpenGUI = new gcn::Button("...");
|
||||||
cmdOpenGUI->setId("OpenGUI");
|
cmdOpenGUI->setId("OpenGUI");
|
||||||
|
@ -229,7 +229,7 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
||||||
lblKeyForQuit->setAlignment(gcn::Graphics::RIGHT);
|
lblKeyForQuit->setAlignment(gcn::Graphics::RIGHT);
|
||||||
txtKeyForQuit = new gcn::TextField();
|
txtKeyForQuit = new gcn::TextField();
|
||||||
txtKeyForQuit->setEnabled(false);
|
txtKeyForQuit->setEnabled(false);
|
||||||
txtKeyForQuit->setSize(85, TEXTFIELD_HEIGHT);
|
txtKeyForQuit->setSize(105, TEXTFIELD_HEIGHT);
|
||||||
txtKeyForQuit->setBackgroundColor(colTextboxBackground);
|
txtKeyForQuit->setBackgroundColor(colTextboxBackground);
|
||||||
cmdKeyForQuit = new gcn::Button("...");
|
cmdKeyForQuit = new gcn::Button("...");
|
||||||
cmdKeyForQuit->setId("KeyForQuit");
|
cmdKeyForQuit->setId("KeyForQuit");
|
||||||
|
@ -241,7 +241,7 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
||||||
lblKeyActionReplay->setAlignment(gcn::Graphics::RIGHT);
|
lblKeyActionReplay->setAlignment(gcn::Graphics::RIGHT);
|
||||||
txtKeyActionReplay = new gcn::TextField();
|
txtKeyActionReplay = new gcn::TextField();
|
||||||
txtKeyActionReplay->setEnabled(false);
|
txtKeyActionReplay->setEnabled(false);
|
||||||
txtKeyActionReplay->setSize(85, TEXTFIELD_HEIGHT);
|
txtKeyActionReplay->setSize(105, TEXTFIELD_HEIGHT);
|
||||||
txtKeyActionReplay->setBackgroundColor(colTextboxBackground);
|
txtKeyActionReplay->setBackgroundColor(colTextboxBackground);
|
||||||
cmdKeyActionReplay = new gcn::Button("...");
|
cmdKeyActionReplay = new gcn::Button("...");
|
||||||
cmdKeyActionReplay->setId("KeyActionReplay");
|
cmdKeyActionReplay->setId("KeyActionReplay");
|
||||||
|
@ -253,7 +253,7 @@ void InitPanelMisc(const struct _ConfigCategory& category)
|
||||||
lblKeyFullScreen->setAlignment(gcn::Graphics::RIGHT);
|
lblKeyFullScreen->setAlignment(gcn::Graphics::RIGHT);
|
||||||
txtKeyFullScreen = new gcn::TextField();
|
txtKeyFullScreen = new gcn::TextField();
|
||||||
txtKeyFullScreen->setEnabled(false);
|
txtKeyFullScreen->setEnabled(false);
|
||||||
txtKeyFullScreen->setSize(85, TEXTFIELD_HEIGHT);
|
txtKeyFullScreen->setSize(105, TEXTFIELD_HEIGHT);
|
||||||
txtKeyFullScreen->setBackgroundColor(colTextboxBackground);
|
txtKeyFullScreen->setBackgroundColor(colTextboxBackground);
|
||||||
cmdKeyFullScreen = new gcn::Button("...");
|
cmdKeyFullScreen = new gcn::Button("...");
|
||||||
cmdKeyFullScreen->setId("KeyFullScreen");
|
cmdKeyFullScreen->setId("KeyFullScreen");
|
||||||
|
|
|
@ -144,12 +144,12 @@ void InitPanelSavestate(const struct _ConfigCategory& category)
|
||||||
cmdSaveState->setId("SaveState");
|
cmdSaveState->setId("SaveState");
|
||||||
cmdSaveState->addActionListener(savestateActionListener);
|
cmdSaveState->addActionListener(savestateActionListener);
|
||||||
|
|
||||||
lblWarningHDDon = new gcn::Label("State saves do not support harddrive emulation.");
|
lblWarningHDDon = new gcn::Label("State saves do not support hard drive emulation.");
|
||||||
|
|
||||||
category.panel->add(grpNumber, DISTANCE_BORDER, DISTANCE_BORDER);
|
category.panel->add(grpNumber, DISTANCE_BORDER, DISTANCE_BORDER);
|
||||||
category.panel->add(wndScreenshot, grpNumber->getX() + grpNumber->getWidth() + DISTANCE_NEXT_X * 2,
|
category.panel->add(wndScreenshot, grpNumber->getX() + grpNumber->getWidth() + DISTANCE_NEXT_X * 2,
|
||||||
DISTANCE_BORDER);
|
DISTANCE_BORDER);
|
||||||
const int posY = category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT;
|
const auto posY = category.panel->getHeight() - DISTANCE_BORDER - BUTTON_HEIGHT;
|
||||||
category.panel->add(cmdLoadState, DISTANCE_BORDER, posY);
|
category.panel->add(cmdLoadState, DISTANCE_BORDER, posY);
|
||||||
category.panel->add(cmdSaveState, DISTANCE_BORDER + BUTTON_WIDTH + DISTANCE_NEXT_X, posY);
|
category.panel->add(cmdSaveState, DISTANCE_BORDER + BUTTON_WIDTH + DISTANCE_NEXT_X, posY);
|
||||||
category.panel->add(lblWarningHDDon, DISTANCE_BORDER + 100, DISTANCE_BORDER + 50);
|
category.panel->add(lblWarningHDDon, DISTANCE_BORDER + 100, DISTANCE_BORDER + 50);
|
||||||
|
@ -215,20 +215,20 @@ void RefreshPanelSavestate()
|
||||||
gui_update();
|
gui_update();
|
||||||
if (strlen(screenshot_filename) > 0)
|
if (strlen(screenshot_filename) > 0)
|
||||||
{
|
{
|
||||||
const auto f = fopen(screenshot_filename, "rbe");
|
auto* const f = fopen(screenshot_filename, "rbe");
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
fclose(f);
|
fclose(f);
|
||||||
const auto rect = wndScreenshot->getChildrenArea();
|
const auto rect = wndScreenshot->getChildrenArea();
|
||||||
auto loadedImage = IMG_Load(screenshot_filename);
|
auto* loadedImage = IMG_Load(screenshot_filename);
|
||||||
if (loadedImage != nullptr)
|
if (loadedImage != nullptr)
|
||||||
{
|
{
|
||||||
SDL_Rect source = {0, 0, 0, 0};
|
SDL_Rect source = {0, 0, 0, 0};
|
||||||
SDL_Rect target = {0, 0, 0, 0};
|
SDL_Rect target = {0, 0, 0, 0};
|
||||||
SDL_Surface* scaled = SDL_CreateRGBSurface(loadedImage->flags, rect.width, rect.height,
|
auto* scaled = SDL_CreateRGBSurface(loadedImage->flags, rect.width, rect.height,
|
||||||
loadedImage->format->BitsPerPixel,
|
loadedImage->format->BitsPerPixel,
|
||||||
loadedImage->format->Rmask, loadedImage->format->Gmask,
|
loadedImage->format->Rmask, loadedImage->format->Gmask,
|
||||||
loadedImage->format->Bmask, loadedImage->format->Amask);
|
loadedImage->format->Bmask, loadedImage->format->Amask);
|
||||||
source.w = loadedImage->w;
|
source.w = loadedImage->w;
|
||||||
source.h = loadedImage->h;
|
source.h = loadedImage->h;
|
||||||
target.w = rect.width;
|
target.w = rect.width;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue