Skip to content
Snippets Groups Projects
Commit 61938fdf authored by Ludwig Jaeck's avatar Ludwig Jaeck
Browse files

[421-update-units] Remove Duplicate Menu Entries for Units (Closes #421)

Merging branch '421-update-units'  into 'main'.

See merge request !1283
parents fdb2e794 d7b7468d
No related branches found
No related tags found
1 merge request!1283Remove Duplicate Menu Entries for Units
Pipeline #86392 passed
......@@ -226,20 +226,6 @@ void ActionManager::onAboutToShowSettingsMenu()
m_settingsMenu->addSeparator();
auto* unitActions = new QActionGroup(this);
const auto addUnitAction = [=](const QString& text, bool isAngstrom) {
auto* action = m_settingsMenu->addAction(
text, [=]() { appSettings->setDefaultUnitIsAngstrom(isAngstrom); });
action->setCheckable(true);
action->setChecked(appSettings->defaultUnitIsAngstrom() == isAngstrom);
unitActions->addAction(action);
};
addUnitAction("Lengths in nanometer", false);
addUnitAction(u8"Lengths in \u00c5ngstrom", true);
m_settingsMenu->addSeparator();
// The dark style is not completed so far. See issue #220
// The light style is almost done, but with dark system theme it may lead to invisible
// text. See issue #276
......
......@@ -13,6 +13,7 @@
// ************************************************************************************************
#include "GUI/View/SampleDesigner/SampleForm.h"
#include "GUI/Application/ApplicationSettings.h"
#include "GUI/Model/Sample/SampleItem.h"
#include "GUI/Util/ActionFactory.h"
#include "GUI/View/Common/DoubleSpinBox.h"
......@@ -252,6 +253,7 @@ void SampleForm::ensureVisible(QWidget* /*w*/)
void SampleForm::setUseAngstrom(bool angstrom)
{
m_useAngstrom = angstrom;
appSettings->setDefaultUnitIsAngstrom(angstrom);
updateUnits();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment