Skip to content

Commit

Permalink
MMFormPhotoViewer - Only "choose from gallery" on desktop builds (#3152)
Browse files Browse the repository at this point in the history
Take a picture property not available for desktops
  • Loading branch information
VitorVieiraZ committed Mar 19, 2024
1 parent 787172f commit 8777cd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/qml/components/MMPhotoAttachment.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Rectangle {
color: __style.polarColor
radius: 20 * __dp

property bool hasCameraCapability: true

signal capturePhotoClicked()
signal chooseFromGalleryClicked()

Expand All @@ -27,10 +29,13 @@ Rectangle {
spacing: 20 * __dp

Rectangle {
width: parent.width / 2 - parent.spacing / 2
id: takePictureBox

width: hasCameraCapability ? parent.width / 2 - parent.spacing / 2 : 0
height: parent.height
color: __style.lightGreenColor
radius: root.radius
visible: hasCameraCapability

Column {
width: parent.width
Expand Down Expand Up @@ -62,7 +67,9 @@ Rectangle {
}

Rectangle {
width: parent.width / 2 - parent.spacing / 2
id: chooseFromGaleryBox

width: hasCameraCapability ? parent.width / 2 - parent.spacing / 2 : parent.width
height: parent.height
color: __style.lightGreenColor
radius: root.radius
Expand Down
2 changes: 2 additions & 0 deletions app/qml/form/editors/MMFormPhotoViewer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ MMBaseInput {
height: root.contentItemHeight
visible: root.state === "notSet"

hasCameraCapability: root.hasCameraCapability

onCapturePhotoClicked: root.capturePhotoClicked()
onChooseFromGalleryClicked: root.chooseFromGalleryClicked()
}
Expand Down

1 comment on commit 8777cd7

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.03.564311 just submitted!

Please sign in to comment.