FIX: dark mode of wxTextCtrl

Change-Id: I8a377228b79d24ffe6284acf9be7017207b5dddc
This commit is contained in:
chunmao.guo 2022-11-21 19:51:51 +08:00 committed by Lane.Wei
parent 3925ceb9f4
commit 65ee16f676
8 changed files with 21 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#include "SpinInput.hpp"
#include "Label.hpp"
#include "Button.hpp"
#include "TextCtrl.h"
#include <wx/dcgraph.h>
@ -27,7 +28,7 @@ SpinInput::SpinInput()
border_width = 1;
border_color = StateColor(std::make_pair(0xDBDBDB, (int) StateColor::Disabled), std::make_pair(0x00AE42, (int) StateColor::Hovered),
std::make_pair(0xDBDBDB, (int) StateColor::Normal));
background_color = StateColor(std::make_pair(0xF0F0F0, (int) StateColor::Disabled), std::make_pair(*wxWHITE, (int) StateColor::Normal));
background_color = StateColor(std::make_pair(0xF0F0F1, (int) StateColor::Disabled), std::make_pair(*wxWHITE, (int) StateColor::Normal));
}
@ -56,7 +57,7 @@ void SpinInput::Create(wxWindow *parent,
wxWindow::SetLabel(label);
state_handler.attach({&label_color, &text_color});
state_handler.update_binds();
text_ctrl = new wxTextCtrl(this, wxID_ANY, text, {20, 4}, wxDefaultSize, style | wxBORDER_NONE | wxTE_PROCESS_ENTER, wxTextValidator(wxFILTER_DIGITS));
text_ctrl = new TextCtrl(this, wxID_ANY, text, {20, 4}, wxDefaultSize, style | wxBORDER_NONE | wxTE_PROCESS_ENTER, wxTextValidator(wxFILTER_DIGITS));
text_ctrl->SetFont(Label::Body_14);
text_ctrl->SetBackgroundColour(background_color.colorForStates(state_handler.states()));
text_ctrl->SetForegroundColour(text_color.colorForStates(state_handler.states()));