mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
LibVT: Open hyperlinks on plain left-click instead of Ctrl+Click
This commit is contained in:
parent
3226276fe9
commit
c10c6240f2
1 changed files with 3 additions and 5 deletions
|
@ -618,16 +618,14 @@ void TerminalWidget::copy()
|
||||||
|
|
||||||
void TerminalWidget::mousedown_event(GUI::MouseEvent& event)
|
void TerminalWidget::mousedown_event(GUI::MouseEvent& event)
|
||||||
{
|
{
|
||||||
if (event.modifiers() == Mod_Ctrl && event.button() == GUI::MouseButton::Left) {
|
if (event.button() == GUI::MouseButton::Left) {
|
||||||
auto attribute = m_terminal.attribute_at(buffer_position_at(event.position()));
|
auto attribute = m_terminal.attribute_at(buffer_position_at(event.position()));
|
||||||
if (!attribute.href.is_empty()) {
|
if (!attribute.href.is_empty()) {
|
||||||
dbg() << "Open URL: _" << attribute.href << "_";
|
dbg() << "Open hyperlinked URL: _" << attribute.href << "_";
|
||||||
Desktop::Launcher::open(attribute.href);
|
Desktop::Launcher::open(attribute.href);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.button() == GUI::MouseButton::Left) {
|
|
||||||
if (m_triple_click_timer.is_valid() && m_triple_click_timer.elapsed() < 250) {
|
if (m_triple_click_timer.is_valid() && m_triple_click_timer.elapsed() < 250) {
|
||||||
int start_column = 0;
|
int start_column = 0;
|
||||||
int end_column = m_terminal.columns() - 1;
|
int end_column = m_terminal.columns() - 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue