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

Go to the source code of this file.

Namespaces

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

Functions

ContextMenuViewcdc::ui::showContextMenu (const char *title, const ContextMenuItem *items, uint8_t count)
 Shows the shared context menu instance as modal.
void cdc::ui::hideContextMenu ()
 Hides the active context menu modal.

Variables

static const char * TAG = "ContextMenuView"
static constexpr int BOX_PADDING = 8
 Layout constants.
static constexpr int TITLE_HEIGHT = 18
static constexpr int ITEM_HEIGHT = 16
static constexpr int MIN_BOX_WIDTH = 120
static constexpr int MAX_BOX_WIDTH = 200
static constexpr uint32_t kMenuTimeoutMs = 60000
 Auto-dismiss timeout after the last interaction (ms).
static ContextMenuView cdc::ui::s_sharedContextMenu
 Convenience helper functions.

Variable Documentation

◆ BOX_PADDING

int BOX_PADDING = 8
staticconstexpr

Layout constants.

Definition at line 22 of file ContextMenuView.cpp.

Referenced by cdc::ui::ContextMenuView::render(), and cdc::ui::MessageBox::render().

◆ ITEM_HEIGHT

int ITEM_HEIGHT = 16
staticconstexpr

Definition at line 24 of file ContextMenuView.cpp.

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

◆ kMenuTimeoutMs

uint32_t kMenuTimeoutMs = 60000
staticconstexpr

Auto-dismiss timeout after the last interaction (ms).

Definition at line 29 of file ContextMenuView.cpp.

Referenced by cdc::ui::ContextMenuView::onTick().

◆ MAX_BOX_WIDTH

int MAX_BOX_WIDTH = 200
staticconstexpr

◆ MIN_BOX_WIDTH

int MIN_BOX_WIDTH = 120
staticconstexpr

◆ TAG

const char* TAG = "ContextMenuView"
static

ContextMenuView Implementation

Quick popup menu displayed as modal overlay.

Definition at line 17 of file ContextMenuView.cpp.

◆ TITLE_HEIGHT

int TITLE_HEIGHT = 18
staticconstexpr

Definition at line 23 of file ContextMenuView.cpp.

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