ui: fixes
* fixed first match in autocompletion not preselected * fixed maximize file button extending snippets * changed names of views and setting name of composite view * fixed number of error locations
This commit is contained in:
@@ -205,6 +205,8 @@ void QtAutocompletionList::completeAt(const QPoint& pos, const std::vector<Searc
|
||||
return;
|
||||
}
|
||||
|
||||
setCompletionPrefix("");
|
||||
|
||||
const QModelIndex& index = completionModel()->index(0, 0);
|
||||
list->setCurrentIndex(index);
|
||||
|
||||
@@ -212,16 +214,12 @@ void QtAutocompletionList::completeAt(const QPoint& pos, const std::vector<Searc
|
||||
minSize.setHeight(std::min(minSize.height(), m_model->rowCount(index) * rect.height() + 16));
|
||||
|
||||
list->setMinimumSize(minSize);
|
||||
|
||||
list->verticalScrollBar()->setValue(list->verticalScrollBar()->minimum());
|
||||
list->setCurrentIndex(index); // must be set again to avoid flickering
|
||||
|
||||
disconnect(); // must be done because of a bug where signals are no longer received by QtSmartSearchBox
|
||||
connect(this, SIGNAL(highlighted(const QModelIndex&)), this, SLOT(onHighlighted(const QModelIndex&)), Qt::DirectConnection);
|
||||
connect(this, SIGNAL(activated(const QModelIndex&)), this, SLOT(onActivated(const QModelIndex&)), Qt::DirectConnection);
|
||||
|
||||
setCompletionPrefix("");
|
||||
|
||||
QWidget* textBox = dynamic_cast<QWidget*>(parent());
|
||||
complete(QRect(pos.x(), pos.y(), textBox->width(), 1));
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include "qt/view/QtViewWidgetWrapper.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
|
||||
QtCompositeView::QtCompositeView(ViewLayout* viewLayout, CompositeDirection direction)
|
||||
: CompositeView(viewLayout, direction)
|
||||
QtCompositeView::QtCompositeView(ViewLayout* viewLayout, CompositeDirection direction, const std::string& name)
|
||||
: CompositeView(viewLayout, direction, name)
|
||||
, m_refreshFunctor(std::bind(&QtCompositeView::doRefreshView, this))
|
||||
{
|
||||
QBoxLayout* layout;
|
||||
|
||||
@@ -10,7 +10,7 @@ class QtCompositeView
|
||||
: public CompositeView
|
||||
{
|
||||
public:
|
||||
QtCompositeView(ViewLayout* viewLayout, CompositeDirection direction);
|
||||
QtCompositeView(ViewLayout* viewLayout, CompositeDirection direction, const std::string& name);
|
||||
~QtCompositeView();
|
||||
|
||||
// View implementation
|
||||
|
||||
@@ -25,9 +25,9 @@ std::shared_ptr<MainView> QtViewFactory::createMainView() const
|
||||
}
|
||||
|
||||
std::shared_ptr<CompositeView> QtViewFactory::createCompositeView(
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name
|
||||
) const {
|
||||
std::shared_ptr<CompositeView> ptr = std::make_shared<QtCompositeView>(viewLayout, direction);
|
||||
std::shared_ptr<CompositeView> ptr = std::make_shared<QtCompositeView>(viewLayout, direction, name);
|
||||
ptr->init();
|
||||
ptr->addToLayout();
|
||||
return ptr;
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
|
||||
virtual std::shared_ptr<MainView> createMainView() const;
|
||||
virtual std::shared_ptr<CompositeView> createCompositeView(
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction) const;
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name) const;
|
||||
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
||||
|
||||
Reference in New Issue
Block a user