mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-08 08:11:14 +00:00
Keep the Design tab's status line clear of the view buttons at any display scale
The line started at a fixed inset scaled like the ImGui style, while the navigator and the round canvas buttons scale with the monitor's DPI on Windows, so at 150% the buttons covered its first words. It now starts past the edge the canvas reports for that corner.
This commit is contained in:
@@ -1183,9 +1183,6 @@ void DesignCanvas::set_readout(const std::string& text)
|
||||
if (m_canvas) m_canvas->set_as_dirty(); // drawn by the next frame (the tool feeds this from one)
|
||||
}
|
||||
|
||||
// Clear of the view cube and the two round view buttons, which own the bottom-left corner.
|
||||
static constexpr float kStatusHudLeftInset = 190.f;
|
||||
|
||||
void DesignCanvas::set_status_text(const wxString& text, const wxColour& colour)
|
||||
{
|
||||
if (text == m_status_hud_last && colour == m_status_hud_colour) return;
|
||||
@@ -1220,8 +1217,11 @@ void DesignCanvas::render_hud()
|
||||
ImGuiWrapper::pop_common_window_style();
|
||||
};
|
||||
if (!m_status_hud_last.IsEmpty()) {
|
||||
// Past the view cube and the round view buttons, which own the bottom-left corner. Asked
|
||||
// of the canvas, which lays them out: they follow the monitor's DPI on Windows, where `em`
|
||||
// does not, so a fixed inset in `em` let them cover the start of the line at 150%.
|
||||
// A sentence can be a sentence: it wraps to the room left of the readout chip.
|
||||
const float left = kStatusHudLeftInset * em;
|
||||
const float left = m_canvas->get_canvas_toolbar_right() + margin;
|
||||
const ImVec4 col = m_status_hud_colour.IsOk()
|
||||
? ImVec4(m_status_hud_colour.Red() / 255.f, m_status_hud_colour.Green() / 255.f,
|
||||
m_status_hud_colour.Blue() / 255.f, 1.f)
|
||||
|
||||
Reference in New Issue
Block a user