Skip to content
Snippets Groups Projects
Commit 512b312c authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Some minor modifications to fancylineedit

parent dbafd89f
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,7 @@ FancyLineEdit::FancyLineEdit(QWidget *parent) : ...@@ -111,7 +111,7 @@ FancyLineEdit::FancyLineEdit(QWidget *parent) :
QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ? QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ?
QLatin1String("edit-clear-locationbar-rtl") : QLatin1String("edit-clear-locationbar-rtl") :
QLatin1String("edit-clear-locationbar-ltr"), QLatin1String("edit-clear-locationbar-ltr"),
QIcon::fromTheme("edit-clear", QIcon(QLatin1String("clear.png")))); QIcon::fromTheme("edit-clear", QIcon(QLatin1String(":/core/images/editclear.png"))));
m_d->m_iconbutton->installEventFilter(m_d); m_d->m_iconbutton->installEventFilter(m_d);
m_d->m_iconbutton->setIcon(icon); m_d->m_iconbutton->setIcon(icon);
...@@ -186,10 +186,10 @@ void FancyLineEdit::resizeEvent(QResizeEvent *) ...@@ -186,10 +186,10 @@ void FancyLineEdit::resizeEvent(QResizeEvent *)
iconpos = (iconpos == Left ? Right : Left); iconpos = (iconpos == Left ? Right : Left);
if (iconpos == FancyLineEdit::Right) { if (iconpos == FancyLineEdit::Right) {
const int iconoffset = textMargins().right() + 8; const int iconoffset = textMargins().right() + 4;
m_d->m_iconbutton->setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0)); m_d->m_iconbutton->setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0));
} else { } else {
const int iconoffset = textMargins().left() + 8; const int iconoffset = textMargins().left() + 4;
m_d->m_iconbutton->setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0)); m_d->m_iconbutton->setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0));
} }
} }
...@@ -274,7 +274,7 @@ void IconButton::paintEvent(QPaintEvent *) ...@@ -274,7 +274,7 @@ void IconButton::paintEvent(QPaintEvent *)
QPixmap iconpixmap = icon().pixmap(QSize(ICONBUTTON_SIZE, ICONBUTTON_SIZE), QPixmap iconpixmap = icon().pixmap(QSize(ICONBUTTON_SIZE, ICONBUTTON_SIZE),
state, QIcon::Off); state, QIcon::Off);
QRect pixmapRect = QRect(0, 0, iconpixmap.width(), iconpixmap.height()); QRect pixmapRect = QRect(0, 0, iconpixmap.width(), iconpixmap.height());
pixmapRect.moveCenter(rect().center()); pixmapRect.moveCenter(rect().translated(0,-1).center());
if (static_cast<FancyLineEdit*>(parentWidget())->autoHideIcon()) if (static_cast<FancyLineEdit*>(parentWidget())->autoHideIcon())
painter.setOpacity(m_iconOpacity); painter.setOpacity(m_iconOpacity);
......
...@@ -53,5 +53,6 @@ ...@@ -53,5 +53,6 @@
<file>editormanager/BinFiles.mimetypes.xml</file> <file>editormanager/BinFiles.mimetypes.xml</file>
<file>images/progressbar.png</file> <file>images/progressbar.png</file>
<file>images/help.png</file> <file>images/help.png</file>
<file>images/editclear.png</file>
</qresource> </qresource>
</RCC> </RCC>
src/plugins/coreplugin/images/editclear.png

748 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment