mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-25 01:40:57 +00:00
Fixes issue with showing hidden settings in speed dial.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "OptionsGroup.hpp"
|
||||
#include "ConfigExceptions.hpp"
|
||||
#include "Plater.hpp"
|
||||
#include "SettingsIndex.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
#include "OG_CustomCtrl.hpp"
|
||||
@@ -244,11 +245,24 @@ void OptionsGroup::append_line(const Line& line)
|
||||
{
|
||||
m_lines.emplace_back(line);
|
||||
|
||||
// Record each option's wiki path (Line::label_path) so the Speed Dial can offer an "open wiki"
|
||||
// affordance for it. Settings tabs only; the searcher already exists by the time tabs are built.
|
||||
if (m_use_custom_ctrl && !line.label_path.empty())
|
||||
for (const auto& opt : line.get_options())
|
||||
wxGetApp().sidebar().settings_index().set_path(opt.opt_id, static_cast<Preset::Type>(config_type()), line.label_path);
|
||||
// Feed the searcher the row's wiki path (Line::label_path, for the Speed Dial's "open wiki"
|
||||
// affordance) and the label the row actually draws, so a setting action is named like the page.
|
||||
if (m_use_custom_ctrl) {
|
||||
Search::SettingsIndex& index = wxGetApp().sidebar().settings_index();
|
||||
const Preset::Type type = static_cast<Preset::Type>(config_type());
|
||||
const bool multi = line.get_options().size() > 1;
|
||||
for (const auto& opt : line.get_options()) {
|
||||
if (!line.label_path.empty())
|
||||
index.set_path(opt.opt_id, type, line.label_path);
|
||||
// Mirror the sub-label OG_CustomCtrl draws for a multi-option row, so the palette
|
||||
// names each field like the page does.
|
||||
const std::string& leaf_src = opt.opt.label;
|
||||
const wxString leaf = (leaf_src == L_CONTEXT("Top", "Layers") || leaf_src == L_CONTEXT("Bottom", "Layers")) ?
|
||||
_L_CONTEXT(leaf_src, "Layers") :
|
||||
_(leaf_src);
|
||||
index.set_line_label(opt.opt_id, type, Search::compose_display_label(line.label, leaf, multi));
|
||||
}
|
||||
}
|
||||
|
||||
if (line.full_width && (line.widget != nullptr || !line.get_extra_widgets().empty()))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user