mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibVT: Show action of double click in tooltip
When hovering an item in Terminal we now show what application will handle it, e.g "Open app-catdog.png in ImageViewer". If the file is its own handler, i.e an executable, it will show "Execute myscript.sh"
This commit is contained in:
parent
f6ab63993a
commit
3c98a9430b
Notes:
sideshowbarker
2024-07-18 01:10:45 +09:00
Author: https://github.com/DavidLindbom 🔰 Commit: https://github.com/SerenityOS/serenity/commit/3c98a9430b2 Pull-request: https://github.com/SerenityOS/serenity/pull/10887
1 changed files with 12 additions and 1 deletions
|
@ -822,7 +822,18 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
if (attribute.href_id != m_hovered_href_id) {
|
||||
if (m_active_href_id.is_null() || m_active_href_id == attribute.href_id) {
|
||||
m_hovered_href_id = attribute.href_id;
|
||||
m_hovered_href = attribute.href;
|
||||
auto handlers = Desktop::Launcher::get_handlers_for_url(attribute.href);
|
||||
if (!handlers.is_empty()) {
|
||||
auto path = URL(attribute.href).path();
|
||||
auto name = LexicalPath::basename(path);
|
||||
if (path == handlers[0]) {
|
||||
m_hovered_href = String::formatted("Execute {}", name);
|
||||
} else {
|
||||
m_hovered_href = String::formatted("Open {} with {}", name, LexicalPath::basename(handlers[0]));
|
||||
}
|
||||
} else {
|
||||
m_hovered_href = attribute.href;
|
||||
}
|
||||
} else {
|
||||
m_hovered_href_id = {};
|
||||
m_hovered_href = {};
|
||||
|
|
Loading…
Reference in a new issue