D17744: New search result look, resurrected
Mariusz Glebocki
noreply at phabricator.kde.org
Sun Dec 23 00:55:04 GMT 2018
mglb added a comment.
Awesome! It was a thing I wanted to be made better. But there are some problems:
1.
- Invoke search, type text: all nice, I see current search line and remaining search results
- Close search
- Invoke search again: There is no current line (this is OK) and no dim (not OK) - search results are barely visible (without transparency they are not visible at all)
2. Font size change (Ctrl+Scroll, Ctrl++, Ctrl+-) during search is not handled
Pedantic things:
- Selecting search result removes the rounded rect's rounding F6502287: rounded-corners.png <https://phabricator.kde.org/F6502287>
Ideas (maybe for future):
- What do you think about making the lines 1px tall, drawn on inner edge of the rectangle? This would match lines in Breeze widget style.
- Configurable colors, or colors taken from system theme/konsole theme
INLINE COMMENTS
> TerminalDisplay.cpp:1662
> + paint.drawLine(QLineF(_searchResultRect.topLeft(), _searchResultRect.topRight()));
> + paint.drawLine(QLineF(_searchResultRect.bottomLeft(), _searchResultRect.bottomRight()));
> + }
Lines are not drawn on a margin:
F6502251: lineless-margin.png <https://phabricator.kde.org/F6502251>
Also, the bottom line is 1px off. It needs to be translated down, like the bottom shaded area.
Fix:
@@ -1639,4 +1639,6 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe)
_searchResultRect.setTop(_searchResultRect.top() - _fontHeight / 3);
_searchResultRect.setBottom(_searchResultRect.bottom() + _fontHeight / 3);
+ _searchResultRect.setLeft(0);
+ _searchResultRect.setRight(contentsRect().width());
QColor shadeColor(0, 0, 0, 192);
@@ -1648,5 +1650,5 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe)
// Lightly shade line with results
shadeColor.setAlpha(120);
- paint.fillRect(0, _searchResultRect.top(), contentsRect().width(), _searchResultRect.height(), shadeColor);
+ paint.fillRect(_searchResultRect, shadeColor);
} else {
_searchResultRect = QRect();
@@ -1659,6 +1661,6 @@ void TerminalDisplay::paintEvent(QPaintEvent* pe)
if (drawSearchResults) {
paint.setPen(QPen(QColor(255, 255, 255, 64), 2));
- paint.drawLine(QLineF(_searchResultRect.topLeft(), _searchResultRect.topRight()));
- paint.drawLine(QLineF(_searchResultRect.bottomLeft(), _searchResultRect.bottomRight()));
+ paint.drawLine(QLine(_searchResultRect.topLeft(), _searchResultRect.topRight()));
+ paint.drawLine(QLine(_searchResultRect.bottomLeft(), _searchResultRect.bottomRight()).translated(0, 1));
}
REPOSITORY
R319 Konsole
REVISION DETAIL
https://phabricator.kde.org/D17744
To: sandsmark, hindenburg, #konsole, thsurrel, tcanabrava
Cc: mglb, konsole-devel, #konsole, thsurrel, ngraham, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20181223/a6b7e092/attachment-0001.html>
More information about the konsole-devel
mailing list