From c6f1f1c7c7f486fd19c394a7e33df9f0980b55c8 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 10 Jun 2020 10:51:46 +1000 Subject: Backport: Convert enum to enum class. Add noexcept and const. Backport of changeset 8296:d8dc184c713c. --- src/Indicator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Indicator.h') diff --git a/src/Indicator.h b/src/Indicator.h index 24319df99..669d9a2d8 100644 --- a/src/Indicator.h +++ b/src/Indicator.h @@ -26,7 +26,7 @@ struct StyleAndColour { */ class Indicator { public: - enum DrawState { drawNormal, drawHover }; + enum class State { normal, hover }; StyleAndColour sacNormal; StyleAndColour sacHover; bool under; @@ -38,7 +38,7 @@ public: Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) noexcept : sacNormal(style_, fore_), sacHover(style_, fore_), under(under_), fillAlpha(fillAlpha_), outlineAlpha(outlineAlpha_), attributes(0) { } - void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const; + void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, State drawState, int value) const; bool IsDynamic() const noexcept { return !(sacNormal == sacHover); } @@ -48,7 +48,7 @@ public: int Flags() const noexcept { return attributes; } - void SetFlags(int attributes_); + void SetFlags(int attributes_) noexcept; }; } -- cgit v1.2.3