logic: More fixes for release

* Fixed crash on undoing aggregation edge
* Avoid mutex locking in logging classes when logging is disabled
* Readded dark color scheme
* Fixed font size of type label in autocompletion list
* Fixed text drawing in autocompletion list
* Only give camelcase score when no noletter score was given
* Added MessageShowErrors to undo stack
* Select error line in table when undoing MessageShowErrors
* Notify user about new Plugin in description of From Visual Studio project setup
* Fixed row height of Project File Location label in project setup
This commit is contained in:
Eberhard Graether
2016-10-14 00:45:37 +02:00
parent 2dc9995cc1
commit 30d222b7db
19 changed files with 626 additions and 137 deletions
@@ -125,7 +125,6 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
"----------------------------------------------------------------------------------------------------"
"----------------------------------------------------------------------------------------------------"
) / 500.0f;
painter->drawText(option.rect.adjusted(charWidth + 2, -1, 0, 0), Qt::AlignLeft, name);
QString highlightName(name.size(), ' ');
@@ -136,11 +135,12 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
{
int idx = indices[i].toInt();
QRect rect = option.rect.adjusted(charWidth * (idx + 1) + 1, 2, 0, -1);
rect.setWidth(charWidth + 2);
QRect rect = option.rect.adjusted(charWidth * (idx + 1) + 2, 2, 0, -1);
rect.setWidth(charWidth + 1);
painter->fillRect(rect, color);
highlightName[idx] = name.at(idx);
name[idx] = ' ';
}
}
else
@@ -150,6 +150,8 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
painter->fillRect(rect, color);
}
painter->drawText(option.rect.adjusted(charWidth + 2, -1, 0, 0), Qt::AlignLeft, name);
painter->save();
QPen highlightPen = painter->pen();
highlightPen.setColor(textColor);
@@ -160,12 +162,8 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
if (type.size())
{
QFont font = painter->font();
if (font.pointSize() > 0)
{
QFont typeFont = font;
typeFont.setPointSize(ApplicationSettings::getInstance()->getFontSize() - 4);
painter->setFont(typeFont);
}
font.setPixelSize(ApplicationSettings::getInstance()->getFontSize() - 4);
painter->setFont(font);
QPen typePen = painter->pen();
typePen.setColor(scheme->getColor("search/popup/by_text").c_str());
+18 -2
View File
@@ -24,6 +24,8 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout)
, m_clearFunctor(std::bind(&QtErrorView::doClear, this))
, m_refreshFunctor(std::bind(&QtErrorView::doRefreshView, this))
, m_addErrorFunctor(std::bind(&QtErrorView::doAddError, this, std::placeholders::_1))
, m_setErrorIdFunctor(std::bind(&QtErrorView::doSetErrorId, this, std::placeholders::_1))
, m_ignoreNextSelection(false)
{
}
@@ -76,7 +78,7 @@ void QtErrorView::initView()
connect(m_table->selectionModel(), &QItemSelectionModel::currentRowChanged,
[=](const QModelIndex& index, const QModelIndex& previousIndex)
{
if (index.isValid())
if (index.isValid() && !m_ignoreNextSelection)
{
if (m_model->item(index.row(), COLUMN::FILE) == nullptr)
{
@@ -85,6 +87,8 @@ void QtErrorView::initView()
MessageShowErrors(m_model->item(index.row(), COLUMN::ID)->text().toUInt()).dispatch();
}
m_ignoreNextSelection = false;
});
layout->addWidget(m_table);
@@ -120,8 +124,9 @@ void QtErrorView::addError(const StorageError& error)
m_addErrorFunctor(error);
}
void QtErrorView::clickedInEmptySpace()
void QtErrorView::setErrorId(Id errorId)
{
m_setErrorIdFunctor(errorId);
}
void QtErrorView::doRefreshView()
@@ -151,6 +156,17 @@ void QtErrorView::doAddError(const StorageError& error)
addErrorToTable(error);
}
void QtErrorView::doSetErrorId(Id errorId)
{
QList<QStandardItem*> items = m_model->findItems(QString::number(errorId), Qt::MatchExactly, COLUMN::ID);
if (items.size() == 1)
{
m_ignoreNextSelection = true;
m_table->selectRow(items.at(0)->row());
}
}
void QtErrorView::setStyleSheet() const
{
QWidget* widget = QtViewWidgetWrapper::getWidgetOfView(this);
+5 -3
View File
@@ -30,9 +30,7 @@ public:
// ErrorView implementation
virtual void clear();
virtual void addError(const StorageError& error);
private slots:
void clickedInEmptySpace();
virtual void setErrorId(Id errorId);
private:
enum COLUMN {
@@ -47,6 +45,7 @@ private:
void doRefreshView();
void doClear();
void doAddError(const StorageError& error);
void doSetErrorId(Id errorId);
void setStyleSheet() const;
@@ -58,6 +57,7 @@ private:
QtThreadedFunctor<void> m_clearFunctor;
QtThreadedFunctor<void> m_refreshFunctor;
QtThreadedFunctor<const StorageError&> m_addErrorFunctor;
QtThreadedFunctor<Id> m_setErrorIdFunctor;
QCheckBox* m_showErrors;
QCheckBox* m_showFatals;
@@ -69,6 +69,8 @@ private:
std::vector<StorageError> m_errors;
QPalette* m_palette;
bool m_ignoreNextSelection;
};
#endif // QT_ERROR_VIEW_H
@@ -137,7 +137,8 @@ void QtProjectWizzardContentData::addNameAndLocation(QGridLayout* layout, int& r
m_projectFileLocation->setPickDirectory(true);
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
layout->setRowMinimumHeight(row, 30);
row++;
}