Commit c2e2c2ff authored by Nate Graham's avatar Nate Graham
Browse files

Reverse "next" and "previous" icons in RTL mode

CCBUG: 440650
parent 79c6bdcf
Pipeline #108897 failed with stage
in 5 minutes and 46 seconds
......@@ -428,14 +428,14 @@ struct MainWindow::Private {
mGoToPreviousAction = view->addAction("go_previous", q, SLOT(goToPrevious()));
mGoToPreviousAction->setPriority(QAction::LowPriority);
mGoToPreviousAction->setIcon(QIcon::fromTheme("go-previous-view"));
mGoToPreviousAction->setIcon(QIcon::fromTheme(QGuiApplication::layoutDirection() == Qt::LeftToRight ? "go-next" : "go-next-symbolic-rtl"));
mGoToPreviousAction->setText(i18nc("@action Go to previous image", "Previous"));
mGoToPreviousAction->setToolTip(i18nc("@info:tooltip", "Go to previous image"));
installDisabledActionShortcutMonitor(mGoToPreviousAction, SLOT(showFirstDocumentReached()));
mGoToNextAction = view->addAction("go_next", q, SLOT(goToNext()));
mGoToNextAction->setPriority(QAction::LowPriority);
mGoToNextAction->setIcon(QIcon::fromTheme("go-next-view"));
mGoToNextAction->setIcon(QIcon::fromTheme(QGuiApplication::layoutDirection() == Qt::LeftToRight ? "go-previous" : "go-previous-symbolic-rtl"));
mGoToNextAction->setText(i18nc("@action Go to next image", "Next"));
mGoToNextAction->setToolTip(i18nc("@info:tooltip", "Go to next image"));
installDisabledActionShortcutMonitor(mGoToNextAction, SLOT(showLastDocumentReached()));
......
......@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// Qt
#include <QDate>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QLocale>
......@@ -80,8 +81,8 @@ DateWidget::DateWidget(QWidget *parent)
d->mPreviousButton = new StatusBarToolButton;
d->mPreviousButton->setGroupPosition(StatusBarToolButton::GroupLeft);
// FIXME: RTL
d->mPreviousButton->setIcon(QIcon::fromTheme(QStringLiteral("go-previous")));
d->mPreviousButton->setIcon(
QIcon::fromTheme(QGuiApplication::layoutDirection() == Qt::LeftToRight ? QStringLiteral("go-previous") : QStringLiteral("go-previous-symbolic-rtl")));
connect(d->mPreviousButton, &StatusBarToolButton::clicked, this, &DateWidget::goToPrevious);
d->mDateButton = new StatusBarToolButton;
......@@ -90,7 +91,8 @@ DateWidget::DateWidget(QWidget *parent)
d->mNextButton = new StatusBarToolButton;
d->mNextButton->setGroupPosition(StatusBarToolButton::GroupRight);
d->mNextButton->setIcon(QIcon::fromTheme(QStringLiteral("go-next")));
d->mNextButton->setIcon(
QIcon::fromTheme(QGuiApplication::layoutDirection() == Qt::LeftToRight ? QStringLiteral("go-next") : QStringLiteral("go-next-symbolic-rtl")));
connect(d->mNextButton, &StatusBarToolButton::clicked, this, &DateWidget::goToNext);
auto *layout = new QHBoxLayout(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment