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

rm menu entries for units

parent d3f11076
No related branches found
No related tags found
1 merge request!1283Remove Duplicate Menu Entries for Units
Pipeline #86049 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