mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-19 00:31:52 +00:00
LibGUI: Add GInputBox for getting a string from a modal dialog.
Use this to implement some of the toolbar actions in IRCClient. :^)
This commit is contained in:
parent
b87c099535
commit
a6538feed1
Notes:
sideshowbarker
2024-07-19 15:00:36 +09:00
Author: https://github.com/awesomekling
Commit: a6538feed1
11 changed files with 158 additions and 17 deletions
|
@ -17,6 +17,7 @@ GTextEditor::GTextEditor(Type type, GWidget* parent)
|
|||
m_ruler_visible = is_multi_line();
|
||||
set_font(GFontDatabase::the().get_by_name("Csilla Thin"));
|
||||
m_lines.append(make<Line>());
|
||||
m_cursor = { 0, 0 };
|
||||
}
|
||||
|
||||
GTextEditor::~GTextEditor()
|
||||
|
@ -227,6 +228,11 @@ void GTextEditor::toggle_selection_if_needed_for_event(const GKeyEvent& event)
|
|||
|
||||
void GTextEditor::keydown_event(GKeyEvent& event)
|
||||
{
|
||||
if (event.key() == KeyCode::Key_Escape) {
|
||||
if (on_escape_pressed)
|
||||
on_escape_pressed(*this);
|
||||
return;
|
||||
}
|
||||
if (event.key() == KeyCode::Key_Up) {
|
||||
if (m_cursor.line() > 0) {
|
||||
int new_line = m_cursor.line() - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue