From 9a36ae42e55ee9403d631dd7c027967350931fa6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Jul 2012 01:11:29 +0300 Subject: Change progressbar theming. --- src/gui/widgets/progressbar.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'src/gui/widgets') 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()); delete mVertexes; mVertexes = nullptr; } -- cgit v1.2.3-70-g09d2