forked from qt-creator/qt-creator
QmlDesigner: Fix a few warnings and errors
Change-Id: Ie25fdc100a8288cd1b10ee186ab925c0ed13ee2d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
18f9a69f29
commit
d5544c7aba
@@ -80,8 +80,8 @@ T.AbstractButton {
|
||||
when: myButton.hovered && myButton.pressed
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundPressed
|
||||
border.color: StudioTheme.Values.themeInteraction
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction
|
||||
border.color: StudioTheme.Values.themeControlOutlineInteraction
|
||||
}
|
||||
},
|
||||
State {
|
||||
|
||||
@@ -145,7 +145,7 @@ Rectangle {
|
||||
target: backgroundCard
|
||||
color:StudioTheme.Values.themeInteraction
|
||||
border.width: StudioTheme.Values.border
|
||||
border.color: StudioTheme.Values.themeControlBackgroundPressed
|
||||
border.color: StudioTheme.Values.themeControlOutlineInteraction
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -52,7 +52,7 @@ Row {
|
||||
if (enumString === "")
|
||||
enumString = root.backendValue.value
|
||||
|
||||
root.origin = enumString
|
||||
root.origin = enumString === undefined ? "Center" : enumString
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ Rectangle {
|
||||
states: [
|
||||
State {
|
||||
name: "default"
|
||||
when: !mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== value
|
||||
when: !mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== root.value
|
||||
PropertyChanges {
|
||||
target: root
|
||||
color: StudioTheme.Values.themeTextColorDisabled // TODO
|
||||
@@ -56,7 +56,7 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "hover"
|
||||
when: mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== value
|
||||
when: mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== root.value
|
||||
PropertyChanges {
|
||||
target: root
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction // TODO
|
||||
@@ -64,7 +64,7 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "press"
|
||||
when: mouseArea.containsPress && myControl.origin !== enumValue
|
||||
when: mouseArea.containsPress && myControl.origin !== root.value
|
||||
PropertyChanges {
|
||||
target: root
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction // TODO
|
||||
@@ -73,7 +73,7 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "active"
|
||||
when: myControl.origin === value
|
||||
when: myControl.origin === root.value
|
||||
PropertyChanges {
|
||||
target: root
|
||||
color: StudioTheme.Values.themeInteraction
|
||||
|
||||
@@ -46,18 +46,18 @@ Item {
|
||||
implicitHeight: spinBox.height
|
||||
|
||||
onFocusChanged: {
|
||||
restoreCursor();
|
||||
transaction.end();
|
||||
restoreCursor()
|
||||
transaction.end()
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
spinBox.enabled = !isBlocked(backendValue.name);
|
||||
spinBox.enabled = backendValue === undefined ? false : !isBlocked(backendValue.name)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: modelNodeBackend
|
||||
function onSelectionChanged() {
|
||||
spinBox.enabled = !isBlocked(backendValue.name);
|
||||
spinBox.enabled = backendValue === undefined ? false : !isBlocked(backendValue.name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,25 +65,25 @@ Item {
|
||||
id: spinBox
|
||||
|
||||
onDragStarted: {
|
||||
hideCursor();
|
||||
transaction.start();
|
||||
hideCursor()
|
||||
transaction.start()
|
||||
}
|
||||
|
||||
onDragEnded: {
|
||||
restoreCursor();
|
||||
transaction.end();
|
||||
restoreCursor()
|
||||
transaction.end()
|
||||
}
|
||||
|
||||
onDragging: holdCursorInPlace();
|
||||
onDragging: holdCursorInPlace()
|
||||
|
||||
onRealValueModified: {
|
||||
if (transaction.active())
|
||||
commitValue();
|
||||
commitValue()
|
||||
}
|
||||
|
||||
function commitValue() {
|
||||
if (spinBox.backendValue.value !== spinBox.realValue)
|
||||
spinBox.backendValue.value = spinBox.realValue;
|
||||
spinBox.backendValue.value = spinBox.realValue
|
||||
}
|
||||
|
||||
property variant backendValue
|
||||
|
||||
Reference in New Issue
Block a user