diff options
| author | Peter Penz <[email protected]> | 2012-04-11 16:06:18 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-11 16:08:32 +0200 |
| commit | 6c3d9acbc22ea9463ba40ef84c9e8c8419dfacf3 (patch) | |
| tree | e7ffd63acd5e28eb71a077f816a23534b06fcae2 /src/kitemviews/kfileitemlistwidget.cpp | |
| parent | d9dbd3398a258d04ec4517fd13e795b437c869d6 (diff) | |
KItemViews: Internal directory restructuration
- Move all private headers from the kitemviews-directory into
the 'private' subdirectory.
- Get rid of DolphinDirLister and just use a directory-lister
internally in KFileItemModel.
- Minor interface-cleanups for signals
Diffstat (limited to 'src/kitemviews/kfileitemlistwidget.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemlistwidget.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp index 14ec1ec22..f3b4da892 100644 --- a/src/kitemviews/kfileitemlistwidget.cpp +++ b/src/kitemviews/kfileitemlistwidget.cpp @@ -19,10 +19,8 @@ #include "kfileitemlistwidget.h" -#include "kfileitemclipboard_p.h" #include "kfileitemlistview.h" #include "kfileitemmodel.h" -#include "kpixmapmodifier_p.h" #include <KIcon> #include <KIconEffect> @@ -32,6 +30,9 @@ #include <KStringHandler> #include <KDebug> +#include "private/kfileitemclipboard.h" +#include "private/kpixmapmodifier.h" + #include <QFontMetricsF> #include <QGraphicsSceneResizeEvent> #include <QPainter> @@ -193,12 +194,15 @@ QRectF KFileItemListWidget::textRect() const QRectF KFileItemListWidget::textFocusRect() const { + // In the compact- and details-layout a larger textRect() is returned to be aligned + // with the iconRect(). This is useful to have a larger selection/hover-area + // when having a quite large icon size but only one line of text. Still the + // focus rectangle should be shown as narrow as possible around the text. + const_cast<KFileItemListWidget*>(this)->triggerCacheRefreshing(); - if (m_layout == CompactLayout) { - // In the compact layout a larger textRect() is returned to be aligned - // with the iconRect(). This is useful to have a larger selection/hover-area - // when having a quite large icon size but only one line of text. Still the - // focus rectangle should be shown as narrow as possible around the text. + + switch (m_layout) { + case CompactLayout: { QRectF rect = m_textRect; const TextInfo* topText = m_textInfo.value(m_sortedVisibleRoles.first()); const TextInfo* bottomText = m_textInfo.value(m_sortedVisibleRoles.last()); @@ -206,6 +210,19 @@ QRectF KFileItemListWidget::textFocusRect() const rect.setBottom(bottomText->pos.y() + bottomText->staticText.size().height()); return rect; } + + case DetailsLayout: { + QRectF rect = m_textRect; + const TextInfo* textInfo = m_textInfo.value(m_sortedVisibleRoles.first()); + rect.setTop(textInfo->pos.y()); + rect.setBottom(textInfo->pos.y() + textInfo->staticText.size().height()); + return rect; + } + + default: + break; + } + return m_textRect; } |
