diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-09 01:11:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-13 01:02:41 +0300 |
commit | 9a36ae42e55ee9403d631dd7c027967350931fa6 (patch) | |
tree | c4f1c4c59d8b0396e12bcf953377be554c640a59 /src | |
parent | 794a06e7707797bca73218702f275c58f654a8cd (diff) | |
download | mv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.gz mv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.bz2 mv-9a36ae42e55ee9403d631dd7c027967350931fa6.tar.xz mv-9a36ae42e55ee9403d631dd7c027967350931fa6.zip |
Change progressbar theming.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 31 |
1 files changed, 4 insertions, 27 deletions
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; } |