mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Showing context menus on event's position.
- some keyboards (usually in laptops) have special key for showing context menu - context menu events from keyboard will now be shown on correct position (not on mouse position)
This commit is contained in:
parent
2582fff163
commit
291468a9ab
@ -89,7 +89,7 @@ void BookmarksToolbar::customContextMenuRequested(const QPoint &pos)
|
||||
menu.addAction(tr("&Hide Toolbar"), this, SLOT(hidePanel()));
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint position = QCursor::pos();
|
||||
QPoint position = mapToGlobal(pos);
|
||||
QPoint p(position.x(), position.y() + 1);
|
||||
menu.exec(p);
|
||||
}
|
||||
@ -113,7 +113,7 @@ void BookmarksToolbar::showBookmarkContextMenu(const QPoint &pos)
|
||||
menu.addAction(IconProvider::fromTheme("list-remove"), tr("Remove bookmark"), this, SLOT(removeButton()))->setData(buttonPointer);
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint position = QCursor::pos();
|
||||
QPoint position = button->mapToGlobal(pos);
|
||||
QPoint p(position.x(), position.y() + 1);
|
||||
menu.exec(p);
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ void LocationBar::contextMenuEvent(QContextMenuEvent* event)
|
||||
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = QCursor::pos();
|
||||
QPoint pos = mapToGlobal(event->pos());
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
||||
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = QCursor::pos();
|
||||
QPoint pos = mapToGlobal(event->pos());
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ void PopupWebView::contextMenuEvent(QContextMenuEvent* event)
|
||||
|
||||
if (!m_menu->isEmpty()) {
|
||||
//Prevent choosing first option with double rightclick
|
||||
const QPoint &pos = QCursor::pos();
|
||||
const QPoint &pos = mapToGlobal(event->pos());
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
return;
|
||||
|
@ -154,7 +154,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
|
||||
}
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
const QPoint &pos = QCursor::pos();
|
||||
const QPoint &pos = mapToGlobal(position);
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
menu.exec(p);
|
||||
|
||||
|
@ -329,7 +329,7 @@ void TabbedWebView::contextMenuEvent(QContextMenuEvent* event)
|
||||
|
||||
if (!m_menu->isEmpty()) {
|
||||
//Prevent choosing first option with double rightclick
|
||||
const QPoint &pos = QCursor::pos();
|
||||
const QPoint &pos = mapToGlobal(event->pos());
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
|
||||
m_menu->popup(p);
|
||||
|
Loading…
Reference in New Issue
Block a user