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

Go to the source code of this file.

Namespaces

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

Functions

ListViewcdc::ui::showListView (const char *title, const ListItem *items, uint16_t count, ListView::SelectCallback onSelect, const char *hint)
 Shows a shared list view instance with selection callback.

Variables

static const char * TAG = "ListView"
static constexpr int TITLE_Y = 5
 View-local layout constants for 296x128 panels.
static constexpr int LIST_START_Y = 30
static constexpr int ITEM_PADDING_X = 10
static constexpr uint8_t VISIBLE_ITEMS = 4
 Visible item count derived from available list area.
static ListView cdc::ui::s_sharedListView
 Convenience factory/helper function.
constexpr int SCROLL_INDICATOR_WIDTH
 Scroll indicator column width in pixels.

Variable Documentation

◆ ITEM_PADDING_X

int ITEM_PADDING_X = 10
staticconstexpr

Definition at line 29 of file ListView.cpp.

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

◆ LIST_START_Y

int LIST_START_Y = 30
staticconstexpr

Definition at line 28 of file ListView.cpp.

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

◆ SCROLL_INDICATOR_WIDTH

Scroll indicator column width in pixels.

Definition at line 26 of file LayoutConstants.h.

◆ TAG

const char* TAG = "ListView"
static

ListView Implementation

Highly reusable scrollable selection menu. Display is 296x128, VISIBLE_ITEMS is fixed at 4.

Definition at line 19 of file ListView.cpp.

◆ TITLE_Y

int TITLE_Y = 5
staticconstexpr

View-local layout constants for 296x128 panels.

Shared SCROLL_INDICATOR_WIDTH comes from cdc::ui::layout in LayoutConstants.h.

Definition at line 27 of file ListView.cpp.

◆ VISIBLE_ITEMS

uint8_t VISIBLE_ITEMS = 4
staticconstexpr

Visible item count derived from available list area.

Available height: 128 - 30 (header) - 16 (footer) = 82px. With itemHeight_=18: 82 / 18 = 4 visible rows.

Definition at line 38 of file ListView.cpp.

Referenced by cdc::ui::ListView::init().