1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Reversed some mouse-gestures for RTL environment.

This commit is contained in:
S. Razi Alavizadeh 2012-09-09 15:01:55 +04:30
parent f4f5ae7083
commit 873a801f74
2 changed files with 40 additions and 4 deletions

View File

@ -135,7 +135,12 @@ void MouseGestures::leftGestured()
return; return;
} }
m_view.data()->back(); if (QApplication::isRightToLeft()) {
m_view.data()->forward();
}
else {
m_view.data()->back();
}
} }
void MouseGestures::rightGestured() void MouseGestures::rightGestured()
@ -144,7 +149,12 @@ void MouseGestures::rightGestured()
return; return;
} }
m_view.data()->forward(); if (QApplication::isRightToLeft()) {
m_view.data()->back();
}
else {
m_view.data()->forward();
}
} }
void MouseGestures::downRightGestured() void MouseGestures::downRightGestured()
@ -181,7 +191,12 @@ void MouseGestures::upLeftGestured()
return; return;
} }
view->tabWidget()->previousTab(); if (QApplication::isRightToLeft()) {
view->tabWidget()->nextTab();
}
else {
view->tabWidget()->previousTab();
}
} }
void MouseGestures::upRightGestured() void MouseGestures::upRightGestured()
@ -191,7 +206,12 @@ void MouseGestures::upRightGestured()
return; return;
} }
view->tabWidget()->nextTab(); if (QApplication::isRightToLeft()) {
view->tabWidget()->previousTab();
}
else {
view->tabWidget()->nextTab();
}
} }
MouseGestures::~MouseGestures() MouseGestures::~MouseGestures()

View File

@ -19,11 +19,27 @@
#include "ui_mousegesturessettingsdialog.h" #include "ui_mousegesturessettingsdialog.h"
#include "licenseviewer.h" #include "licenseviewer.h"
#include <QLabel>
MouseGesturesSettingsDialog::MouseGesturesSettingsDialog(QWidget* parent) MouseGesturesSettingsDialog::MouseGesturesSettingsDialog(QWidget* parent)
: QDialog(parent) : QDialog(parent)
, ui(new Ui::MouseGesturesSettingsDialog) , ui(new Ui::MouseGesturesSettingsDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
if (QApplication::isRightToLeft()) {
ui->label_5->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/right.gif")));
ui->label_6->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/left.gif")));
ui->label_18->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/up-right.gif")));
ui->label_20->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/up-left.gif")));
}
else {
ui->label_5->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/left.gif")));
ui->label_6->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/right.gif")));
ui->label_18->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/up-left.gif")));
ui->label_20->setPixmap(QPixmap(QString::fromUtf8(":/mousegestures/data/up-right.gif")));
}
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
connect(ui->licenseButton, SIGNAL(clicked()), this, SLOT(showLicense())); connect(ui->licenseButton, SIGNAL(clicked()), this, SLOT(showLicense()));