From 8fc2b8377a7ffbcd8206369f5b5d769a439e4db6 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Tue, 8 Jan 2013 09:23:28 -0600 Subject: [PATCH] Made the list selected color have no effect if zero. --- THEMES.md | 2 +- changelog.txt | 3 +++ src/components/GuiList.cpp | 4 ++-- src/components/GuiTheme.cpp | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/THEMES.md b/THEMES.md index 9b1331628..5818b9378 100644 --- a/THEMES.md +++ b/THEMES.md @@ -96,7 +96,7 @@ Display tags define some "meta" display attributes about your theme. Display tag `` - the hex color to use for the "selector bar" on the GuiGameList. Default is `000000FF`. -`` - the hex color to use for selected text on the GuiGameList. Default is the value of ``. +`` - the hex color to use for selected text on the GuiGameList. Default is zero, which means no change. `` - if present, the games list names will be left aligned to the value of `` (default 0.5). diff --git a/changelog.txt b/changelog.txt index af1b68104..1fd3e0b2c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +January 8, 2012 +-Made a value of zero for "list selected color" mean no change. + January 6, 2012 -Added tag support. diff --git a/src/components/GuiList.cpp b/src/components/GuiList.cpp index 532c9497d..b291c9cf2 100644 --- a/src/components/GuiList.cpp +++ b/src/components/GuiList.cpp @@ -18,7 +18,7 @@ GuiList::GuiList(int offsetX, int offsetY, Font* font) mFont = font; mSelectorColor = 0x000000FF; - mSelectedTextColorOverride = 0x0000FFFF; + mSelectedTextColorOverride = 0; mScrollSound = NULL; mDrawCentered = true; @@ -75,7 +75,7 @@ void GuiList::onRender() ListRow row = mRowVector.at((unsigned int)i); if(mDrawCentered) - Renderer::drawCenteredText(row.name, getOffsetX(), y, (mSelection == i) ? mSelectedTextColorOverride : row.color, mFont); + Renderer::drawCenteredText(row.name, getOffsetX(), y, (mSelection == i && mSelectedTextColorOverride != 0) ? mSelectedTextColorOverride : row.color, mFont); else Renderer::drawText(row.name, getOffsetX() + mTextOffsetX, y, (mSelection == i) ? mSelectedTextColorOverride : row.color, mFont); diff --git a/src/components/GuiTheme.cpp b/src/components/GuiTheme.cpp index 09fea9be5..0e9a6b100 100644 --- a/src/components/GuiTheme.cpp +++ b/src/components/GuiTheme.cpp @@ -79,7 +79,7 @@ void GuiTheme::setDefaults() mColorMap["primary"] = 0x0000FFFF; mColorMap["secondary"] = 0x00FF00FF; mColorMap["selector"] = 0x000000FF; - mColorMap["selected"] = 0xFF0000FF; + mColorMap["selected"] = 0x00000000; mColorMap["description"] = 0x0000FFFF; mColorMap["fastSelect"] = 0xFF0000FF; @@ -185,7 +185,7 @@ void GuiTheme::readXML(std::string path) mColorMap["primary"] = resolveColor(root.child("listPrimaryColor").text().get(), mColorMap["primary"]); mColorMap["secondary"] = resolveColor(root.child("listSecondaryColor").text().get(), mColorMap["secondary"]); mColorMap["selector"] = resolveColor(root.child("listSelectorColor").text().get(), mColorMap["selector"]); - mColorMap["selected"] = resolveColor(root.child("listSelectedColor").text().get(), mColorMap["primary"]); + mColorMap["selected"] = resolveColor(root.child("listSelectedColor").text().get(), mColorMap["selected"]); mColorMap["description"] = resolveColor(root.child("descColor").text().get(), mColorMap["description"]); mColorMap["fastSelect"] = resolveColor(root.child("fastSelectColor").text().get(), mColorMap["fastSelect"]);