File indexing completed on 2024-05-12 05:38:56
0001 /* SPDX-FileCopyrightText: 2017 The Qt Company Ltd. 0002 * SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com> 0003 * SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later 0004 */ 0005 0006 #ifndef ICONLABELLAYOUT_P_H 0007 #define ICONLABELLAYOUT_P_H 0008 0009 #include "iconlabellayout.h" 0010 0011 class IconLabelLayoutPrivate : public QObject 0012 { 0013 Q_DECLARE_PUBLIC(IconLabelLayout) 0014 Q_DISABLE_COPY(IconLabelLayoutPrivate) 0015 0016 public: 0017 IconLabelLayoutPrivate(IconLabelLayout *qq) 0018 : q_ptr(qq) 0019 { 0020 } 0021 0022 bool createIconItem(); 0023 bool destroyIconItem(); 0024 bool updateIconItem(); 0025 void syncIconItem(); 0026 void updateOrSyncIconItem(); 0027 0028 bool createLabelItem(); 0029 bool destroyLabelItem(); 0030 bool updateLabelItem(); 0031 void syncLabelItem(); 0032 void updateOrSyncLabelItem(); 0033 0034 void updateImplicitSize(); 0035 void layout(); 0036 0037 IconLabelLayout *const q_ptr; 0038 0039 QPointer<QQmlComponent> iconComponent; 0040 QPointer<QQmlComponent> labelComponent; 0041 0042 QPointer<QQuickItem> iconItem; 0043 QPointer<QQuickItem> labelItem; 0044 0045 bool hasIcon = false; 0046 bool hasLabel = false; 0047 0048 Breeze::QQuickIcon icon = Breeze::QQuickIcon(); 0049 QString text = QString(); 0050 QFont font = QFont(); 0051 QColor color = QColor(); 0052 0053 qreal availableWidth = 0.0; 0054 qreal availableHeight = 0.0; 0055 0056 qreal spacing = 0.0; 0057 qreal leftPadding = 0.0; 0058 qreal rightPadding = 0.0; 0059 qreal topPadding = 0.0; 0060 qreal bottomPadding = 0.0; 0061 0062 bool mirrored = false; 0063 Qt::Alignment alignment = Qt::AlignCenter; 0064 IconLabelLayout::Display display = IconLabelLayout::TextBesideIcon; 0065 0066 QRectF iconRect = QRectF(0, 0, 0, 0); 0067 QRectF labelRect = QRectF(0, 0, 0, 0); 0068 qreal contentWidth = 0.0; 0069 qreal contentHeight = 0.0; 0070 0071 bool firstLayoutCompleted = false; 0072 int layoutCount = 0; 0073 }; 0074 0075 #endif