fix: blobs now allow to be drawn in device pixels to stay sharp
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 25s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 51s
Python / verify (pull_request) Failing after 1m25s
Rust / fmt (pull_request) Successful in 39s
Rust / clippy (pull_request) Successful in 59s
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 25s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 51s
Python / verify (pull_request) Failing after 1m25s
Rust / fmt (pull_request) Successful in 39s
Rust / clippy (pull_request) Successful in 59s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QHash>
|
||||
#include <QPointer>
|
||||
#include <QtMath>
|
||||
#include <QtGui/private/qabstractlayoutstyleinfo_p.h>
|
||||
#include <QtGui/private/qgridlayoutengine_p.h>
|
||||
#include <QtQuickLayouts/private/qquickgridlayoutengine_p.h>
|
||||
@@ -20,6 +22,20 @@ class SnapLayoutStyleInfo : public QAbstractLayoutStyleInfo {
|
||||
bool hasChangedCore() const override;
|
||||
};
|
||||
|
||||
class SnapGridLayoutEngine : public QGridLayoutEngine {
|
||||
public:
|
||||
SnapGridLayoutEngine() : QGridLayoutEngine(Qt::AlignVCenter, false) {}
|
||||
|
||||
QQuickGridLayoutItem* findLayoutItem(QQuickItem* item) const {
|
||||
for (int i = int(q_items.size()) - 1; i >= 0; --i) {
|
||||
QQuickGridLayoutItem* layoutItem =
|
||||
static_cast<QQuickGridLayoutItem*>(q_items.at(i));
|
||||
if (layoutItem->layoutItem() == item) return layoutItem;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class SnapGridLayoutItem : public QQuickGridLayoutItem {
|
||||
public:
|
||||
SnapGridLayoutItem(
|
||||
@@ -28,13 +44,12 @@ class SnapGridLayoutItem : public QQuickGridLayoutItem {
|
||||
int column,
|
||||
int rowSpan,
|
||||
int columnSpan,
|
||||
Qt::Alignment alignment,
|
||||
SnapLayout* layout);
|
||||
Qt::Alignment alignment);
|
||||
|
||||
void setGeometry(const QRectF& rect) override;
|
||||
|
||||
private:
|
||||
SnapLayout* m_layout;
|
||||
QRectF engineRect;
|
||||
bool placed = false;
|
||||
};
|
||||
|
||||
class SnapLayout : public QQuickLayout {
|
||||
@@ -101,6 +116,10 @@ class SnapLayout : public QQuickLayout {
|
||||
void insertLayoutItems();
|
||||
void removeGridItem(QGridLayoutItem* gridItem);
|
||||
|
||||
void arrangeChildren();
|
||||
|
||||
void applySpacing();
|
||||
|
||||
void updateAncestorListeners();
|
||||
void clearAncestorListeners();
|
||||
};
|
||||
@@ -113,10 +132,11 @@ class SnapLayoutPrivate : public QQuickLayoutPrivate {
|
||||
|
||||
void mirrorChange() override;
|
||||
|
||||
QQuickGridLayoutEngine engine;
|
||||
SnapGridLayoutEngine engine;
|
||||
SnapLayoutStyleInfo* styleInfo = nullptr;
|
||||
Qt::Orientation orientation = Qt::Horizontal;
|
||||
Qt::LayoutDirection layoutDirection = Qt::LeftToRight;
|
||||
qreal spacingRequest = qQNaN();
|
||||
bool rearranging = false;
|
||||
int recurRearrangeCounter = 0;
|
||||
QList<QQuickItem*> invalidateAfterRearrange;
|
||||
@@ -124,6 +144,14 @@ class SnapLayoutPrivate : public QQuickLayoutPrivate {
|
||||
QVector<QPointer<QQuickItem>> ancestorListeners;
|
||||
qint64 originResidualX = -1;
|
||||
qint64 originResidualY = -1;
|
||||
|
||||
struct ChildSize {
|
||||
qint64 engineWidth = 0;
|
||||
qint64 engineHeight = 0;
|
||||
qint64 width = 0;
|
||||
qint64 height = 0;
|
||||
};
|
||||
QHash<QQuickItem*, ChildSize> childSizes;
|
||||
};
|
||||
|
||||
} // namespace ZShell::components
|
||||
|
||||
Reference in New Issue
Block a user