Skip to content

Commit 77200c9

Browse files
Allow copying recognition result, remorseaction on delete
1 parent 6fe6231 commit 77200c9

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

qml/pages/FirstPage.qml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ Page {
147147
onHeightChanged: listView.positionViewAtBeginning()
148148
}
149149

150-
BackgroundItem {
150+
ListItem {
151+
id: recognitionListItem
151152
contentHeight: resultColumn.height
152153
opacity: py.trackFound ? 1 : 0
153154
height: py.trackFound ? implicitHeight : 0
154155
Behavior on opacity { FadeAnimation {} }
155-
Behavior on height { NumberAnimation { duration: 200 } }
156+
Behavior on height {
157+
enabled: !(recognitionListItem.highlighted || recognitionListItem.down || recognitionListItem.menuOpen)
158+
NumberAnimation { duration: 200 }
159+
}
156160
onHeightChanged: listView.positionViewAtBeginning()
157161

158162
Column {
@@ -173,6 +177,13 @@ Page {
173177
}
174178

175179
onClicked: pageStack.push(Qt.resolvedUrl('SongPage.qml'), { title: py.title, subtitle: py.subtitle, sections: py.sections })
180+
181+
menu: Component { ContextMenu {
182+
MenuItem {
183+
text: qsTranslate("General", "Copy")
184+
onClicked: Clipboard.text = qsTranslate("General", "%1 by %2").arg(py.title).arg(py.subtitle)
185+
}
186+
} }
176187
}
177188

178189
SectionHeader {
@@ -228,13 +239,16 @@ Page {
228239

229240
onClicked: pageStack.push(Qt.resolvedUrl('SongPage.qml'), { title: title, subtitle: subtitle, sections: sections })
230241

242+
function remove() {
243+
remorseAction(qsTr("Deleted"), function (){
244+
py.call('main.remove_from_history', [arrIndex, listView.model.count])
245+
listView.model.loadHistory()
246+
})
247+
}
231248
menu: Component { ContextMenu {
232249
MenuItem {
233250
text: qsTr("Remove")
234-
onClicked: {
235-
py.call('main.remove_from_history', [arrIndex, listView.model.count])
236-
listView.model.loadHistory()
237-
}
251+
onClicked: remove()
238252
}
239253
MenuItem {
240254
text: qsTranslate("General", "Copy")

rpm/harbour-sshazam.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Requires: pyotherside-qml-plugin-python3-qt5
2222
BuildRequires: python3-base
2323
BuildRequires: python3-devel
2424
BuildRequires: python3-pip
25-
#BuildRequires: git
25+
BuildRequires: git
2626
%endif
2727

2828
%define __provides_exclude_from ^%{_datadir}/.*$

0 commit comments

Comments
 (0)