summaryrefslogtreecommitdiff
path: root/lib/nes/app/ui
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 19:54:38 +0100
commit64ebfde8bcd6408e3b6925624e8680c314db6efc (patch)
treeb969314f909f7f16ef5acc63f90dca317a40850a /lib/nes/app/ui
parentd060e3a50c987d10799ccc739bdbf9d7d7a13c10 (diff)
get rid of nasty stdlib
Diffstat (limited to 'lib/nes/app/ui')
-rw-r--r--lib/nes/app/ui/screen-browser.cc3
-rw-r--r--lib/nes/app/ui/screen-error.hh7
-rw-r--r--lib/nes/app/ui/screen-settings.cc2
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/nes/app/ui/screen-browser.cc b/lib/nes/app/ui/screen-browser.cc
index 1b515bd..50b0060 100644
--- a/lib/nes/app/ui/screen-browser.cc
+++ b/lib/nes/app/ui/screen-browser.cc
@@ -4,6 +4,7 @@
#include "nes/app/graphics/tiles/icons.hh"
#include "nes/app/input/input-device-keyboard.hh"
#include "nes/common/containers/path-view.hh"
+#include "nes/common/utils.hh"
namespace nes::app
{
@@ -152,6 +153,6 @@ namespace nes::app
// Round up to get page count.
auto const page_count = (count + (page_size - 1)) / page_size;
// Always show at least one page.
- selection_.set_page_count(std::max(u32{ 1 }, page_count));
+ selection_.set_page_count(max(u32{ 1 }, page_count));
}
} // namespace nes::app \ No newline at end of file
diff --git a/lib/nes/app/ui/screen-error.hh b/lib/nes/app/ui/screen-error.hh
index 4559942..53b6407 100644
--- a/lib/nes/app/ui/screen-error.hh
+++ b/lib/nes/app/ui/screen-error.hh
@@ -1,6 +1,7 @@
#pragma once
#include "nes/app/ui/screen.hh"
+#include "nes/common/containers/string-view.hh"
namespace nes::app
{
@@ -10,17 +11,17 @@ namespace nes::app
class screen_error final : public screen
{
input_device_keyboard& keyboard_;
- std::string_view message_;
+ string_view message_;
status error_{ status::success };
action action_{};
public:
explicit screen_error(input_device_keyboard&);
- auto get_message() const -> std::string_view { return message_; }
+ auto get_message() const -> string_view { return message_; }
auto get_error() const -> status { return error_; }
auto get_action() const -> action { return action_; }
- auto set_message(std::string_view const v) -> void { message_ = v; }
+ auto set_message(string_view const v) -> void { message_ = v; }
auto set_error(status const v) -> void { error_ = v; }
auto set_action(action const& v) -> void { action_ = v; }
diff --git a/lib/nes/app/ui/screen-settings.cc b/lib/nes/app/ui/screen-settings.cc
index 98070d7..9ba4b50 100644
--- a/lib/nes/app/ui/screen-settings.cc
+++ b/lib/nes/app/ui/screen-settings.cc
@@ -7,7 +7,7 @@ namespace nes::app
auto screen_settings::selection_impl::render_item(
renderer& renderer, item const& item, i32 const x, i32 const y, u32 const width, color const c) const -> void
{
- auto const render = [&](std::string_view const label, std::string_view const value)
+ auto const render = [&](string_view const label, string_view const value)
{
auto const label_length = renderer.render_text(x, y, label, c);
auto const value_attrs = text_attributes{}