ToolbarSection::ToolbarInfo & info = LyX::ref().session().toolbars().load(tbb.name);
unsigned int flags = static_cast<unsigned int>(tbb.flags);
- // remove position
+
+ // Remove default.ui positions. Only when a valid postion is stored
+ // in the session file the default.ui value will be overwritten
+ unsigned int save = flags;
TurnOffFlag(TOP);
TurnOffFlag(BOTTOM);
TurnOffFlag(RIGHT);
else if (info.location == ToolbarSection::ToolbarInfo::LEFT)
TurnOnFlag(LEFT);
else {
- TurnOnFlag(TOP);
+ // use setting from default.ui
+ flags = save;
valid_location = false;
}
// Yes, the lyx::to_utf8(_()) is correct
if (lyx::to_utf8(_(itname)) == name) {
FuncRequest const func(LFUN_LAYOUT, itname,
- FuncRequest::UI);
+ FuncRequest::TOOLBAR);
lv.dispatch(func);
return;
}