Merge branch 'master' of https://github.com/prusa3d/Slic3r into svg_icons
This commit is contained in:
commit
5ddf45806b
6 changed files with 39 additions and 6 deletions
|
@ -896,7 +896,11 @@ void GLCanvas3D::Selection::add(unsigned int volume_idx, bool as_single_selectio
|
|||
if (needs_reset)
|
||||
clear();
|
||||
|
||||
m_mode = volume->is_modifier ? Volume : Instance;
|
||||
if (volume->is_modifier)
|
||||
m_mode = Volume;
|
||||
else if (!contains_volume(volume_idx))
|
||||
m_mode = Instance;
|
||||
// else -> keep current mode
|
||||
|
||||
switch (m_mode)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define slic3r_GUI_ObjectSettings_hpp_
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <wx/panel.h>
|
||||
|
||||
class wxBoxSizer;
|
||||
|
|
|
@ -239,10 +239,19 @@ bool ImGuiWrapper::checkbox(const wxString &label, bool &value)
|
|||
return ImGui::Checkbox(label_utf8.c_str(), &value);
|
||||
}
|
||||
|
||||
void ImGuiWrapper::text(const char *label)
|
||||
{
|
||||
ImGui::Text(label, NULL);
|
||||
}
|
||||
|
||||
void ImGuiWrapper::text(const std::string &label)
|
||||
{
|
||||
this->text(label.c_str());
|
||||
}
|
||||
|
||||
void ImGuiWrapper::text(const wxString &label)
|
||||
{
|
||||
auto label_utf8 = into_u8(label);
|
||||
ImGui::Text(label_utf8.c_str(), NULL);
|
||||
this->text(into_u8(label).c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -267,6 +276,24 @@ bool ImGuiWrapper::combo(const wxString& label, const std::vector<wxString>& opt
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ImGuiWrapper::combo(const wxString& label, const std::vector<std::string>& options, std::string& selection)
|
||||
{
|
||||
// this is to force the label to the left of the widget:
|
||||
text(label);
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::BeginCombo("", selection.c_str())) {
|
||||
for (const std::string& option : options) {
|
||||
bool is_selected = (selection.empty()) ? false : (option == selection);
|
||||
if (ImGui::Selectable(option.c_str(), is_selected))
|
||||
selection = option;
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ImGuiWrapper::disabled_begin(bool disabled)
|
||||
{
|
||||
wxCHECK_RET(!m_disabled, "ImGUI: Unbalanced disabled_begin() call");
|
||||
|
|
|
@ -57,7 +57,10 @@ public:
|
|||
bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f");
|
||||
bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f");
|
||||
bool checkbox(const wxString &label, bool &value);
|
||||
void text(const char *label);
|
||||
void text(const std::string &label);
|
||||
void text(const wxString &label);
|
||||
bool combo(const wxString& label, const std::vector<std::string>& options, std::string& current_selection);
|
||||
bool combo(const wxString& label, const std::vector<wxString>& options, wxString& current_selection);
|
||||
|
||||
void disabled_begin(bool disabled);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <wx/wx.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
|
|
@ -2001,9 +2001,6 @@ void Plater::priv::schedule_background_process()
|
|||
this->background_process_timer.Start(500, wxTIMER_ONE_SHOT);
|
||||
// Notify the Canvas3D that something has changed, so it may invalidate some of the layer editing stuff.
|
||||
this->view3D->get_canvas3d()->set_config(this->config);
|
||||
// Reset gcode preview
|
||||
this->preview->get_canvas3d()->reset_volumes();
|
||||
this->preview->get_canvas3d()->reset_legend_texture();
|
||||
}
|
||||
|
||||
void Plater::priv::update_print_volume_state()
|
||||
|
|
Loading…
Reference in a new issue