Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2021-09-10 09:01:45 +0300
committerYuSanka <yusanka@gmail.com>2021-09-10 09:02:04 +0300
commitff82c82f5224fb68e94a8903468162e0ff8160c4 (patch)
tree89044176a0a5e98c1bafbc2c9433b6e283aa47c4 /src/slic3r
parent0abab45efa6f67179ec86c6eceb3ea597ffb3579 (diff)
MSW-specific: Application Mode Buttons: Added the orange-ish background over the bold font to indicate selection
(see comments for #6860)
Diffstat (limited to 'src/slic3r')
-rw-r--r--src/slic3r/GUI/Notebook.cpp24
-rw-r--r--src/slic3r/GUI/wxExtensions.cpp3
-rw-r--r--src/slic3r/GUI/wxExtensions.hpp2
3 files changed, 27 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Notebook.cpp b/src/slic3r/GUI/Notebook.cpp
index b328fc583..9c5ccb834 100644
--- a/src/slic3r/GUI/Notebook.cpp
+++ b/src/slic3r/GUI/Notebook.cpp
@@ -45,11 +45,12 @@ void ButtonsListCtrl::OnPaint(wxPaintEvent&)
if (m_selection < 0 || m_selection >= (int)m_pageButtons.size())
return;
- // highlight selected button
-
const wxColour& selected_btn_bg = Slic3r::GUI::wxGetApp().get_color_selected_btn_bg();
const wxColour& default_btn_bg = Slic3r::GUI::wxGetApp().get_highlight_default_clr();
const wxColour& btn_marker_color = Slic3r::GUI::wxGetApp().get_color_hovered_btn_label();
+
+ // highlight selected notebook button
+
for (int idx = 0; idx < int(m_pageButtons.size()); idx++) {
wxButton* btn = m_pageButtons[idx];
@@ -63,6 +64,25 @@ void ButtonsListCtrl::OnPaint(wxPaintEvent&)
dc.DrawRectangle(pos.x, pos.y + size.y, size.x, sz.y - size.y);
}
+ // highlight selected mode button
+
+ if (m_mode_sizer) {
+ const std::vector<ModeButton*>& mode_btns = m_mode_sizer->get_btns();
+ for (int idx = 0; idx < int(mode_btns.size()); idx++) {
+ ModeButton* btn = mode_btns[idx];
+ btn->SetBackgroundColour(btn->is_selected() ? selected_btn_bg : default_btn_bg);
+
+ //wxPoint pos = btn->GetPosition();
+ //wxSize size = btn->GetSize();
+ //const wxColour& clr = btn->is_selected() ? btn_marker_color : default_btn_bg;
+ //dc.SetPen(clr);
+ //dc.SetBrush(clr);
+ //dc.DrawRectangle(pos.x, pos.y + size.y, size.x, sz.y - size.y);
+ }
+ }
+
+ // Draw orange bottom line
+
dc.SetPen(btn_marker_color);
dc.SetBrush(btn_marker_color);
dc.DrawRectangle(1, sz.y - m_line_margin, sz.x, m_line_margin);
diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp
index 8903f3b30..a3d6384e0 100644
--- a/src/slic3r/GUI/wxExtensions.cpp
+++ b/src/slic3r/GUI/wxExtensions.cpp
@@ -672,6 +672,9 @@ void ModeButton::focus_button(const bool focus)
Slic3r::GUI::wxGetApp().normal_font();
SetFont(new_font);
+//#ifdef _WIN32
+// GetParent()->Refresh();
+//#else
#ifndef _WIN32
SetForegroundColour(wxSystemSettings::GetColour(focus ? wxSYS_COLOUR_BTNTEXT :
#if defined (__linux__) && defined (__WXGTK3__)
diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp
index 1462e8aa0..25876bd23 100644
--- a/src/slic3r/GUI/wxExtensions.hpp
+++ b/src/slic3r/GUI/wxExtensions.hpp
@@ -283,6 +283,7 @@ public:
void OnLeaveBtn(wxMouseEvent& event) { focus_button(m_is_selected); event.Skip(); }
void SetState(const bool state);
+ bool is_selected() { return m_is_selected; }
protected:
void focus_button(const bool focus);
@@ -312,6 +313,7 @@ public:
void set_items_border(int border);
void msw_rescale();
+ const std::vector<ModeButton*>& get_btns() { return m_mode_btns; }
private:
std::vector<ModeButton*> m_mode_btns;