mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +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
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…
Add table
Add a link
Reference in a new issue