Skip to content

Commit

Permalink
Remove rounding and cropping
Browse files Browse the repository at this point in the history
There's currently no way to tell what is being cropped out
this results in peoples heads being removed, or images
being unclear - such as national flags.

Rounding is not yet working for all image sizes, as it is
applied via a layer mask on a bounding rectangle. Removed
until we can find a way to apply it consistently.
  • Loading branch information
krisgesling committed Oct 20, 2021
1 parent a7f7e57 commit fc920c7
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions ui/Img.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import QtGraphicalEffects 1.0
import Mycroft 1.0 as Mycroft

Item {
id: root
id: imgOuterContainer
property alias imgSrc: img.source
property bool rounded: true
property bool imageModeExpanded: true

Item {
id: imgRoot
id: imgInnerContainer
width: parent.width
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
Expand All @@ -22,29 +20,12 @@ Item {
id: img
anchors.fill: parent
opacity: 0
fillMode: imageModeExpanded ? Image.PreserveAspectCrop : Image.PreserveAspectFit
fillMode: Image.PreserveAspectFit

asynchronous: true
onStatusChanged: {
if (status == Image.Ready) {
if (sourceSize.width >= root.width) {
imageModeExpanded = true
opacity = 1
} else {
imageModeExpanded = false
opacity = 1
}
}
}

layer.enabled: root.rounded ? 1 : 0
layer.effect: OpacityMask {
cached: true
maskSource: Rectangle {
width: imgRoot.width
height: imgRoot.height
visible: false
radius: Mycroft.Units.gridUnit
opacity = 1
}
}
}
Expand Down

0 comments on commit fc920c7

Please sign in to comment.