Skip to content

Commit 2d7adda

Browse files
committed
Unified formatting
1 parent e049653 commit 2d7adda

File tree

1 file changed

+76
-76
lines changed

1 file changed

+76
-76
lines changed

qml/pages/VocabularyListItem.qml

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -19,90 +19,90 @@ import Sailfish.Silica 1.0
1919
import harbour.vocabulary.SettingsProxy 1.0
2020

2121
ListItem {
22-
id: vocabularyListItem
23-
width: parent.width
24-
25-
SettingsProxy {
26-
id: settings
27-
}
28-
29-
Rectangle {
30-
anchors {
31-
bottom: parent.bottom
32-
left: parent.left
33-
}
22+
id: vocabularyListItem
23+
width: parent.width
3424

35-
height: parent.height * 0.2
36-
width: parent.width * priority / 100
25+
SettingsProxy {
26+
id: settings
27+
}
3728

38-
color: Theme.secondaryHighlightColor
39-
visible: (priority > 1) && settings.adaptiveTrainingEnabled
40-
opacity: .5
41-
}
29+
Rectangle {
30+
anchors {
31+
bottom: parent.bottom
32+
left: parent.left
33+
}
4234

43-
Row {
44-
width: parent.width - 2*Theme.paddingLarge
45-
anchors.centerIn: parent
35+
height: parent.height * 0.2
36+
width: parent.width * priority / 100
4637

47-
anchors {
48-
left: parent.left
49-
right: parent.right
50-
margins: Theme.paddingLarge
51-
}
38+
color: Theme.secondaryHighlightColor
39+
visible: (priority > 1) && settings.adaptiveTrainingEnabled
40+
opacity: .5
41+
}
5242

53-
Label {
54-
id: word_label
55-
text: word
56-
color: Theme.primaryColor
57-
}
58-
Label {
59-
text: " "
60-
color: Theme.primaryColor
61-
}
62-
Label {
63-
width: parent.width - word_label.width
64-
text: translation
65-
color: Theme.secondaryColor
66-
horizontalAlignment: Text.AlignLeft
67-
truncationMode: TruncationMode.Elide
68-
}
69-
}
43+
Row {
44+
width: parent.width - 2*Theme.paddingLarge
45+
anchors.centerIn: parent
7046

71-
menu: ContextMenu {
72-
MenuItem {
73-
text: "<img src=\"image://theme/icon-s-edit\" align=\"middle\" /> " + qsTr("Edit vocabulary")
74-
textFormat: Text.StyledText
75-
onClicked: {
76-
pageStack.push(Qt.resolvedUrl("Edit.qml"), { word_id: id } )
77-
}
78-
}
47+
anchors {
48+
left: parent.left
49+
right: parent.right
50+
margins: Theme.paddingLarge
51+
}
7952

80-
MenuItem {
81-
text: "<img src=\"image://theme/icon-m-delete\" width=\"" + Theme.iconSizeSmall + "\" height=\"" + Theme.iconSizeSmall + "\" align=\"middle\" >" + qsTr("Remove vocabulary")
82-
textFormat: Text.StyledText
83-
onClicked: {
84-
vocabularyListItem.remorseAction(qsTr("Remove vocabulary"), function() { functions.remove_word(id, vocabularyListItem) })
85-
}
86-
}
53+
Label {
54+
id: word_label
55+
text: word
56+
color: Theme.primaryColor
57+
}
58+
Label {
59+
text: " "
60+
color: Theme.primaryColor
61+
}
62+
Label {
63+
width: parent.width - word_label.width
64+
text: translation
65+
color: Theme.secondaryColor
66+
horizontalAlignment: Text.AlignLeft
67+
truncationMode: TruncationMode.Elide
68+
}
69+
}
8770

88-
MenuItem {
89-
text: "<img src=\"image://theme/icon-s-clipboard\" align=\"middle\" /> "+ qsTr("Copy word to clipboard")
90-
textFormat: Text.StyledText
91-
onClicked: {
92-
Clipboard.text = word
93-
}
94-
}
71+
menu: ContextMenu {
72+
MenuItem {
73+
text: "<img src=\"image://theme/icon-s-edit\" align=\"middle\" /> " + qsTr("Edit vocabulary")
74+
textFormat: Text.StyledText
75+
onClicked: {
76+
pageStack.push(Qt.resolvedUrl("Edit.qml"), { word_id: id } )
77+
}
78+
}
9579

96-
MenuItem {
97-
text: "<img src=\"image://theme/icon-s-clipboard\" align=\"middle\" /> " + qsTr("Copy translation to clipboard")
98-
textFormat: Text.StyledText
99-
onClicked: {
100-
Clipboard.text = translation
101-
}
102-
}
103-
}
80+
MenuItem {
81+
text: "<img src=\"image://theme/icon-m-delete\" width=\"" + Theme.iconSizeSmall + "\" height=\"" + Theme.iconSizeSmall + "\" align=\"middle\" >" + qsTr("Remove vocabulary")
82+
textFormat: Text.StyledText
83+
onClicked: {
84+
vocabularyListItem.remorseAction(qsTr("Remove vocabulary"), function() { functions.remove_word(id, vocabularyListItem) })
85+
}
86+
}
10487

105-
onClicked: {
106-
pageStack.push(Qt.resolvedUrl("Details.qml"), { word_id: id })
107-
}
88+
MenuItem {
89+
text: "<img src=\"image://theme/icon-s-clipboard\" align=\"middle\" /> "+ qsTr("Copy word to clipboard")
90+
textFormat: Text.StyledText
91+
onClicked: {
92+
Clipboard.text = word
93+
}
94+
}
95+
96+
MenuItem {
97+
text: "<img src=\"image://theme/icon-s-clipboard\" align=\"middle\" /> " + qsTr("Copy translation to clipboard")
98+
textFormat: Text.StyledText
99+
onClicked: {
100+
Clipboard.text = translation
101+
}
102+
}
103+
}
104+
105+
onClicked: {
106+
pageStack.push(Qt.resolvedUrl("Details.qml"), { word_id: id })
107+
}
108108
}

0 commit comments

Comments
 (0)