From: Flavio Date: Fri, 5 Aug 2011 18:53:44 +0000 (+0200) Subject: ESC clears search box X-Git-Tag: 1.5~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=416339eac8ceceb00adcd9448f33df6157c0b88b;p=minitube ESC clears search box --- diff --git a/src/searchlineedit.cpp b/src/searchlineedit.cpp index e63fbd9..65da3c5 100644 --- a/src/searchlineedit.cpp +++ b/src/searchlineedit.cpp @@ -56,6 +56,7 @@ ClearButton::ClearButton(QWidget *parent) setToolTip(tr("Clear")); setVisible(false); setFocusPolicy(Qt::NoFocus); + setShortcut(QKeySequence(Qt::Key_Escape)); } void ClearButton::paintEvent(QPaintEvent *event) @@ -65,7 +66,7 @@ void ClearButton::paintEvent(QPaintEvent *event) int height = this->height(); painter.setRenderHint(QPainter::Antialiasing, true); - QColor color = palette().color(QPalette::Mid); + // QColor color = palette().color(QPalette::Mid); painter.setBrush(isDown() ? palette().color(QPalette::Dark) : palette().color(QPalette::Mid));