mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 00:13:02 +00:00
LibWeb+WebContent+Ladybird: Add ability to paste text from clipboard
Text can be pasted by pressing Ctrl/Cmd+V or by using button in the context menu. For now only the Qt client is supported.
This commit is contained in:
parent
d5c6e45dca
commit
561e011e07
Notes:
sideshowbarker
2024-07-16 23:13:25 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 561e011e07
Pull-request: https://github.com/SerenityOS/serenity/pull/23675
Reviewed-by: https://github.com/trflynn89
15 changed files with 82 additions and 4 deletions
|
@ -441,6 +441,15 @@ void BrowsingContext::select_all()
|
|||
(void)selection->select_all_children(*document->body());
|
||||
}
|
||||
|
||||
void BrowsingContext::paste(String const& text)
|
||||
{
|
||||
auto* document = active_document();
|
||||
if (!document)
|
||||
return;
|
||||
|
||||
m_event_handler.handle_paste(text);
|
||||
}
|
||||
|
||||
bool BrowsingContext::increment_cursor_position_offset()
|
||||
{
|
||||
if (!m_cursor_position->increment_offset())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue