From 1c1b1bc0193874f58ff3187ac0a4c66b0b986446 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 3 Nov 2020 13:40:49 +0100 Subject: [PATCH] Custom control : Fixed un-hovering for labels, which work as a hyperlinks --- src/slic3r/GUI/OG_CustomCtrl.cpp | 11 +++++++++++ src/slic3r/GUI/OG_CustomCtrl.hpp | 1 + 2 files changed, 12 insertions(+) diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 145d97189..fe120a875 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -62,6 +62,7 @@ OG_CustomCtrl::OG_CustomCtrl( wxWindow* parent, this->Bind(wxEVT_PAINT, &OG_CustomCtrl::OnPaint, this); this->Bind(wxEVT_MOTION, &OG_CustomCtrl::OnMotion, this); this->Bind(wxEVT_LEFT_DOWN, &OG_CustomCtrl::OnLeftDown, this); + this->Bind(wxEVT_LEAVE_WINDOW, &OG_CustomCtrl::OnLeaveWin, this); } void OG_CustomCtrl::init_ctrl_lines() @@ -281,6 +282,16 @@ void OG_CustomCtrl::OnLeftDown(wxMouseEvent& event) } +void OG_CustomCtrl::OnLeaveWin(wxMouseEvent& event) +{ + for (CtrlLine& line : ctrl_lines) + line.is_focused = false; + + Refresh(); + Update(); + event.Skip(); +} + bool OG_CustomCtrl::update_visibility(ConfigOptionMode mode) { wxCoord v_pos = 0; diff --git a/src/slic3r/GUI/OG_CustomCtrl.hpp b/src/slic3r/GUI/OG_CustomCtrl.hpp index d00a0027d..2ca1b8a77 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.hpp +++ b/src/slic3r/GUI/OG_CustomCtrl.hpp @@ -78,6 +78,7 @@ public: void OnPaint(wxPaintEvent&); void OnMotion(wxMouseEvent& event); void OnLeftDown(wxMouseEvent& event); + void OnLeaveWin(wxMouseEvent& event); void init_ctrl_lines(); bool update_visibility(ConfigOptionMode mode);