From e4e19f13580647c28efe12b37119aa2f8234acc8 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 15 Jan 2024 10:39:33 +0100 Subject: [PATCH] TextInput: Implemented SysColorsChanged function --- src/slic3r/GUI/Widgets/TextInput.cpp | 10 ++++++++++ src/slic3r/GUI/Widgets/TextInput.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/slic3r/GUI/Widgets/TextInput.cpp b/src/slic3r/GUI/Widgets/TextInput.cpp index b4f1b1a707..7044ecdfdd 100644 --- a/src/slic3r/GUI/Widgets/TextInput.cpp +++ b/src/slic3r/GUI/Widgets/TextInput.cpp @@ -142,6 +142,16 @@ void TextInput::SetSelection(long from, long to) text_ctrl->SetSelection(from, to); } +void TextInput::SysColorsChanged() +{ + if (auto parent = this->GetParent()) { + SetBackgroundColour(parent->GetBackgroundColour()); + SetForegroundColour(parent->GetForegroundColour()); + if (this->drop_down_icon.bmp().IsOk()) + this->drop_down_icon.sys_color_changed(); + } +} + void TextInput::SetIcon(const wxBitmapBundle& icon_in) { icon = icon_in; diff --git a/src/slic3r/GUI/Widgets/TextInput.hpp b/src/slic3r/GUI/Widgets/TextInput.hpp index d48cfc679b..171ab3b80f 100644 --- a/src/slic3r/GUI/Widgets/TextInput.hpp +++ b/src/slic3r/GUI/Widgets/TextInput.hpp @@ -71,6 +71,8 @@ public: void SetSelection(long from, long to); + void SysColorsChanged(); + protected: virtual void OnEdit() {}