mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-29 17:44:36 +08:00
DoubleSlider:Control platform dependent background color
This commit is contained in:
parent
5b7cb8f5a9
commit
2759380000
@ -400,7 +400,11 @@ void Control::draw_focus_rect()
|
|||||||
void Control::render()
|
void Control::render()
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#ifdef _WIN32
|
||||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||||
|
#else
|
||||||
|
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||||
|
#endif // _WIN32
|
||||||
#else
|
#else
|
||||||
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
SetBackgroundColour(GetParent()->GetBackgroundColour());
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
@ -570,10 +574,10 @@ void Control::draw_tick_text(wxDC& dc, const wxPoint& pos, int tick, bool right_
|
|||||||
dc.GetMultiLineTextExtent(label, &text_width, &text_height);
|
dc.GetMultiLineTextExtent(label, &text_width, &text_height);
|
||||||
wxPoint text_pos;
|
wxPoint text_pos;
|
||||||
if (right_side)
|
if (right_side)
|
||||||
text_pos = is_horizontal() ? wxPoint(pos.x + 1, pos.y + m_thumb_size.x / 4) :
|
text_pos = is_horizontal() ? wxPoint(pos.x + 1, pos.y + m_thumb_size.x / 3) :
|
||||||
wxPoint(pos.x + m_thumb_size.x + 1, pos.y - 0.5 * text_height - 1);
|
wxPoint(pos.x + m_thumb_size.x + 1, pos.y - 0.5 * text_height - 1);
|
||||||
else
|
else
|
||||||
text_pos = is_horizontal() ? wxPoint(pos.x - text_width - 1, pos.y - m_thumb_size.x / 4 - text_height) :
|
text_pos = is_horizontal() ? wxPoint(pos.x - text_width - 1, pos.y - m_thumb_size.x / 3 - text_height) :
|
||||||
wxPoint(pos.x - text_width - 1 - m_thumb_size.x, pos.y - 0.5 * text_height + 1);
|
wxPoint(pos.x - text_width - 1 - m_thumb_size.x, pos.y - 0.5 * text_height + 1);
|
||||||
dc.DrawText(label, text_pos);
|
dc.DrawText(label, text_pos);
|
||||||
}
|
}
|
||||||
@ -775,7 +779,11 @@ void Control::draw_colored_band(wxDC& dc)
|
|||||||
if (m_ticks.empty() || m_mode == t_mode::MultiExtruder)
|
if (m_ticks.empty() || m_mode == t_mode::MultiExtruder)
|
||||||
{
|
{
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
|
#ifdef _WIN32
|
||||||
draw_band(dc, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), main_band);
|
draw_band(dc, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), main_band);
|
||||||
|
#else
|
||||||
|
draw_band(dc, GetParent()->GetBackgroundColour(), main_band);
|
||||||
|
#endif // _WIN32
|
||||||
#else
|
#else
|
||||||
draw_band(dc, GetParent()->GetBackgroundColour(), main_band);
|
draw_band(dc, GetParent()->GetBackgroundColour(), main_band);
|
||||||
#endif // ENABLE_GCODE_VIEWER
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user