summaryrefslogtreecommitdiff
path: root/src/gui/theme.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-12 20:35:30 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-12 20:35:30 +0300
commit1031587ed2e4623d622bcc602c262290e14ea4c5 (patch)
tree2d1aaf848192694dac57d46b10fbec5b9df6e69e /src/gui/theme.cpp
parentf7abd3b849d218af2a57e14490a8054d01be0e6f (diff)
downloadManaVerse-1031587ed2e4623d622bcc602c262290e14ea4c5.tar.gz
ManaVerse-1031587ed2e4623d622bcc602c262290e14ea4c5.tar.bz2
ManaVerse-1031587ed2e4623d622bcc602c262290e14ea4c5.tar.xz
ManaVerse-1031587ed2e4623d622bcc602c262290e14ea4c5.zip
Add for windows close button hover image.
New theme parameter "closeImageHighlighted". It have attributes same as "closeImage".
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r--src/gui/theme.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 99dac7887..fe1591de2 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -69,12 +69,19 @@ Skin::Skin(const ImageRect &skin, const ImageRect &images,
mName(name),
mBorder(skin),
mCloseImage(images.grid[0]),
- mStickyImageUp(images.grid[1]),
- mStickyImageDown(images.grid[2]),
+ mCloseImageHighlighted(images.grid[1]),
+ mStickyImageUp(images.grid[2]),
+ mStickyImageDown(images.grid[3]),
mPadding(padding),
mTitlePadding(titlePadding),
mOptions(options)
{
+ if (!mCloseImageHighlighted)
+ {
+ mCloseImageHighlighted = mCloseImage;
+ if (mCloseImageHighlighted)
+ mCloseImageHighlighted->incRef();
+ }
}
Skin::~Skin()
@@ -95,6 +102,12 @@ Skin::~Skin()
mCloseImage = nullptr;
}
+ if (mCloseImageHighlighted)
+ {
+ mCloseImageHighlighted->decRef();
+ mCloseImageHighlighted = nullptr;
+ }
+
if (mStickyImageUp)
{
mStickyImageUp->decRef();
@@ -125,6 +138,8 @@ void Skin::updateAlpha(float minimumOpacityAllowed)
if (mCloseImage)
mCloseImage->setAlpha(alpha);
+ if (mCloseImageHighlighted)
+ mCloseImageHighlighted->setAlpha(alpha);
if (mStickyImageUp)
mStickyImageUp->setAlpha(alpha);
if (mStickyImageDown)
@@ -370,8 +385,9 @@ static const SkinParameter skinParam[] =
static const SkinParameter imageParam[] =
{
{0, "closeImage"},
- {1, "stickyImageUp"},
- {2, "stickyImageDown"},
+ {1, "closeImageHighlighted"},
+ {2, "stickyImageUp"},
+ {3, "stickyImageDown"},
};
struct SkinHelper