summaryrefslogtreecommitdiff
path: root/plugingui/progressbar.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-11-09 21:47:15 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-11-09 21:47:15 +0100
commitca384e485956059d5d427fbe07a7b2277c43680e (patch)
tree4ddb9fae1602760c8c444f5f1e800ab908604f07 /plugingui/progressbar.h
parentc18090169d6bb49e877956701e77e8af338ed675 (diff)
Refactor ProgressBar.
Diffstat (limited to 'plugingui/progressbar.h')
-rw-r--r--plugingui/progressbar.h49
1 files changed, 24 insertions, 25 deletions
diff --git a/plugingui/progressbar.h b/plugingui/progressbar.h
index 9d08a9e..e5e567d 100644
--- a/plugingui/progressbar.h
+++ b/plugingui/progressbar.h
@@ -24,48 +24,47 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_PROGRESSBAR_H__
-#define __DRUMGIZMO_PROGRESSBAR_H__
+#pragma once
#include "widget.h"
-#include <string>
-
#include "guievent.h"
#include "painter.h"
namespace GUI {
+enum class ProgressBarState
+{
+ Red,
+ Green,
+ Blue,
+ Off
+};
+
class ProgressBar : public Widget {
public:
- ProgressBar(Widget *parent);
+ ProgressBar(Widget *parent);
+ ~ProgressBar();
- float progress();
- void setProgress(float progress);
+ float progress();
+ void setProgress(float progress);
- typedef enum {
- red,
- green,
- blue,
- off
- } state_t;
- void setState(state_t state);
+ void setState(ProgressBarState state);
- //protected:
- virtual void repaintEvent(RepaintEvent *e);
+protected:
+ // From Widget:
+ virtual void repaintEvent(RepaintEvent *e) override;
private:
- state_t state;
+ ProgressBarState state;
- Painter::Bar bar_bg;
+ Painter::Bar bar_bg;
- Painter::Bar bar_green;
- Painter::Bar bar_blue;
- Painter::Bar bar_red;
-
- float _progress;
-};
+ Painter::Bar bar_green;
+ Painter::Bar bar_blue;
+ Painter::Bar bar_red;
+ float _progress;
};
-#endif/*__DRUMGIZMO_PROGRESSBAR_H__*/
+} // GUI::