Skip to content

Commit 0bfdc28

Browse files
committed
Don't show context menu in Browse tab when not clicking on column header
When not clicking on an actual column header in the Browse Data tab don't show the context menu. It's not working correctly anyway. See issue sqlitebrowser#485.
1 parent 93cdbd0 commit 0bfdc28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MainWindow.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,10 @@ void MainWindow::showDataColumnPopupMenu(const QPoint& pos)
23582358
{
23592359
// Get the index of the column which the user has clicked on and store it in the action. This is sort of hack-ish and it might be the heat in my room
23602360
// but I haven't come up with a better solution so far
2361-
ui->actionBrowseTableEditDisplayFormat->setProperty("clicked_column", ui->dataTable->horizontalHeader()->logicalIndexAt(pos));
2361+
int logical_index = ui->dataTable->horizontalHeader()->logicalIndexAt(pos);
2362+
if(logical_index == -1) // Don't open the popup menu if the user hasn't clicked on a column header
2363+
return;
2364+
ui->actionBrowseTableEditDisplayFormat->setProperty("clicked_column", logical_index);
23622365

23632366
// Calculate the proper position for the context menu and display it
23642367
popupBrowseDataHeaderMenu->exec(ui->dataTable->horizontalHeader()->mapToGlobal(pos));

0 commit comments

Comments
 (0)