Skip to content

Commit 4cc711e

Browse files
authored
Merge pull request #71 from squix78/add-disable-indicators
Make it possible to enable/disable all indicators
2 parents ba372fe + ab50138 commit 4cc711e

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

OLEDDisplayUi.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ void OLEDDisplayUi::disableIndicator(){
7676
this->state.isIndicatorDrawen = false;
7777
}
7878

79+
void OLEDDisplayUi::enableAllIndicators(){
80+
this->shouldDrawIndicators = true;
81+
}
82+
83+
void OLEDDisplayUi::disableAllIndicators(){
84+
this->shouldDrawIndicators = false;
85+
}
86+
7987
void OLEDDisplayUi::setIndicatorPosition(IndicatorPosition pos) {
8088
this->indicatorPosition = pos;
8189
}
@@ -220,7 +228,9 @@ void OLEDDisplayUi::tick() {
220228

221229
this->display->clear();
222230
this->drawFrame();
223-
this->drawIndicator();
231+
if (shouldDrawIndicators) {
232+
this->drawIndicator();
233+
}
224234
this->drawOverlays();
225235
this->display->display();
226236
}

OLEDDisplayUi.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct OLEDDisplayUiState {
8181
bool isIndicatorDrawen = true;
8282

8383
// Normal = 1, Inverse = -1;
84-
int8_t frameTransitionDirection = 1;
84+
int8_t frameTransitionDirection = 1;
8585

8686
bool manuelControll = false;
8787

@@ -109,6 +109,8 @@ class OLEDDisplayUi {
109109
const char* activeSymbol = ANIMATION_activeSymbol;
110110
const char* inactiveSymbol = ANIMATION_inactiveSymbol;
111111

112+
bool shouldDrawIndicators = true;
113+
112114
// Values for the Frames
113115
AnimationDirection frameAnimationDirection = SLIDE_RIGHT;
114116

@@ -215,6 +217,16 @@ class OLEDDisplayUi {
215217
*/
216218
void disableIndicator();
217219

220+
/**
221+
* Enable drawing of indicators
222+
*/
223+
void enableAllIndicators();
224+
225+
/**
226+
* Disable draw of indicators.
227+
*/
228+
void disableAllIndicators();
229+
218230
/**
219231
* Set the position of the indicator bar.
220232
*/

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ void enableIndicator();
273273
*/
274274
void disableIndicator();
275275
276+
/**
277+
* Enable drawing of indicators
278+
*/
279+
void enableAllIndicator();
280+
281+
/**
282+
* Disable drawing of indicators.
283+
*/
284+
void disableAllIndicator();
285+
276286
/**
277287
* Set the position of the indicator bar.
278288
*/

0 commit comments

Comments
 (0)