summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-09 01:11:29 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-13 01:02:41 +0300
commit9a36ae42e55ee9403d631dd7c027967350931fa6 (patch)
treec4f1c4c59d8b0396e12bcf953377be554c640a59
parent794a06e7707797bca73218702f275c58f654a8cd (diff)
downloadmv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.gz
mv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.bz2
mv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.xz
mv-9a36ae42e55ee9403d631dd7c027967350931fa6.zip
Change progressbar theming.
-rw-r--r--data/graphics/gui/CMakeLists.txt1
-rw-r--r--data/graphics/gui/Makefile.am1
-rw-r--r--data/graphics/gui/progressbar.xml18
-rw-r--r--data/graphics/gui/window.pngbin11875 -> 11901 bytes
-rw-r--r--src/gui/widgets/progressbar.cpp31
5 files changed, 24 insertions, 27 deletions
diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt
index 3c3f7f162..83a1ff902 100644
--- a/data/graphics/gui/CMakeLists.txt
+++ b/data/graphics/gui/CMakeLists.txt
@@ -18,6 +18,7 @@ SET (FILES
mouse.png
playerbox_background.xml
progress-indicator.png
+ progressbar.xml
radioin.png
radioin_highlight.png
radioout.png
diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am
index 775f7829e..42d58b3e4 100644
--- a/data/graphics/gui/Makefile.am
+++ b/data/graphics/gui/Makefile.am
@@ -21,6 +21,7 @@ gui_DATA = \
mouse.png \
playerbox_background.xml \
progress-indicator.png \
+ progressbar.xml \
radioin.png \
radioin_highlight.png \
radioout.png \
diff --git a/data/graphics/gui/progressbar.xml b/data/graphics/gui/progressbar.xml
new file mode 100644
index 000000000..b425025bb
--- /dev/null
+++ b/data/graphics/gui/progressbar.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="73" ypos="164">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="4" height="4" />
+ <part type="top-edge" xpos="4" ypos="0" width="3" height="4" />
+ <part type="top-right-corner" xpos="7" ypos="0" width="4" height="4" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="4" height="10" />
+ <part type="bg-quad" xpos="4" ypos="4" width="3" height="10" />
+ <part type="right-edge" xpos="7" ypos="4" width="4" height="10" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="15" width="4" height="4" />
+ <part type="bottom-edge" xpos="4" ypos="15" width="3" height="4" />
+ <part type="bottom-right-corner" xpos="7" ypos="15" width="4" height="4" />
+ </widget>
+</skinset>
diff --git a/data/graphics/gui/window.png b/data/graphics/gui/window.png
index f0da0dce7..1bdee4931 100644
--- a/data/graphics/gui/window.png
+++ b/data/graphics/gui/window.png
Binary files differ
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 1052f924e..d4492a2b6 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -71,32 +71,11 @@ ProgressBar::ProgressBar(float progress,
if (mInstances == 0)
{
- Image *dBorders = Theme::getImageFromTheme("progress.png");
- if (!dBorders)
- dBorders = Theme::getImageFromTheme("vscroll_grey.png");
- if (dBorders)
- {
- mBorder.grid[0] = dBorders->getSubImage(0, 0, 4, 4);
- mBorder.grid[1] = dBorders->getSubImage(4, 0, 3, 4);
- mBorder.grid[2] = dBorders->getSubImage(7, 0, 4, 4);
- mBorder.grid[3] = dBorders->getSubImage(0, 4, 4, 10);
- mBorder.grid[4] = dBorders->getSubImage(4, 4, 3, 10);
- mBorder.grid[5] = dBorders->getSubImage(7, 4, 4, 10);
- mBorder.grid[6] = dBorders->getSubImage(0, 15, 4, 4);
- mBorder.grid[7] = dBorders->getSubImage(4, 15, 3, 4);
- mBorder.grid[8] = dBorders->getSubImage(7, 15, 4, 4);
-
- for (int i = 0; i < 9; i++)
- mBorder.grid[i]->setAlpha(mAlpha);
-
- dBorders->decRef();
- }
- else
- {
- for (int f = 0; f < 9; f ++)
- mBorder.grid[f] = nullptr;
- }
+ for (int f = 0; f < 9; f ++)
+ mBorder.grid[f] = nullptr;
+ if (Theme::instance())
+ Theme::instance()->loadRect(mBorder, "progressbar.xml");
}
mInstances++;
@@ -106,8 +85,6 @@ ProgressBar::~ProgressBar()
{
mInstances--;
- if (mInstances == 0)
- for_each(mBorder.grid, mBorder.grid + 9, dtor<Image*>());
delete mVertexes;
mVertexes = nullptr;
}