]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiCompleter.cpp
Properly scale some icons for HiDPI (#12695)
[lyx.git] / src / frontends / qt / GuiCompleter.cpp
index 33462b3b9bc6fe9ef162e1053d92ff35a890d9b6..661178575b1f860e2a71ce82bedd42dd5470456f 100644 (file)
@@ -455,8 +455,8 @@ void GuiCompleter::asyncUpdatePopup()
        // has a bad memory about it and we have to tell him again and again.
        QTreeView * listView = static_cast<QTreeView *>(popup());
        listView->header()->setStretchLastSection(false);
-       setSectionResizeMode(listView->header(), 0, QHeaderView::Stretch);
-       setSectionResizeMode(listView->header(), 1, QHeaderView::Fixed);
+       listView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
+       listView->header()->setSectionResizeMode(1, QHeaderView::Fixed);
        listView->header()->resizeSection(1, 22);
 
        // show/update popup
@@ -655,7 +655,7 @@ void GuiCompleter::activate()
 
 void GuiCompleter::tab()
 {
-       BufferView const & bv = gui_->bufferView();
+       BufferView & bv = gui_->bufferView();
        Cursor cur = bv.cursor();
        cur.screenUpdateFlags(Update::None);
 
@@ -682,9 +682,8 @@ void GuiCompleter::tab()
                return;
        }
 
-       // Make undo possible
+       // Prepare for undo (recordUndo is invoked in the insets' insertCompletion methods)
        UndoGroupHelper ugh(cur.buffer());
-       cur.recordUndo();
 
        // If completion is active, at least complete by one character
        docstring prefix = cur.inset().completionPrefix(cur);
@@ -711,7 +710,7 @@ void GuiCompleter::tab()
        docstring longestCompletion = longestUniqueCompletion();
        prefix = cur.inset().completionPrefix(cur);
        docstring postfix = longestCompletion.substr(min(longestCompletion.size(), prefix.size()));
-       cur.inset().insertCompletion(cur, postfix, false);
+       cur.inset().insertCompletion(cur, postfix, uniqueCompletionAvailable());
        old_cursor_ = bv.cursor();
        updatePrefix(cur);