From 5001962112c24a910af94bcd36c3b1ac8235d9f9 Mon Sep 17 00:00:00 2001 From: Luis Kao Date: Sat, 9 Apr 2022 21:55:34 +0800 Subject: [PATCH] Fix color mode actions in ViewerWidgetMode Move "options_configure_color_modes" from Okular::Part::setupActions to Okular::Part::setupViewerActions. The color mode actions were not properly set in ViewerWidgetMode. Kile would encounter "ASSERT failure" caused by the Q_ASSERT_X in ColorModeMenu class in Debug mode. --- part/part.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/part/part.cpp b/part/part.cpp index 56b8835a2..379e4c09e 100644 --- a/part/part.cpp +++ b/part/part.cpp @@ -837,6 +837,11 @@ void Part::setupViewerActions() pageno->setText(i18n("Page Number")); pageno->setDefaultWidget(m_pageNumberTool); ac->addAction(QStringLiteral("page_number"), pageno); + + QAction *configureColorModes = new QAction(i18nc("@action", "Configure Color Modes..."), ac); + ac->addAction(QStringLiteral("options_configure_color_modes"), configureColorModes); + configureColorModes->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); + connect(configureColorModes, &QAction::triggered, this, &Part::slotAccessibilityPreferences); } void Part::setViewerShortcuts() @@ -975,11 +980,6 @@ void Part::setupActions() eraseDrawingAction->setIcon(QIcon::fromTheme(QStringLiteral("draw-eraser-delete-objects"))); eraseDrawingAction->setEnabled(false); - QAction *configureColorModes = new QAction(i18nc("@action", "Configure Color Modes..."), ac); - ac->addAction(QStringLiteral("options_configure_color_modes"), configureColorModes); - configureColorModes->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); - connect(configureColorModes, &QAction::triggered, this, &Part::slotAccessibilityPreferences); - QAction *configureAnnotations = new QAction(i18n("Configure Annotations..."), ac); ac->addAction(QStringLiteral("options_configure_annotations"), configureAnnotations); configureAnnotations->setIcon(QIcon::fromTheme(QStringLiteral("configure")));