mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-26 16:26:06 -04:00
fixed memory usage (#2380)
* fixed memory usage in ui_about_simple * fixed memory usage in freqman_db * fixed memory usage in tone_key
This commit is contained in:
parent
fc08d4ead9
commit
b108d975c0
7 changed files with 42 additions and 24 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "ui_about_simple.hpp"
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#define ROLL_SPEED_FRAME_PER_LINE 60
|
||||
// cuz frame rate of pp screen is probably 60, scroll per sec
|
||||
|
||||
|
@ -7,7 +9,7 @@ namespace ui {
|
|||
|
||||
// TODO: Generate this automatically from github
|
||||
// Information: a line starting with a '#' will be yellow coloured
|
||||
const std::string authors_list[] = {
|
||||
constexpr std::string_view authors_list[] = {
|
||||
"# * List of contributors * ",
|
||||
" ",
|
||||
"#Mayhem:",
|
||||
|
@ -70,18 +72,18 @@ AboutView::AboutView(NavigationView& nav) {
|
|||
button_ok.focus();
|
||||
};
|
||||
|
||||
for (const std::string& authors_line : authors_list) {
|
||||
for (auto& authors_line : authors_list) {
|
||||
// if it's starting with #, it's a title and we have to substract the '#' and paint yellow
|
||||
if (authors_line.size() > 0) {
|
||||
if (authors_line[0] == '#') {
|
||||
menu_view.add_item(
|
||||
{authors_line.substr(1, authors_line.size() - 1),
|
||||
{(std::string)authors_line.substr(1, authors_line.size() - 1),
|
||||
ui::Theme::getInstance()->fg_yellow->foreground,
|
||||
nullptr,
|
||||
nullptr});
|
||||
} else {
|
||||
menu_view.add_item(
|
||||
{authors_line,
|
||||
{(std::string)authors_line,
|
||||
Theme::getInstance()->bg_darkest->foreground,
|
||||
nullptr,
|
||||
nullptr});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue