┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-09-28 15:58:14 +0000
committerPeter Penz <[email protected]>2010-09-28 15:58:14 +0000
commitaf98817d43e37a3044eb1908fc2a98f37a3aeb32 (patch)
treede7b02219a9d88bc167b61864cf4fa6950c45be1
parent732459f4e29707faaae63645ffe1aae31215e77e (diff)
Fix issue that tooltip-labels might get clipped (this regression has been introduced by revision 1158057)
CCBUG: 241608 svn path=/trunk/KDE/kdebase/apps/; revision=1180693
-rw-r--r--src/views/tooltips/filemetadatatooltip.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/views/tooltips/filemetadatatooltip.cpp b/src/views/tooltips/filemetadatatooltip.cpp
index 60efa3e96..a9cc2c163 100644
--- a/src/views/tooltips/filemetadatatooltip.cpp
+++ b/src/views/tooltips/filemetadatatooltip.cpp
@@ -40,6 +40,7 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
// Create widget for file preview
m_preview = new QLabel(this);
+ m_preview->setAlignment(Qt::AlignTop);
// Create widget for file name
m_name = new QLabel(this);
@@ -55,15 +56,20 @@ FileMetaDataToolTip::FileMetaDataToolTip(QWidget* parent) :
this, SIGNAL(metaDataRequestFinished(KFileItemList)));
QVBoxLayout* textLayout = new QVBoxLayout();
- textLayout->setAlignment(Qt::AlignTop);
textLayout->addWidget(m_name);
textLayout->addWidget(new KSeparator());
textLayout->addWidget(m_fileMetaDataWidget);
textLayout->setAlignment(m_name, Qt::AlignCenter);
textLayout->setAlignment(m_fileMetaDataWidget, Qt::AlignLeft);
+ // Assure that the text-layout gets top-aligned by adding a stretch.
+ // Don't use textLayout->setAlignment(Qt::AlignTop) instead, as this does
+ // not work with the heightForWidth()-size-hint of m_fileMetaDataWidget
+ // (see bug #241608)
+ textLayout->addStretch();
QHBoxLayout* tipLayout = new QHBoxLayout(this);
tipLayout->addWidget(m_preview);
+ tipLayout->addSpacing(tipLayout->margin());
tipLayout->addLayout(textLayout);
}