mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 18:02:54 +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
|
@ -910,6 +910,18 @@ void ConnectionFromClient::select_all(u64 page_id)
|
|||
page.page().focused_context().select_all();
|
||||
}
|
||||
|
||||
void ConnectionFromClient::paste(u64 page_id, String const& text)
|
||||
{
|
||||
auto maybe_page = page(page_id);
|
||||
if (!maybe_page.has_value()) {
|
||||
dbgln("ConnectionFromClient::paste: No page with ID {}", page_id);
|
||||
return;
|
||||
}
|
||||
auto& page = maybe_page.release_value();
|
||||
|
||||
page.page().focused_context().paste(text);
|
||||
}
|
||||
|
||||
Messages::WebContentServer::DumpLayoutTreeResponse ConnectionFromClient::dump_layout_tree(u64 page_id)
|
||||
{
|
||||
auto maybe_page = page(page_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue