From ac4db4a2230c16a02232c7e03a5a8d69636cde54 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sun, 17 May 2020 10:56:38 +0200 Subject: [PATCH] Increased textfield size in Misc panel, code modernization --- src/osdep/gui/PanelMisc.cpp | 8 ++++---- src/osdep/gui/PanelSavestate.cpp | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/osdep/gui/PanelMisc.cpp b/src/osdep/gui/PanelMisc.cpp index e8ba6d84..9bd35239 100644 --- a/src/osdep/gui/PanelMisc.cpp +++ b/src/osdep/gui/PanelMisc.cpp @@ -217,7 +217,7 @@ void InitPanelMisc(const struct _ConfigCategory& category) lblOpenGUI->setAlignment(gcn::Graphics::RIGHT); txtOpenGUI = new gcn::TextField(); txtOpenGUI->setEnabled(false); - txtOpenGUI->setSize(85, TEXTFIELD_HEIGHT); + txtOpenGUI->setSize(105, TEXTFIELD_HEIGHT); txtOpenGUI->setBackgroundColor(colTextboxBackground); cmdOpenGUI = new gcn::Button("..."); cmdOpenGUI->setId("OpenGUI"); @@ -229,7 +229,7 @@ void InitPanelMisc(const struct _ConfigCategory& category) lblKeyForQuit->setAlignment(gcn::Graphics::RIGHT); txtKeyForQuit = new gcn::TextField(); txtKeyForQuit->setEnabled(false); - txtKeyForQuit->setSize(85, TEXTFIELD_HEIGHT); + txtKeyForQuit->setSize(105, TEXTFIELD_HEIGHT); txtKeyForQuit->setBackgroundColor(colTextboxBackground); cmdKeyForQuit = new gcn::Button("..."); cmdKeyForQuit->setId("KeyForQuit"); @@ -241,7 +241,7 @@ void InitPanelMisc(const struct _ConfigCategory& category) lblKeyActionReplay->setAlignment(gcn::Graphics::RIGHT); txtKeyActionReplay = new gcn::TextField(); txtKeyActionReplay->setEnabled(false); - txtKeyActionReplay->setSize(85, TEXTFIELD_HEIGHT); + txtKeyActionReplay->setSize(105, TEXTFIELD_HEIGHT); txtKeyActionReplay->setBackgroundColor(colTextboxBackground); cmdKeyActionReplay = new gcn::Button("..."); cmdKeyActionReplay->setId("KeyActionReplay"); @@ -253,7 +253,7 @@ void InitPanelMisc(const struct _ConfigCategory& category) lblKeyFullScreen->setAlignment(gcn::Graphics::RIGHT); txtKeyFullScreen = new gcn::TextField(); txtKeyFullScreen->setEnabled(false); - txtKeyFullScreen->setSize(85, TEXTFIELD_HEIGHT); + txtKeyFullScreen->setSize(105, TEXTFIELD_HEIGHT); txtKeyFullScreen->setBackgroundColor(colTextboxBackground); cmdKeyFullScreen = new gcn::Button("..."); cmdKeyFullScreen->setId("KeyFullScreen"); diff --git a/src/osdep/gui/PanelSavestate.cpp b/src/osdep/gui/PanelSavestate.cpp index 282026f5..a92c9801 100644 --- a/src/osdep/gui/PanelSavestate.cpp +++ b/src/osdep/gui/PanelSavestate.cpp @@ -144,12 +144,12 @@ void InitPanelSavestate(const struct _ConfigCategory& category) cmdSaveState->setId("SaveState"); 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(wndScreenshot, grpNumber->getX() + grpNumber->getWidth() + DISTANCE_NEXT_X * 2, 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(cmdSaveState, DISTANCE_BORDER + BUTTON_WIDTH + DISTANCE_NEXT_X, posY); category.panel->add(lblWarningHDDon, DISTANCE_BORDER + 100, DISTANCE_BORDER + 50); @@ -215,20 +215,20 @@ void RefreshPanelSavestate() gui_update(); if (strlen(screenshot_filename) > 0) { - const auto f = fopen(screenshot_filename, "rbe"); + auto* const f = fopen(screenshot_filename, "rbe"); if (f) { fclose(f); const auto rect = wndScreenshot->getChildrenArea(); - auto loadedImage = IMG_Load(screenshot_filename); + auto* loadedImage = IMG_Load(screenshot_filename); if (loadedImage != nullptr) { SDL_Rect source = {0, 0, 0, 0}; SDL_Rect target = {0, 0, 0, 0}; - SDL_Surface* scaled = SDL_CreateRGBSurface(loadedImage->flags, rect.width, rect.height, - loadedImage->format->BitsPerPixel, - loadedImage->format->Rmask, loadedImage->format->Gmask, - loadedImage->format->Bmask, loadedImage->format->Amask); + auto* scaled = SDL_CreateRGBSurface(loadedImage->flags, rect.width, rect.height, + loadedImage->format->BitsPerPixel, + loadedImage->format->Rmask, loadedImage->format->Gmask, + loadedImage->format->Bmask, loadedImage->format->Amask); source.w = loadedImage->w; source.h = loadedImage->h; target.w = rect.width;