mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Better focus painting for Date Widget
This uses the system focus painging. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ef6c410574
commit
f3f03e2ee8
1 changed files with 6 additions and 2 deletions
|
@ -354,8 +354,12 @@ void DateWidget::paintEvent(QPaintEvent *event)
|
|||
painter.setFont(font);
|
||||
painter.drawText(QPoint(32 - metrics.width(day)/2, 45), day);
|
||||
|
||||
if(hasFocus())
|
||||
painter.drawLine(0, 63, 63, 63);
|
||||
if (hasFocus()) {
|
||||
QStyleOptionFocusRect option;
|
||||
option.initFrom(this);
|
||||
option.backgroundColor = palette().color(QPalette::Background);
|
||||
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this);
|
||||
}
|
||||
}
|
||||
|
||||
void DateWidget::mousePressEvent(QMouseEvent *event)
|
||||
|
|
Loading…
Add table
Reference in a new issue