Skip to content

Commit

Permalink
Ensure we query the correct icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Jun 7, 2024
1 parent 7b5dd02 commit 2da7766
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gui/qml/AccountButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ ToolButton {
Layout.preferredWidth: control.icon.width
fillMode: Image.PreserveAspectFit
source: control.icon.source
sourceSize.height: control.icon.height
sourceSize.width: control.icon.width
}
Label {
Layout.fillHeight: true
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qml/FolderError.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ ColumnLayout {
source: "image://ownCloud/core/warning"
Layout.maximumHeight: 16
Layout.maximumWidth: 16
sourceSize.width: width
sourceSize.height: height
}
Label {
id: label
Expand Down
4 changes: 4 additions & 0 deletions src/gui/spaces/qml/SpaceDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Item {
id: image
anchors.fill: parent
fillMode: Image.PreserveAspectFit
sourceSize.width: width
sourceSize.height: height
}
}
ColumnLayout {
Expand All @@ -60,6 +62,8 @@ Item {
Layout.preferredHeight: 16
Layout.preferredWidth: 16
visible: statusSource
sourceSize.width: width
sourceSize.height: height
}
Label {
id: title
Expand Down
4 changes: 3 additions & 1 deletion src/resources/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ QPixmap CoreImageProvider::requestPixmap(const QString &id, QSize *size, const Q
} else {
Q_UNREACHABLE();
}
const QSize actualSize = requestedSize.isValid() ? requestedSize : icon.availableSizes().first();
// the sourceSize of the Image must be provided
Q_ASSERT(requestedSize.isValid());
const QSize actualSize = requestedSize.isValid() ? requestedSize : icon.availableSizes().constFirst();
if (size) {
*size = actualSize;
}
Expand Down

0 comments on commit 2da7766

Please sign in to comment.