ui: Fixes for upcoming release

* improved comment colors in all color schemes
* improved contrasts for dark color scheme
* fixed error locations stay visible when activating file in single file view
* removed scroll speed change listener from search autocompletion because it caused slowdown on macOS
* fixed bounding rects of graph edges to contain arrow
* fixed tooltip list shown with just one element
This commit is contained in:
Eberhard Graether
2017-08-03 16:15:27 +02:00
parent 9e06323ba7
commit 299b3a1cf7
10 changed files with 33 additions and 19 deletions
@@ -314,7 +314,10 @@ void CodeController::handleMessage(MessageShowErrors* message)
std::sort(snippets.begin(), snippets.end(), CodeSnippetParams::sortById);
expandVisibleSnippets(&snippets, false);
if (view->isInListMode())
{
expandVisibleSnippets(&snippets, false);
}
CodeView::CodeParams params;
params.clearSnippets = true;
@@ -5,6 +5,7 @@
#include "component/view/TooltipView.h"
#include "data/access/StorageAccess.h"
#include "utility/messaging/type/MessageActivateSourceLocations.h"
#include "utility/scheduling/TaskDecoratorDelay.h"
#include "utility/scheduling/TaskLambda.h"
@@ -83,7 +84,13 @@ void TooltipController::handleMessage(MessageTooltipShow* message)
TooltipInfo info = m_storageAccess->getTooltipInfoForSourceLocationIdsAndLocalSymbolIds(
message->sourceLocationIds, message->localSymbolIds);
if (info.snippets.size())
// If a tooltip list would only display one token, then just activate it instead.
// This can happen when edges pointing to the token use the same source location e.g. override edges
if (info.snippets.size() == 1)
{
MessageActivateSourceLocations(message->sourceLocationIds).dispatch();
}
else if (info.snippets.size())
{
getView()->showTooltip(info, getViewForOrigin(message->origin));
@@ -15,6 +15,7 @@ public:
, origin(origin)
{
setSendAsTask(false);
setIsLogged(false);
}
MessageTooltipShow(const std::vector<Id>& sourceLocationIds, const std::vector<Id>& localSymbolIds, TooltipOrigin origin)
@@ -23,6 +24,7 @@ public:
, origin(origin)
{
setSendAsTask(false);
setIsLogged(false);
}
static const std::string getStaticType()
@@ -361,9 +361,6 @@ QtAutocompletionList::QtAutocompletionList(QWidget* parent)
setModelSorting(QCompleter::UnsortedModel);
setCompletionPrefix("");
setMaxVisibleItems(8);
m_scrollSpeedChangeListenerHorizontal.setScrollBar(list->horizontalScrollBar());
m_scrollSpeedChangeListenerVertical.setScrollBar(list->verticalScrollBar());
}
QtAutocompletionList::~QtAutocompletionList()
@@ -11,7 +11,6 @@
#include "data/search/SearchMatch.h"
#include "qt/utility/QtDeviceScaledPixmap.h"
#include "qt/utility/QtScrollSpeedChangeListener.h"
class QtAutocompletionModel
: public QAbstractTableModel
@@ -92,9 +91,6 @@ private slots:
private:
std::shared_ptr<QtAutocompletionModel> m_model;
std::shared_ptr<QtAutocompletionDelegate> m_delegate;
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerHorizontal;
QtScrollSpeedChangeListener m_scrollSpeedChangeListenerVertical;
};
#endif // QT_AUTOCOMPLETION_LIST
+10 -1
View File
@@ -18,6 +18,8 @@ QtLineItemAngled::~QtLineItemAngled()
QPainterPath QtLineItemAngled::shape() const
{
QPainterPath path;
path.setFillRule(Qt::WindingFill);
QPolygon poly = getPath();
for (int i = 0; i < poly.size() - 1; i++)
@@ -25,7 +27,7 @@ QPainterPath QtLineItemAngled::shape() const
path.addRect(QRectF(poly.at(i), poly.at(i + 1)).normalized().adjusted(-5, -5, 5, 5));
}
// path.addRect(getArrowBoundingRect(poly).adjusted(-3, -3, 3, 3));
path.addRect(getArrowBoundingRect(poly).adjusted(-3, -3, 3, 3));
return path;
}
@@ -43,6 +45,7 @@ void QtLineItemAngled::paint(QPainter* painter, const QStyleOptionGraphicsItem*
path.moveTo(poly.at(i));
// debug: draw line path
// while (i > 0)
// {
// i--;
@@ -53,6 +56,12 @@ void QtLineItemAngled::paint(QPainter* painter, const QStyleOptionGraphicsItem*
// return;
// debug: draw bounding rects
// path = shape();
// painter->drawPath(path);
// return;
QRectF drawRect = options->exposedRect;
QRectF partRect;