CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
SliderView.cpp File Reference
#include "cdc_views/SliderView.h"
#include "cdc_views/KeyCodes.h"
#include "cdc_views/RenderHelpers.h"
#include "cdc_ui/ViewStack.h"
#include "cdc_ui/I18n.h"
#include "cdc_hal/IDisplay.h"
#include "cdc_hal/IKeypad.h"
#include "cdc_log.h"
#include <goodisplay/gdey029T94.h>
#include <cstdio>
#include <algorithm>

Go to the source code of this file.

Namespaces

namespace  cdc
namespace  cdc::ui
 Centralized key-code constants for cdc_views.

Functions

SliderViewcdc::ui::showSlider (const char *title, uint16_t minVal, uint16_t maxVal, uint16_t initial, uint16_t step, const char *unit, SliderView::SaveCallback onSave, SliderView::ChangeCallback onChange)
 Shows a shared slider view instance.

Variables

static constexpr uint32_t REPEAT_INITIAL_MS = 350
static constexpr uint32_t REPEAT_PERIOD_MS = 80
static const char * TAG = "SliderView"
static constexpr int TITLE_Y = 20
 Display layout constants.
static constexpr int VALUE_Y = 55
static constexpr int BAR_Y = 85
static constexpr int BAR_HEIGHT = 20
static constexpr int BAR_MARGIN = 20
static SliderView cdc::ui::s_sharedSlider
 Convenience factory/helper function.

Variable Documentation

◆ BAR_HEIGHT

int BAR_HEIGHT = 20
staticconstexpr

Definition at line 30 of file SliderView.cpp.

Referenced by cdc::ui::SliderView::render().

◆ BAR_MARGIN

int BAR_MARGIN = 20
staticconstexpr

Definition at line 31 of file SliderView.cpp.

Referenced by cdc::ui::SliderView::render().

◆ BAR_Y

int BAR_Y = 85
staticconstexpr

Definition at line 29 of file SliderView.cpp.

Referenced by cdc::ui::SliderView::render().

◆ REPEAT_INITIAL_MS

uint32_t REPEAT_INITIAL_MS = 350
staticconstexpr

SliderView Implementation

Value adjustment with visual progress bar.

Definition at line 19 of file SliderView.cpp.

◆ REPEAT_PERIOD_MS

uint32_t REPEAT_PERIOD_MS = 80
staticconstexpr

Definition at line 20 of file SliderView.cpp.

◆ TAG

const char* TAG = "SliderView"
static

Definition at line 22 of file SliderView.cpp.

◆ TITLE_Y

int TITLE_Y = 20
staticconstexpr

Display layout constants.

Definition at line 27 of file SliderView.cpp.

◆ VALUE_Y

int VALUE_Y = 55
staticconstexpr

Definition at line 28 of file SliderView.cpp.

Referenced by cdc::ui::SliderView::render().