Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes after editors rework 2 #3352

Merged
merged 8 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/qml/components/private/MMBaseInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Item {
width: parent.width
implicitHeight: titleRowGroup.implicitHeight

visible: root.title

RowLayout {
id: titleRowGroup

Expand Down
4 changes: 4 additions & 0 deletions app/qml/components/private/MMBaseSingleLineInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ MMBaseInput {
return __style.forestColor
}

// Text edited signal is emitted when user edits the text manually,
// you won't receive it when text is changed programatically.
// Use textChanged if you need to listen to any text change.
signal textEdited( string text )

signal textClicked()
signal leftContentClicked()
signal rightContentClicked()
Expand Down
53 changes: 29 additions & 24 deletions app/qml/form/components/photo/MMPhotoPreview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,37 @@ Popup {

MMComponents.MMBusyIndicator {
anchors.centerIn: parent
visible: true
visible: imagePreview.status === Image.Loading
}

// Do not propagate clicks to the background
MouseArea {
anchors.fill: parent
onClicked: function( mouse ) {
mouse.accepted = true
}
}

Item {
id: photoFrame

anchors.centerIn: parent
width: Math.min(imagePreview.width, parent.width)
height: Math.min(imagePreview.height, parent.height)

y: parent.height / 2 - height / 2
x: parent.width / 2 - width / 2

Image {
id: imagePreview

height: root.height / 2

autoTransform: true
clip: true

focus: true
asynchronous: true
autoTransform: true
fillMode: Image.PreserveAspectFit
}

PinchHandler {
minimumRotation: -180
Expand All @@ -61,28 +72,22 @@ Popup {
}

DragHandler { }
}
}

Item {
x: __style.safeAreaLeft
y: __style.safeAreaTop
width: parent.width - __style.safeAreaLeft - __style.safeAreaRight
height: parent.height - __style.safeAreaBottom - __style.safeAreaTop

MMComponents.MMRoundButton {
id: closeButton

anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: __style.spacing20
}

bgndColor: __style.lightGreenColor
iconSource: __style.closeIcon
onClicked: {
previewLoader.active = false
}
MMComponents.MMRoundButton {
id: closeButton

anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: __style.safeAreaBottom + __style.spacing20
}

bgndColor: __style.lightGreenColor
iconSource: __style.closeIcon
onClicked: {
previewLoader.active = false
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/qml/form/editors/MMFormCalendarEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ MMPrivateComponents.MMBaseSingleLineInput {
root.rememberValueBoxClicked( checkboxChecked )
}

textField.readOnly: true

onTextClicked: root.openCalendar()
onRightContentClicked: root.openCalendar()

Expand Down
2 changes: 2 additions & 0 deletions app/qml/inputs/MMComboboxInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ MMPrivateComponents.MMBaseSingleLineInput {
onTextClicked: { drawerLoader.active = true; drawerLoader.focus = true }
onRightContentClicked: { drawerLoader.active = true; drawerLoader.focus = true }

textField.readOnly: true

text: {
if ( !comboboxModel ) return "";
if ( currentIndex < 0 || currentIndex >= comboboxModel.count ) return "";
Expand Down
34 changes: 17 additions & 17 deletions app/qml/map/MMMapController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -276,22 +276,6 @@ Item {
sourceComponent: stakeoutToolsComponent
}

MMPositionMarker {
id: positionMarker

xPos: mapPositionSource.screenPosition.x
yPos: mapPositionSource.screenPosition.y
hasDirection: positionDirectionSource.hasDirection

direction: positionDirectionSource.direction
hasPosition: __positionKit.hasPosition

horizontalAccuracy: __positionKit.horizontalAccuracy
accuracyRingSize: mapPositionSource.screenAccuracy

trackingMode: root.state !== "inactive" && tracking.active
}

Loader {
id: tracking

Expand Down Expand Up @@ -348,6 +332,22 @@ Item {
}
}

MMPositionMarker {
id: positionMarker

xPos: mapPositionSource.screenPosition.x
yPos: mapPositionSource.screenPosition.y
hasDirection: positionDirectionSource.hasDirection

direction: positionDirectionSource.direction
hasPosition: __positionKit.hasPosition

horizontalAccuracy: __positionKit.horizontalAccuracy
accuracyRingSize: mapPositionSource.screenAccuracy

trackingMode: root.state !== "inactive" && tracking.active
}

Loader {
id: recordingToolsLoader

Expand Down Expand Up @@ -521,7 +521,7 @@ Item {

text: {
if (visible) {
return root.trackingManager?.elapsedTimeText
return root.trackingManager?.elapsedTimeText ?? ""
}
else
return ""
Expand Down
10 changes: 4 additions & 6 deletions app/qml/project/components/MMProjectWizardDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Item {
signal removeClicked()
signal attrNameChanged( string attrname )

implicitHeight: __style.row50
implicitHeight: row.implicitHeight

RowLayout {
id: row
Expand All @@ -36,18 +36,16 @@ Item {
MMInputs.MMTextInput {
id: textField

text: root.attrname

Layout.fillHeight: true
Layout.fillWidth: true

onTextEdited: (text) => root.attrNameChanged( text )
text: root.attrname

onTextChanged: () => root.attrNameChanged( text )
}

MMInputs.MMComboboxInput {
id: combobox

Layout.fillHeight: true
Layout.fillWidth: true
}

Expand Down
2 changes: 2 additions & 0 deletions app/qml/settings/components/MMSettingsInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ MMSettingsItem {
MMInputs.MMTextInput {
id: textInput

width: parent.width

title: root.title

textFieldBackground.color: __style.lightGreenColor
Expand Down
Loading