make the ptext_prompt func can define which keyboard to enter (#2608)

* _

* format

* use define
This commit is contained in:
sommermorgentraum
2025-04-04 21:41:12 +08:00
committed by GitHub
parent 4162820409
commit 1377516dce
25 changed files with 50 additions and 19 deletions

View File

@@ -25,6 +25,7 @@
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_widget.hpp"
#include "ui_textentry.hpp"
namespace ui {
@@ -105,7 +106,7 @@ void bind(TextField& field, T& value, NavigationView& nav, Fn fn = Fn{}) {
// Capture a new string and make the lambda mutable so it can be modified.
field.on_select = [&nav, buf = std::string{}](TextField& tf) mutable {
buf = tf.get_text();
text_prompt(nav, buf, /*max_length*/ 255,
text_prompt(nav, buf, /*max_length*/ 255, ENTER_KEYBOARD_MODE_ALPHA,
[&tf](std::string& str) {
tf.set_text(str);
});