Skip to content

Commit

Permalink
Redesigned OLED menu. Better UI, easier development. (ramapcsx2#527)
Browse files Browse the repository at this point in the history
* Redesigned OLED menu

* better font

* disable hue and volume in OSD

* allow num of presets <= 16

* move OSD_TIMEOUT

* REVERSE_ROTARY_ENCODER_FOR_OSD works correctly now
  • Loading branch information
PSHarold authored Jan 31, 2024
1 parent 64b6348 commit 5293343
Show file tree
Hide file tree
Showing 20 changed files with 4,586 additions and 157 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,5 @@ ASALocalRun/
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.vscode/ipch
i18n_preview*.jpg
29 changes: 29 additions & 0 deletions OLEDMenuConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
See https://github.com/PSHarold/OLED-SSD1306-Menu
for original code, license and documentation
*/
#ifndef OLED_MENU_CONFIG_H_
#define OLED_MENU_CONFIG_H_
// include your translations here
#include "OLEDMenuTranslations.h"
#define OLED_MENU_WIDTH 128
#define OLED_MENU_HEIGHT 64
#define OLED_MENU_MAX_SUBITEMS_NUM 16 // should be less than 256
#define OLED_MENU_MAX_ITEMS_NUM 64 // should be less than 1024
#define OLED_MENU_MAX_DEPTH 8 // maximum levels of submenus
#define OLED_MENU_REFRESH_INTERVAL_IN_MS 50 // not precise
#define OLED_MENU_SCREEN_SAVER_REFRESH_INTERVAL_IN_MS 5000 // not precise
#define OLED_MENU_SCROLL_LEAD_IN_TIME_IN_MS 600 // milliseconds before items start to scroll after being selected
#define OLED_MENU_SCREEN_SAVER_KICK_IN_SECONDS 180 // after "OLED_MENU_SCREEN_SAVE_KICK_IN_SECONDS" seconds, screen saver will show up until any key is pressed
#define OLED_MENU_OVER_DRAW 0 // if set to 0, the last menu item of a page will not be drawn at all if partially outside the screen, and you need to scroll down to see them
#define OLED_MENU_RESET_ALWAYS_SCROLL_ON_SELECTION 0 // if set 1, scrolling items will reset to original position on selection
#define OLED_MENU_WRAPPING_SPACE (OLED_MENU_WIDTH / 3)
#define REVERSE_ROTARY_ENCODER_FOR_OLED_MENU 0 // if set 1, rotary encoder will be reversed for menu navigation
#define REVERSE_ROTARY_ENCODER_FOR_OSD 0 // if set 1, rotary encoder will be reversed for OSD navigation
#define OSD_TIMEOUT 8000 // OSD will disappear after OSD_TIMEOUT milliseconds without inputs

// do not edit these
#define OLED_MENU_STATUS_BAR_HEIGHT (OLED_MENU_HEIGHT / 4) // status bar uses 1/4 of the screen
#define OLED_MENU_USABLE_AREA_HEIGHT (OLED_MENU_HEIGHT - OLED_MENU_STATUS_BAR_HEIGHT)
#define OLED_MENU_SCROLL_LEAD_IN_FRAMES (OLED_MENU_SCROLL_LEAD_IN_TIME_IN_MS / OLED_MENU_REFRESH_INTERVAL_IN_MS)
#endif
921 changes: 921 additions & 0 deletions OLEDMenuFonts.h

Large diffs are not rendered by default.

Loading

0 comments on commit 5293343

Please sign in to comment.