Commit 54dd173c authored by Simone Gaiarin's avatar Simone Gaiarin
Browse files

Use combobox to select default annotation toolbar style

parent 8ca2498d
......@@ -11,7 +11,7 @@
<signal name="colorModesChanged2" >
<label>Same as colorModesChanged(), but kconfig_compiler does not allow to inherit signals, so appending a '2'.</label>
</signal>
<signal name="legacyAnnotationToolBarChanged" />
<signal name="defaultAnnotationToolBarChanged" />
<group name="Dlg Performance" >
<entry key="EnableCompositing" type="Bool" >
<default>true</default>
......@@ -322,9 +322,13 @@
<default>true</default>
<emit signal="viewContinuousChanged" />
</entry>
<entry key="LegacyAnnotationToolBar" type="Bool" >
<default>false</default>
<emit signal="legacyAnnotationToolBarChanged" />
<entry key="DefaultAnnotationToolBar" type="Enum" >
<default>AnnotationToolBar</default>
<choices>
<choice name="AnnotationToolBar" />
<choice name="QuickAnnotationToolBar" />
</choices>
<emit signal="defaultAnnotationToolBarChanged" />
</entry>
<entry key="ViewMode" type="Enum" >
<default>Single</default>
......
......@@ -769,7 +769,7 @@ AnnotationActionHandler::AnnotationActionHandler(PageViewAnnotator *parent, KAct
ac->setDefaultShortcut(d->aAddToQuickTools, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
d->updateConfigActions();
connect(Okular::Settings::self(), &Okular::Settings::legacyAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction);
connect(Okular::Settings::self(), &Okular::Settings::defaultAnnotationToolBarChanged, this, &AnnotationActionHandler::setupAnnotationToolBarVisibilityAction);
}
AnnotationActionHandler::~AnnotationActionHandler()
......@@ -798,7 +798,7 @@ void AnnotationActionHandler::setupAnnotationToolBarVisibilityAction()
connect(d->aHideToolBar, &QAction::triggered, annotationToolBar, &KToolBar::hide, Qt::UniqueConnection);
KToolBar *defaultAnnotationToolBar = annotationToolBar;
if (Okular::Settings::legacyAnnotationToolBar()) {
if (Okular::Settings::defaultAnnotationToolBar() == Okular::Settings::EnumDefaultAnnotationToolBar::QuickAnnotationToolBar) {
defaultAnnotationToolBar = mw->toolBar(QStringLiteral("quickAnnotationToolBar"));
}
d->aToolBarVisibility->setChecked(false);
......
......@@ -91,6 +91,15 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode)
useCustomColor->setChecked(false);
customColor->setEnabled(false);
connect(useCustomColor, &QCheckBox::toggled, customColor, &QWidget::setEnabled);
if (embedMode != Okular::ViewerWidgetMode) {
// Combobox: default annotation toolbar associated to annotation action in tool menu
QComboBox *defaultAnnotationToolBar = new QComboBox(this);
defaultAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Annotation Toobar"));
defaultAnnotationToolBar->addItem(i18nc("item:inlistbox Config dialog, general page", "Quick Annotation Toolbar"));
defaultAnnotationToolBar->setObjectName(QStringLiteral("kcfg_DefaultAnnotationToolBar"));
layout->addRow(i18nc("label:listbox Config dialog, general page", "Default annotation toolbar:"), defaultAnnotationToolBar);
}
// END Appearance section
layout->addRow(new QLabel(this));
......@@ -165,11 +174,6 @@ DlgGeneral::DlgGeneral(QWidget *parent, Okular::EmbedMode embedMode)
openInContinuousModeByDefault->setText(i18nc("@option:check Config dialog, general page", "Open in continuous mode by default"));
openInContinuousModeByDefault->setObjectName(QStringLiteral("kcfg_ViewContinuous"));
layout->addRow(programFeaturesLabel(), openInContinuousModeByDefault);
QCheckBox *useLegacyAnnotationToolBar = new QCheckBox(this);
useLegacyAnnotationToolBar->setText(i18nc("@option:check Config dialog, general page", "Use legacy annotation toolbar"));
useLegacyAnnotationToolBar->setObjectName(QStringLiteral("kcfg_LegacyAnnotationToolBar"));
layout->addRow(programFeaturesLabel(), useLegacyAnnotationToolBar);
// END Program features section
// If no Program features section, don’t add a second spacer:
......
Supports Markdown
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