mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibGUI+Userland: Improve error and font handling for InputBox
Adds fallible factories, ports DeprecatedString, and rebuilds the layout to accomodate system font changes.
This commit is contained in:
parent
9c2bcffe83
commit
02a9e5d3f6
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/thankyouverycool
Commit: 02a9e5d3f6
Pull-request: https://github.com/SerenityOS/serenity/pull/18405
19 changed files with 135 additions and 124 deletions
|
@ -97,9 +97,9 @@ void TextEditor::create_actions()
|
|||
if (is_multi_line()) {
|
||||
m_go_to_line_action = Action::create(
|
||||
"Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
|
||||
DeprecatedString value;
|
||||
String value;
|
||||
if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) {
|
||||
auto line_target = value.to_uint();
|
||||
auto line_target = AK::StringUtils::convert_to_uint(value.bytes_as_string_view());
|
||||
if (line_target.has_value()) {
|
||||
set_cursor_and_focus_line(line_target.value() - 1, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue