aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-19 18:11:44 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-20 15:43:07 -0700
commitf3f03e2ee89a55947a10c2a08ebf6dfa49a393b0 (patch)
treee0953942327c9257aeefcf2d9cb47f1a95db3d3b /qt-ui
parentef6c41057471245be863636ae00a841326a44f6c (diff)
downloadsubsurface-f3f03e2ee89a55947a10c2a08ebf6dfa49a393b0.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/simplewidgets.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index eff3f668b..ebb19bd8b 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -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)