mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Cut: Prevent the neither part kept option
This commit is contained in:
parent
3e28905621
commit
4ffe76f012
4 changed files with 34 additions and 2 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include <imgui/imgui_internal.h>
|
||||
|
||||
#include "libslic3r/libslic3r.h"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "GUI.hpp"
|
||||
|
@ -23,6 +25,7 @@ namespace GUI {
|
|||
ImGuiWrapper::ImGuiWrapper()
|
||||
: m_font_texture(0)
|
||||
, m_mouse_buttons(0)
|
||||
, m_disabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -154,6 +157,26 @@ void ImGuiWrapper::text(const wxString &label)
|
|||
ImGui::Text(label_utf8.c_str(), NULL);
|
||||
}
|
||||
|
||||
void ImGuiWrapper::disabled_begin(bool disabled)
|
||||
{
|
||||
wxCHECK_RET(!m_disabled, "ImGUI: Unbalanced disabled_begin() call");
|
||||
|
||||
if (disabled) {
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
|
||||
m_disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ImGuiWrapper::disabled_end()
|
||||
{
|
||||
if (m_disabled) {
|
||||
ImGui::PopItemFlag();
|
||||
ImGui::PopStyleVar();
|
||||
m_disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool ImGuiWrapper::want_mouse() const
|
||||
{
|
||||
return ImGui::GetIO().WantCaptureMouse;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue