From 826a007904f6c69105205ca01d52a20f0b838963 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 28 Dec 2014 04:04:58 +0000 Subject: [PATCH] Use QToolButton instead of QPushButton for path button, specify button icon size explicitly --- qt/relocate.cc | 3 +++ qt/relocate.ui | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/qt/relocate.cc b/qt/relocate.cc index a18861eb0..3b97031ce 100644 --- a/qt/relocate.cc +++ b/qt/relocate.cc @@ -31,6 +31,8 @@ RelocateDialog::onFileSelected (const QString& path) { myPath = path; + const int iconSize = style ()->pixelMetric (QStyle::PM_SmallIconSize); + const QFileInfo pathInfo (path); const QString absolutePath = pathInfo.absoluteFilePath (); const QFileIconProvider iconProvider; @@ -38,6 +40,7 @@ RelocateDialog::onFileSelected (const QString& path) ui.newLocationButton->setIcon (mySession.isLocal () ? iconProvider.icon (pathInfo) : iconProvider.icon (QFileIconProvider::Folder)); + ui.newLocationButton->setIconSize (QSize (iconSize, iconSize)); ui.newLocationButton->setText (pathInfo.fileName ().isEmpty () ? absolutePath : pathInfo.fileName ()); ui.newLocationButton->setToolTip (absolutePath); } diff --git a/qt/relocate.ui b/qt/relocate.ui index 08b38d3c3..adfb379b7 100644 --- a/qt/relocate.ui +++ b/qt/relocate.ui @@ -57,12 +57,18 @@ - + + + + 0 + 0 + + text-align:left - - false + + Qt::ToolButtonTextBesideIcon -- 2.40.0