refine code completion ui
This commit is contained in:
parent
771ccec745
commit
00da09199b
|
@ -51,7 +51,7 @@
|
|||
ry="7.9375" />
|
||||
<path
|
||||
id="text3748"
|
||||
style="font-style:normal;font-weight:normal;font-size:28.2222px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
|
||||
d="m 8.4863281,2.703125 c -1.624712,7.0560557 -3.2517528,14.111577 -4.875,21.167969 4.8684896,0 9.7369789,0 14.6054689,0 0.258897,-1.129255 0.519814,-2.258049 0.78125,-3.386719 -3.597005,0 -7.194011,0 -10.7910158,0 0.515625,-2.233724 1.0312501,-4.467448 1.546875,-6.701172 3.5963538,0 7.1927088,0 10.7890628,0 0.26199,-1.124134 0.522155,-2.248693 0.783203,-3.373047 -3.597005,0 -7.194011,0 -10.791016,0 0.360026,-1.5761716 0.720052,-3.1523435 1.080078,-4.7285154 3.597006,0 7.194011,0 10.791016,0 0.258271,-1.1299003 0.521322,-2.2587032 0.779297,-3.3886718 -4.86849,-1e-7 -9.736979,0 -14.6054689,0 -0.03125,0.1367187 -0.0625,0.2734375 -0.09375,0.4101562 z" />
|
||||
style="font-style:normal;font-weight:normal;font-size:28.2222px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.241984"
|
||||
d="m 8.9892087,3.448301 c -1.4690741,6.5274719 -2.9402539,13.05445 -4.4080035,19.582233 4.4021168,0 8.8042328,0 13.2063498,0 0.234096,-1.04466 0.470019,-2.088894 0.706411,-3.133013 -3.252433,0 -6.504867,0 -9.7572991,0 0.4662306,-2.066391 0.9324626,-4.132782 1.3986931,-6.199173 3.251844,0 6.503689,0 9.755534,0 0.236892,-1.039923 0.472135,-2.080239 0.708176,-3.120365 -3.252433,0 -6.504867,0 -9.7573,0 0.325538,-1.4580979 0.651076,-2.9161955 0.976613,-4.3742931 3.252434,0 6.504867,0 9.7573,0 0.23353,-1.0452572 0.471382,-2.0894991 0.704645,-3.1348195 -4.402117,-1e-7 -8.804233,0 -13.20635,0 C 9.045722,3.1953473 9.017465,3.3218242 8.9892087,3.448301 Z" />
|
||||
</g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
@ -3,5 +3,7 @@
|
|||
"isDark":false,
|
||||
"default scheme": "Intellij Classic",
|
||||
"palette": {
|
||||
"PaletteHighlight":"#ffdddddd",
|
||||
"PaletteHighlightedText":"#ff000000"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ bool CodeCompletionPopup::search(const QString &memberPhrase, bool autoHideOnSin
|
|||
mDelegate->setNormalColor(item->foreground());
|
||||
else
|
||||
mDelegate->setNormalColor(palette().color(QPalette::Text));
|
||||
item = mColors->value(StatementKind::skLocalVariable,PColorSchemeItem());
|
||||
item = mColors->value(StatementKind::skKeyword,PColorSchemeItem());
|
||||
if (item)
|
||||
mDelegate->setMatchedColor(item->foreground());
|
||||
else
|
||||
|
@ -1006,13 +1006,16 @@ void CodeCompletionListItemDelegate::paint(QPainter *painter, const QStyleOption
|
|||
PStatement statement;
|
||||
if (mModel && (statement = mModel->statement(index)) ) {
|
||||
painter->save();
|
||||
if (option.state & QStyle::State_Selected)
|
||||
QColor normalColor = mNormalColor;
|
||||
if (option.state & QStyle::State_Selected) {
|
||||
painter->fillRect(option.rect, option.palette.highlight());
|
||||
normalColor = option.palette.color(QPalette::HighlightedText);
|
||||
}
|
||||
QPixmap icon = mModel->statementIcon(index);
|
||||
int x=option.rect.left();
|
||||
if (!icon.isNull()) {
|
||||
painter->drawPixmap(x,option.rect.top()+(option.rect.height()-icon.height())/2,icon);
|
||||
x+=icon.width();
|
||||
painter->drawPixmap(x+(option.rect.height()-icon.width())/2,option.rect.top()+(option.rect.height()-icon.height())/2,icon);
|
||||
x+=option.rect.height();
|
||||
}
|
||||
QString text = statement->command;
|
||||
int pos=0;
|
||||
|
@ -1020,7 +1023,7 @@ void CodeCompletionListItemDelegate::paint(QPainter *painter, const QStyleOption
|
|||
foreach (const PStatementMathPosition& matchPosition, statement->matchPositions) {
|
||||
if (pos<matchPosition->start) {
|
||||
QString t = text.mid(pos,matchPosition->start-pos);
|
||||
painter->setPen(mNormalColor);
|
||||
painter->setPen(normalColor);
|
||||
painter->drawText(x,y,t);
|
||||
x+=painter->fontMetrics().horizontalAdvance(t);
|
||||
}
|
||||
|
@ -1032,7 +1035,7 @@ void CodeCompletionListItemDelegate::paint(QPainter *painter, const QStyleOption
|
|||
}
|
||||
if (pos<text.length()) {
|
||||
QString t = text.mid(pos,text.length()-pos);
|
||||
painter->setPen(mNormalColor);
|
||||
painter->setPen(normalColor);
|
||||
painter->drawText(x,y,t);
|
||||
x+=painter->fontMetrics().horizontalAdvance(t);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue