Skip to content

Commit

Permalink
Fix video actions when swipe is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
walokra committed Nov 15, 2021
1 parent 31b071a commit a9700df
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ int main(int argc, char *argv[])

SimpleCrypt *crypto = new SimpleCrypt();
crypto->setKey(0xd2fa13b37d936b07);
//QString secret = crypto->encryptToString(QString(""));
//qDebug() << "secret:" << secret;
QString client_secret = crypto->decryptToString(QString(CLIENT_SECRET));

QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
Expand Down
3 changes: 0 additions & 3 deletions qml/pages/ImageComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Component {
height: Math.max(image.height, 3 * loadingImageIndicator.height);
width: Screen.width;

property int start_x;
property int start_y;

AnimatedImage {
id: image;

Expand Down
52 changes: 25 additions & 27 deletions qml/pages/VideoComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,37 +81,35 @@ Component {
internal.clickPlay();
}

MouseArea {
property int start_x;
property int start_y;
property int start_x;
property int start_y;

anchors.fill: parent;
anchors.fill: parent;

onPressAndHold: {
video.height = (video.height < drawerContextMenu.height) ? drawerContextMenu.height : video.height;
drawer.open = true;
}
onPressAndHold: {
video.height = (video.height < drawerContextMenu.height) ? drawerContextMenu.height : video.height;
drawer.open = true;
}

onPressed: {
start_x = mouseX;
start_y = mouseY;
}
onPressed: {
start_x = mouseX;
start_y = mouseY;
}

onPositionChanged: {
var x_diff = mouseX - start_x;
var y_diff = mouseY - start_y;

var abs_x_diff = Math.abs(x_diff);
var abs_y_diff = Math.abs(y_diff);

onPositionChanged: {
var x_diff = mouseX - start_x;
var y_diff = mouseY - start_y;

var abs_x_diff = Math.abs(x_diff);
var abs_y_diff = Math.abs(y_diff);

if (abs_x_diff != abs_y_diff) {
if (abs_x_diff > abs_y_diff) {
if (abs_x_diff > 50) {
if (x_diff > 0) {
if (prevEnabled) { galleryNavigation.previous(); }
} else if (x_diff < 0) {
galleryNavigation.next();
}
if (abs_x_diff != abs_y_diff) {
if (abs_x_diff > abs_y_diff) {
if (abs_x_diff > 50) {
if (x_diff > 0) {
if (prevEnabled) { galleryNavigation.previous(); }
} else if (x_diff < 0) {
galleryNavigation.next();
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions rpm/harbour-sailimgur.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon Nov 15 2021 Marko Wallin <[email protected]> 0.11.1-1
Fix video actions.

* Mon Nov 15 2021 Marko Wallin <[email protected]> 0.11.0-1
Fix animations (videos, gifs) behaviour, #28.
Fix back button, #29.
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-sailimgur.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name: harbour-sailimgur
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Sailimgur is an Imgur app for Sailfish OS, powered by Qt and QML
Version: 0.11.0
Version: 0.11.1
Release: 1
Group: Applications/Internet
License: GPLv3
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-sailimgur.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-sailimgur
Summary: Sailimgur is an Imgur app for Sailfish OS, powered by Qt and QML
Version: 0.11.0
Version: 0.11.1
Release: 1
Group: Applications/Internet
URL: http://ruleoftech.com/lab/sailimgur
Expand Down

0 comments on commit a9700df

Please sign in to comment.