-/***************************************************************************
- * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
#ifndef KSTANDARDITEMLISTWIDGET_H
#define KSTANDARDITEMLISTWIDGET_H
#include "dolphin_export.h"
-
-#include <kitemviews/kitemlistwidget.h>
+#include "kitemviews/kitemlistwidget.h"
#include <QPixmap>
#include <QPointF>
};
/**
- * @brief Itemlist widget implementation for KStandardItemView and KStandardItemModel.
+ * @brief Itemlist widget implementation for KStandardItemListView and KStandardItemModel.
*/
class DOLPHIN_EXPORT KStandardItemListWidget : public KItemListWidget
{
void hideEvent(QHideEvent* event) override;
bool event(QEvent *event) override;
-public slots:
+ struct TextInfo
+ {
+ QPointF pos;
+ QStaticText staticText;
+ };
+
+public Q_SLOTS:
void finishRoleEditing();
-private slots:
+private Q_SLOTS:
void slotCutItemsChanged();
void slotRoleEditingCanceled(const QByteArray& role, const QVariant& value);
void slotRoleEditingFinished(const QByteArray& role, const QVariant& value);
QRectF roleEditingRect(const QByteArray &role) const;
+ QString elideRightKeepExtension(const QString &text, int elidingWidth) const;
+
/**
* Closes the role editor and returns the focus back
* to the KItemListContainer.
*/
static qreal columnPadding(const KItemListStyleOption& option);
+protected:
+ QHash<QByteArray, TextInfo*> m_textInfo; // PlacesItemListWidget needs to access this
+
private:
bool m_isCut;
bool m_isHidden;
QRectF m_iconRect; // Cache for KItemListWidget::iconRect()
QPixmap m_hoverPixmap; // Cache for modified m_pixmap when hovering the item
- struct TextInfo
- {
- QPointF pos;
- QStaticText staticText;
- };
- QHash<QByteArray, TextInfo*> m_textInfo;
-
QRectF m_textRect;
QList<QByteArray> m_sortedVisibleRoles;