JANITORIAL: Formatting fixes

This commit is contained in:
av-dx 2021-07-08 16:03:17 +05:30 committed by Eugene Sandulenko
parent 6b5c5ae0d6
commit 1f18febade
5 changed files with 15 additions and 20 deletions

View file

@ -186,7 +186,7 @@ LauncherDialog::~LauncherDialog() {
void LauncherDialog::clean() { void LauncherDialog::clean() {
while (_firstWidget) { while (_firstWidget) {
Widget* w = _firstWidget; Widget *w = _firstWidget;
removeWidget(w); removeWidget(w);
// This is called from rebuild() which may result from handleCommand being called by // This is called from rebuild() which may result from handleCommand being called by
// a child widget sendCommand call. In such a case sendCommand is still being executed // a child widget sendCommand call. In such a case sendCommand is still being executed
@ -287,7 +287,7 @@ void LauncherDialog::reflowLayout() {
close(); close();
return; return;
} }
#ifndef DISABLE_FANCY_THEMES #ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) { if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
StaticTextWidget *ver = (StaticTextWidget *)findWidget(String(_title + ".Version").c_str()); StaticTextWidget *ver = (StaticTextWidget *)findWidget(String(_title + ".Version").c_str());
if (ver) { if (ver) {

View file

@ -38,7 +38,7 @@ namespace GUI {
#ifndef DISABLE_LAUNCHERDISPLAY_GRID #ifndef DISABLE_LAUNCHERDISPLAY_GRID
enum LauncherDisplayType { enum LauncherDisplayType {
kLauncherDisplayList = 1, kLauncherDisplayList = 1,
kLauncherDisplayGrid = 2, kLauncherDisplayGrid = 2
}; };
enum { enum {
@ -175,9 +175,9 @@ public:
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override; void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
void handleKeyDown(Common::KeyState state) override; void handleKeyDown(Common::KeyState state) override;
#ifndef DISABLE_LAUNCHERDISPLAY_GRID #ifndef DISABLE_LAUNCHERDISPLAY_GRID
LauncherDisplayType getType() const override { return kLauncherDisplayList; } LauncherDisplayType getType() const override { return kLauncherDisplayList; }
#endif // !DISABLE_LAUNCHERDISPLAY_GRID #endif // !DISABLE_LAUNCHERDISPLAY_GRID
protected: protected:
void updateListing() override; void updateListing() override;

View file

@ -58,8 +58,7 @@ void LauncherChooser::selectLauncher() {
delete _impl; delete _impl;
_impl = nullptr; _impl = nullptr;
switch (requestedType) switch (requestedType) {
{
case kLauncherDisplayGrid: case kLauncherDisplayGrid:
_impl = new LauncherGrid(Common::U32String("LauncherGrid")); _impl = new LauncherGrid(Common::U32String("LauncherGrid"));
break; break;

View file

@ -101,8 +101,8 @@ void GridItemWidget::drawWidget() {
_activeEntry->title.substr(breakPoint), GUI::ThemeEngine::kStateEnabled ,Graphics::kTextAlignCenter, _activeEntry->title.substr(breakPoint), GUI::ThemeEngine::kStateEnabled ,Graphics::kTextAlignCenter,
ThemeEngine::kTextInversionNone, 0, true, ThemeEngine::kFontStyleNormal, ThemeEngine::kTextInversionNone, 0, true, ThemeEngine::kFontStyleNormal,
ThemeEngine::kFontColorAlternate, false); ThemeEngine::kFontColorAlternate, false);
} } else
else g_gui.theme()->drawSurface(Common::Point(_x, _y), _thumbGfx, true); g_gui.theme()->drawSurface(Common::Point(_x, _y), _thumbGfx, true);
// Draw Platform Icon // Draw Platform Icon
if (_activeEntry->platform != kPlatformUnknown) { if (_activeEntry->platform != kPlatformUnknown) {
@ -195,8 +195,7 @@ GridItemTray::GridItemTray(GuiObject *boss, int x, int y, int w, int h, int entr
} }
void GridItemTray::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { void GridItemTray::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) switch (cmd) {
{
case kPlayButtonCmd: case kPlayButtonCmd:
close(); close();
sendCommand(kPlayButtonCmd, _entryID); sendCommand(kPlayButtonCmd, _entryID);
@ -365,7 +364,7 @@ GridWidget::~GridWidget() {
} }
const Graphics::ManagedSurface *GridWidget::filenameToSurface(const String &name) { const Graphics::ManagedSurface *GridWidget::filenameToSurface(const String &name) {
String path = String("./icons/")+name; String path = String("./icons/") + name;
for (auto l = _visibleEntries.begin(); l!=_visibleEntries.end(); ++l) { for (auto l = _visibleEntries.begin(); l!=_visibleEntries.end(); ++l) {
if (l->thumbPath == name) { if (l->thumbPath == name) {
@ -435,7 +434,7 @@ void GridWidget::reloadThumbnails() {
String path; String path;
for (Common::Array<GridItemInfo>::iterator iter = _visibleEntries.begin(); iter != _visibleEntries.end(); ++iter) { for (Common::Array<GridItemInfo>::iterator iter = _visibleEntries.begin(); iter != _visibleEntries.end(); ++iter) {
path = String("./icons/")+iter->thumbPath; path = String("./icons/") + iter->thumbPath;
if (_loadedSurfaces.contains(path)) { if (_loadedSurfaces.contains(path)) {
// warning("Thumbnail already loaded, skipping..."); // warning("Thumbnail already loaded, skipping...");
} else { } else {
@ -445,8 +444,7 @@ void GridWidget::reloadThumbnails() {
_loadedSurfaces[path] = scSurf; _loadedSurfaces[path] = scSurf;
surf->free(); surf->free();
delete surf; delete surf;
} } else {
else {
_loadedSurfaces[path] = nullptr; _loadedSurfaces[path] = nullptr;
} }
} }
@ -463,8 +461,7 @@ void GridWidget::loadFlagIcons() {
_loadedSurfaces[path] = scGfx; _loadedSurfaces[path] = scGfx;
gfx->free(); gfx->free();
delete gfx; delete gfx;
} } else {
else {
_loadedSurfaces[path] = nullptr; _loadedSurfaces[path] = nullptr;
} }
} }

View file

@ -55,12 +55,11 @@ enum {
kLoadButtonCmd = 'LOAD', kLoadButtonCmd = 'LOAD',
kOpenTrayCmd = 'OPTR', kOpenTrayCmd = 'OPTR',
kItemClicked = 'LBX1', kItemClicked = 'LBX1',
kItemDoubleClickedCmd = 'LBX2', kItemDoubleClickedCmd = 'LBX2'
}; };
/* GridItemInfo */ /* GridItemInfo */
struct GridItemInfo struct GridItemInfo {
{
typedef Common::String String; typedef Common::String String;
String engineid; String engineid;