Fix some bugs

This commit is contained in:
sunsets
2024-01-03 15:39:59 +08:00
parent c6f7bed17e
commit 8a3b753bb1
7 changed files with 50 additions and 40 deletions

View File

@@ -387,11 +387,14 @@ void SpinInput::onTextLostFocus(wxEvent &event)
event.Skip();
}
//B49
void SpinInput::onTextEnter(wxCommandEvent &event)
{
long value;
if (!text_ctrl->GetValue().ToLong(&value))
if (!text_ctrl->GetValue().ToLong(&value)) {
value = val;
text_ctrl->SetValue(wxString::FromDouble(value));
}
if (value != val) {
SetValue(value);
@@ -584,12 +587,16 @@ void SpinInputDouble::onTextLostFocus(wxEvent &event)
event.Skip();
}
//B49
void SpinInputDouble::onTextEnter(wxCommandEvent &event)
{
double value;
if (!text_ctrl->GetValue().ToDouble(&value))
if (!text_ctrl->GetValue().ToDouble(&value)) {
val = value;
wxString str_val = wxString::FromDouble(value, digits);
text_ctrl->SetValue(str_val);
}
if (!Slic3r::is_approx(value, val)) {
SetValue(value);
sendSpinEvent();

View File

@@ -1,8 +1,9 @@
#ifndef slic3r_UI_Colors_hpp_
#define slic3r_UI_Colors_hpp_
//B48
static const int clr_border_normal = 0x646464;//0xDBDBDB;
static const int clr_border_hovered = 0xED6B21;//0x00AE42;
static const int clr_border_hovered = 0x4479FB;//0x00AE42;
static const int clr_border_disabled = 0x646464;//0xDBDBDB;
static const int clr_background_normal_light = 0xFFFFFF;