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
+1 -1
View File
@@ -119,7 +119,7 @@
<directive>#00A0B6</directive>
<keyword>#00A0B6</keyword>
<type>#FF4A52</type>
<comment>#A0A0A4</comment>
<comment>#9DC28D</comment>
<number>#EE7326</number>
<quotation>#D663D6</quotation>
<function>#FBBA00</function>
+1 -1
View File
@@ -119,7 +119,7 @@
<directive>#1B8856</directive>
<keyword>#1B8856</keyword>
<type>#C1492D</type>
<comment>#1A801A</comment>
<comment>#287299</comment>
<number>#C1315E</number>
<quotation>#865F9E</quotation>
<function>#CC9533</function>
+5 -5
View File
@@ -119,7 +119,7 @@
<directive>#1F9C62</directive>
<keyword>#1F9C62</keyword>
<type>#D95233</type>
<comment>#A0A0A4</comment>
<comment>#487F9C</comment>
<number>#CC3463</number>
<quotation>#9368AD</quotation>
<function>#D69C36</function>
@@ -137,12 +137,12 @@
<fill>transparent</fill>
</normal>
<focus>
<border>#F7F7F7</border>
<border>#D5D5D5</border>
<fill>transparent</fill>
</focus>
<active>
<border>transparent</border>
<fill>#F7F7F7</fill>
<fill>#D5D5D5</fill>
<text>#272728</text>
</active>
</token>
@@ -399,8 +399,8 @@
</macro_use>
<aggregation>
<normal>#3D3D3D</normal>
<focus>#4D4D4D</focus>
<normal>#4D4D4D</normal>
<focus>#6D6D6D</focus>
</aggregation>
</edge>
</graph>
+2 -2
View File
@@ -35,10 +35,10 @@ QWidget#search_box_highlight {
QAbstractItemView#search_box_popup {
background-color: <color:search/popup/background>;
border: none;
border: 1px solid <color:search/popup/line>;
color: <color:search/popup/text>;
font-family: "<setting:font_name>";
margin: 8px 0 0;
margin: 0;
min-height: 26px;
selection-background-color: <color:search/popup/highlight>;
}
@@ -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;