summaryrefslogtreecommitdiffstats
path: root/gui/slidervalue.cpp
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2016-12-31 01:10:37 +0100
committerDees Troy <dees_troy@teamw.in>2017-01-18 17:41:17 +0100
commita8a89d1961998a0dffbafbec3de90774933ca515 (patch)
treeb3fab0d1413ebcdb49e77919f6196bf0c5a6a67c /gui/slidervalue.cpp
parentgui: remove old unmaintained 2.x theme (diff)
downloadandroid_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar.gz
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar.bz2
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar.lz
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar.xz
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.tar.zst
android_bootable_recovery-a8a89d1961998a0dffbafbec3de90774933ca515.zip
Diffstat (limited to '')
-rw-r--r--gui/slidervalue.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/gui/slidervalue.cpp b/gui/slidervalue.cpp
index 088620a21..b53797b25 100644
--- a/gui/slidervalue.cpp
+++ b/gui/slidervalue.cpp
@@ -62,7 +62,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
}
mLabel = new GUIText(node);
- if(mLabel->Render() < 0)
+ if (mLabel->Render() < 0)
{
delete mLabel;
mLabel = NULL;
@@ -156,7 +156,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
mFontHeight = mFont->GetHeight();
- if(mShowCurr)
+ if (mShowCurr)
{
int maxLen = std::max(strlen(mMinStr.c_str()), strlen(mMaxStr.c_str()));
mValueStr = new char[maxLen+1];
@@ -182,10 +182,10 @@ GUISliderValue::~GUISliderValue()
void GUISliderValue::loadValue(bool force)
{
- if(!mVariable.empty())
+ if (!mVariable.empty())
{
int value = DataManager::GetIntValue(mVariable);
- if(mValue == value && !force)
+ if (mValue == value && !force)
return;
mValue = value;
@@ -208,7 +208,7 @@ int GUISliderValue::SetRenderPos(int x, int y, int w, int h)
}
mRenderH = mSliderH;
- if(mShowCurr)
+ if (mShowCurr)
mRenderH += mFontHeight;
if (mLabel)
@@ -230,7 +230,7 @@ int GUISliderValue::SetRenderPos(int x, int y, int w, int h)
mActionW = mRenderW;
mActionH = mRenderH;
- if(mBackgroundImage && mBackgroundImage->GetResource())
+ if (mBackgroundImage && mBackgroundImage->GetResource())
{
mLineW = mBackgroundImage->GetWidth();
mLineH = mBackgroundImage->GetHeight();
@@ -260,7 +260,7 @@ int GUISliderValue::Render(void)
return 0;
}
- if(mLabel)
+ if (mLabel)
{
int w, h;
mLabel->GetCurrentBounds(w, h);
@@ -270,12 +270,12 @@ int GUISliderValue::Render(void)
mLabel->SetRenderPos(textX, mRenderY);
}
int res = mLabel->Render();
- if(res < 0)
+ if (res < 0)
return res;
}
// line
- if(mBackgroundImage && mBackgroundImage->GetResource())
+ if (mBackgroundImage && mBackgroundImage->GetResource())
{
gr_blit(mBackgroundImage->GetResource(), 0, 0, mLineW, mLineH, mLineX, mLineY);
}
@@ -288,10 +288,10 @@ int GUISliderValue::Render(void)
// slider
uint32_t sliderX = mLineX + (mValuePct*(mLineW - mSliderW))/100;
- if(mHandleImage && mHandleImage->GetResource())
+ if (mHandleImage && mHandleImage->GetResource())
{
gr_surface s = mHandleImage->GetResource();
- if(mDragging && mHandleHoverImage && mHandleHoverImage->GetResource())
+ if (mDragging && mHandleHoverImage && mHandleHoverImage->GetResource())
s = mHandleHoverImage->GetResource();
gr_blit(s, 0, 0, mSliderW, mSliderH, sliderX, mLineY + (mLineH/2 - mSliderH/2));
}
@@ -302,16 +302,16 @@ int GUISliderValue::Render(void)
}
void *fontResource = NULL;
- if(mFont) fontResource = mFont->GetResource();
+ if (mFont) fontResource = mFont->GetResource();
gr_color(mTextColor.red, mTextColor.green, mTextColor.blue, mTextColor.alpha);
- if(mShowRange)
+ if (mShowRange)
{
int rangeY = (mLineY - mLineH/2) - mFontHeight/2;
gr_textEx_scaleW(mRenderX + mPadding/2, rangeY, mMinStr.c_str(), fontResource, mRenderW, TOP_LEFT, 0);
gr_textEx_scaleW(mLineX + mLineW + mPadding/2, rangeY, mMaxStr.c_str(), fontResource, mRenderW, TOP_LEFT, 0);
}
- if(mValueStr && mShowCurr)
+ if (mValueStr && mShowCurr)
{
sprintf(mValueStr, "%d", mValue);
int textW = measureText(mValueStr);
@@ -329,7 +329,7 @@ int GUISliderValue::Update(void)
if (!mRendered)
return 2;
- if(mLabel)
+ if (mLabel)
return mLabel->Update();
return 0;
}
@@ -406,7 +406,7 @@ int GUISliderValue::NotifyVarChange(const std::string& varName, const std::strin
mLabel->NotifyVarChange(varName, value);
if (varName == mVariable) {
int newVal = atoi(value.c_str());
- if(newVal != mValue) {
+ if (newVal != mValue) {
mValue = newVal;
mValuePct = pctFromValue(mValue);
mRendered = false;