From ecc9c4863cc89366950518bb51a6264a0369c49d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 8 Jun 2016 19:14:37 +0200 Subject: Update all use of progress_*.png to new TexturedBox. --- plugingui/progressbar.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'plugingui/progressbar.h') diff --git a/plugingui/progressbar.h b/plugingui/progressbar.h index 7485e40..9c651ef 100644 --- a/plugingui/progressbar.h +++ b/plugingui/progressbar.h @@ -30,8 +30,10 @@ #include "guievent.h" #include "painter.h" +#include "texturedbox.h" -namespace GUI { +namespace GUI +{ enum class ProgressBarState { @@ -41,7 +43,9 @@ enum class ProgressBarState Off }; -class ProgressBar : public Widget { +class ProgressBar + : public Widget +{ public: ProgressBar(Widget* parent); ~ProgressBar(); @@ -58,11 +62,25 @@ protected: private: ProgressBarState state{ProgressBarState::Blue}; - Painter::Bar bar_bg; + TexturedBox bar_bg{getImageCache(), ":progress.png", + 0, 0, // atlas offset (x, y) + 6, 1, 6, // dx1, dx2, dx3 + 11, 0, 0}; // dy1, dy2, dy3 + + TexturedBox bar_red{getImageCache(), ":progress.png", + 13, 0, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 11, 0, 0}; // dy1, dy2, dy3 + + TexturedBox bar_green{getImageCache(), ":progress.png", + 18, 0, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 11, 0, 0}; // dy1, dy2, dy3 - Painter::Bar bar_green; - Painter::Bar bar_blue; - Painter::Bar bar_red; + TexturedBox bar_blue{getImageCache(), ":progress.png", + 23, 0, // atlas offset (x, y) + 2, 1, 2, // dx1, dx2, dx3 + 11, 0, 0}; // dy1, dy2, dy3 std::size_t total{0}; std::size_t value{0}; -- cgit v1.2.3