Skip to content

Commit 32a7607

Browse files
committed
fix: apply Spiros132 review
1 parent 50d8301 commit 32a7607

4 files changed

Lines changed: 127 additions & 155 deletions

File tree

screen-toolkit/Annotate.qml

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Variants {
485485
height: overlayWin.currentStroke ? Math.abs(overlayWin.currentStroke.y2 - overlayWin.currentStroke.y1) : 0
486486
color: "transparent"
487487
border.color: "#ffffff"
488-
border.width: 1.5
488+
border.width: Style.borderM
489489
opacity: 0.8
490490
}
491491
Rectangle {
@@ -791,11 +791,11 @@ Variants {
791791
radius: Style.radiusL
792792
color: Color.mSurface
793793
border.color: Style.capsuleBorderColor || "transparent"
794-
border.width: Style.capsuleBorderWidth || 1
794+
border.width: Style.capsuleBorderWidth || Style.borderS
795795
component ToolbarSeparator: Rectangle {
796796
readonly property bool vertical: toolbar.useVertical
797-
width: vertical ? 28 : 1
798-
height: vertical ? 1 : 28
797+
width: vertical ? 28 : Style.borderS
798+
height: vertical ? Style.borderS : 28
799799
color: Color.mOnSurfaceVariant
800800
opacity: 0.3
801801
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
@@ -921,7 +921,13 @@ Variants {
921921
visible: !parent.isVertical
922922
Repeater {
923923
model: 3
924-
Rectangle { width: 14; height: 2; radius: 1; color: Color.mOnSurfaceVariant; opacity: 0.6 }
924+
Rectangle {
925+
width: Style.marginL
926+
height: Style.marginXXS
927+
radius: Style.radiusXXXS
928+
color: Color.mOnSurfaceVariant
929+
opacity: 0.6
930+
}
925931
}
926932
}
927933
Row {
@@ -930,7 +936,13 @@ Variants {
930936
visible: parent.isVertical
931937
Repeater {
932938
model: 3
933-
Rectangle { width: 2; height: 14; radius: 1; color: Color.mOnSurfaceVariant; opacity: 0.6 }
939+
Rectangle {
940+
width: Style.marginXXS
941+
height: Style.marginL
942+
radius: Style.radiusXXXS
943+
color: Color.mOnSurfaceVariant
944+
opacity: 0.6
945+
}
934946
}
935947
}
936948
MouseArea {
@@ -970,9 +982,9 @@ Variants {
970982
"#44AAFF", "#CC44FF", "#FF44CC", "#FFFFFF", "#000000"
971983
]
972984
readonly property var sizeDefs: [
973-
{ size: 2, label: root.mainInstance?.pluginApi?.tr("annotate.sizeS") ?? "S" },
974-
{ size: 4, label: root.mainInstance?.pluginApi?.tr("annotate.sizeM") ?? "M" },
975-
{ size: 7, label: root.mainInstance?.pluginApi?.tr("annotate.sizeL") ?? "L" }
985+
{ size: 2, label: root.mainInstance?.pluginApi?.tr("annotate.sizeS") },
986+
{ size: 4, label: root.mainInstance?.pluginApi?.tr("annotate.sizeM") },
987+
{ size: 7, label: root.mainInstance?.pluginApi?.tr("annotate.sizeL") }
976988
]
977989
function doUndo() {
978990
if (overlayWin.strokes.length > 0) {
@@ -1032,7 +1044,7 @@ Variants {
10321044
anchors.verticalCenter: parent.verticalCenter
10331045
color: overlayWin.drawColor
10341046
border.color: overlayWin.showPopover ? Color.mPrimary : Qt.rgba(0, 0, 0, 0.2)
1035-
border.width: overlayWin.showPopover ? 2 : 1
1047+
border.width: overlayWin.showPopover ? Style.borderM : Style.borderS
10361048
scale: colorBtnH.containsMouse ? 1.1 : 1
10371049
Behavior on scale { NumberAnimation { duration: 80 } }
10381050
MouseArea {
@@ -1050,15 +1062,19 @@ Variants {
10501062
ActionBtn { iconName: "trash"; tip: "Clear all"; danger: true; onClicked: toolbar.doClear() }
10511063
SaveBtn {
10521064
iconName: "copy"
1053-
labelText: overlayWin.isSaving ? "Copying..." : "Copy"
1054-
tip: "Copy to clipboard"
1065+
labelText: overlayWin.isSaving
1066+
? root.mainInstance?.pluginApi?.tr("annotate.copying")
1067+
: root.mainInstance?.pluginApi?.tr("annotate.copy")
1068+
tip: root.mainInstance?.pluginApi?.tr("annotate.copyTip")
10551069
primary: true
10561070
onClicked: overlayWin.flattenAndCopy()
10571071
}
10581072
SaveBtn {
10591073
iconName: "device-floppy"
1060-
labelText: overlayWin.isSaving ? "Saving..." : "Save"
1061-
tip: "Save to disk"
1074+
labelText: overlayWin.isSaving
1075+
? root.mainInstance?.pluginApi?.tr("annotate.saving")
1076+
: root.mainInstance?.pluginApi?.tr("annotate.save")
1077+
tip: root.mainInstance?.pluginApi?.tr("annotate.saveTip")
10621078
primary: false
10631079
onClicked: overlayWin.flattenAndSave()
10641080
}
@@ -1101,7 +1117,7 @@ Variants {
11011117
anchors.horizontalCenter: parent.horizontalCenter
11021118
color: overlayWin.drawColor
11031119
border.color: overlayWin.showPopover ? Color.mPrimary : Qt.rgba(0, 0, 0, 0.2)
1104-
border.width: overlayWin.showPopover ? 2 : 1
1120+
border.width: overlayWin.showPopover ? Style.borderM : Style.borderS
11051121
scale: colorBtnV.containsMouse ? 1.1 : 1
11061122
Behavior on scale { NumberAnimation { duration: 80 } }
11071123
MouseArea {
@@ -1117,8 +1133,8 @@ Variants {
11171133
ToolbarSeparator {}
11181134
ActionBtn { iconName: "corner-up-left"; tip: "Undo last stroke"; onClicked: toolbar.doUndo() }
11191135
ActionBtn { iconName: "trash"; tip: "Clear all"; danger: true; onClicked: toolbar.doClear() }
1120-
ActionBtn { iconName: "copy"; tip: "Copy to clipboard"; onClicked: overlayWin.flattenAndCopy() }
1121-
ActionBtn { iconName: "device-floppy"; tip: "Save to disk"; onClicked: overlayWin.flattenAndSave() }
1136+
ActionBtn { iconName: "copy"; tip: root.mainInstance?.pluginApi?.tr("annotate.copyTip"); onClicked: overlayWin.flattenAndCopy() }
1137+
ActionBtn { iconName: "device-floppy"; tip: root.mainInstance?.pluginApi?.tr("annotate.saveTip"); onClicked: overlayWin.flattenAndSave() }
11221138
ActionBtn { iconName: "x"; tip: "Close"; onClicked: toolbar.doClose() }
11231139
ToolbarSeparator {}
11241140
DragBtn { isVertical: true; anchors.horizontalCenter: parent.horizontalCenter }
@@ -1131,7 +1147,7 @@ Variants {
11311147
radius: Style.radiusL
11321148
color: Color.mSurface
11331149
border.color: Style.capsuleBorderColor || "transparent"
1134-
border.width: Style.capsuleBorderWidth || 1
1150+
border.width: Style.capsuleBorderWidth || Style.borderS
11351151
width: toolbar.useVertical ? (popContent.implicitWidth + Style.marginS) : (popContent.implicitWidth + Style.marginM)
11361152
height: toolbar.useVertical ? (popContent.implicitHeight + Style.marginM) : (popContent.implicitHeight + Style.marginS)
11371153
x: toolbar.useVertical
@@ -1154,7 +1170,7 @@ Variants {
11541170
delegate: Rectangle {
11551171
width: 20; height: 20; radius: 10; color: modelData
11561172
border.color: overlayWin.drawColor === modelData ? Color.mPrimary : Qt.rgba(0, 0, 0, 0.15)
1157-
border.width: overlayWin.drawColor === modelData ? 2 : 1
1173+
border.width: overlayWin.drawColor === modelData ? Style.borderM : Style.borderS
11581174
scale: chH.containsMouse ? 1.2 : 1
11591175
Behavior on scale { NumberAnimation { duration: 80 } }
11601176
MouseArea {
@@ -1164,14 +1180,18 @@ Variants {
11641180
}
11651181
}
11661182
}
1167-
Rectangle { width: 1; height: 16; color: Color.mOnSurfaceVariant; opacity: 0.3; anchors.verticalCenter: parent.verticalCenter }
1183+
Rectangle {
1184+
width: Style.borderS; height: 16
1185+
color: Color.mOnSurfaceVariant; opacity: 0.3
1186+
anchors.verticalCenter: parent.verticalCenter
1187+
}
11681188
Repeater {
11691189
model: toolbar.sizeDefs
11701190
delegate: Rectangle {
11711191
width: 28; height: 24; radius: Style.radiusS
11721192
color: overlayWin.drawSize === modelData.size ? Color.mPrimaryContainer || Color.mSurfaceVariant : (shH.containsMouse ? Color.mHover : "transparent")
11731193
border.color: overlayWin.drawSize === modelData.size ? Color.mPrimary : "transparent"
1174-
border.width: 1
1194+
border.width: Style.borderS
11751195
Row {
11761196
anchors.centerIn: parent; spacing: Style.marginXS
11771197
Rectangle { width: modelData.size * 2; height: modelData.size * 2; radius: modelData.size; color: overlayWin.drawColor; anchors.verticalCenter: parent.verticalCenter }
@@ -1195,7 +1215,7 @@ Variants {
11951215
delegate: Rectangle {
11961216
width: 20; height: 20; radius: 10; color: modelData
11971217
border.color: overlayWin.drawColor === modelData ? Color.mPrimary : Qt.rgba(0, 0, 0, 0.15)
1198-
border.width: overlayWin.drawColor === modelData ? 2 : 1
1218+
border.width: overlayWin.drawColor === modelData ? Style.borderM : Style.borderS
11991219
scale: chV.containsMouse ? 1.2 : 1
12001220
Behavior on scale { NumberAnimation { duration: 80 } }
12011221
MouseArea {
@@ -1205,14 +1225,18 @@ Variants {
12051225
}
12061226
}
12071227
}
1208-
Rectangle { width: 16; height: 1; color: Color.mOnSurfaceVariant; opacity: 0.3; anchors.horizontalCenter: parent.horizontalCenter }
1228+
Rectangle {
1229+
width: 16; height: Style.borderS
1230+
color: Color.mOnSurfaceVariant; opacity: 0.3
1231+
anchors.horizontalCenter: parent.horizontalCenter
1232+
}
12091233
Repeater {
12101234
model: toolbar.sizeDefs
12111235
delegate: Rectangle {
12121236
width: 32; height: 24; radius: Style.radiusS
12131237
color: overlayWin.drawSize === modelData.size ? Color.mPrimaryContainer || Color.mSurfaceVariant : (shV.containsMouse ? Color.mHover : "transparent")
12141238
border.color: overlayWin.drawSize === modelData.size ? Color.mPrimary : "transparent"
1215-
border.width: 1
1239+
border.width: Style.borderS
12161240
Row {
12171241
anchors.centerIn: parent; spacing: Style.marginXS
12181242
Rectangle { width: modelData.size * 2; height: modelData.size * 2; radius: modelData.size; color: overlayWin.drawColor; anchors.verticalCenter: parent.verticalCenter }
@@ -1304,3 +1328,4 @@ Variants {
13041328
}
13051329
}
13061330
}
1331+

0 commit comments

Comments
 (0)