post changes after merging BS1.7.4

Remove tracking etc..
This commit is contained in:
SoftFever 2023-08-26 18:24:13 +08:00
parent e65b11a831
commit 2a478ab4f9
615 changed files with 46215 additions and 54844 deletions

View file

@ -1891,7 +1891,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
//backup tips
m_ams_backup_tip = new Label(m_amswin, _L("Auto Refill"));
m_ams_backup_tip->SetFont(::Label::Head_12);
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
m_ams_backup_tip->SetForegroundColour(wxColour(0x009688));
m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
m_img_ams_backup->SetBackgroundColour(*wxWHITE);
@ -1973,7 +1973,6 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(wxColour(0, 137, 123), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(38, 166, 154), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),

View file

@ -92,12 +92,6 @@ void ComboBox::SelectAndNotify(int n) {
sendComboBoxEvent();
}
void ComboBox::SelectAndNotify(int n) {
SetSelection(n);
sendComboBoxEvent();
}
void ComboBox::Rescale()
{
TextInput::Rescale();

View file

@ -1,6 +1,7 @@
#include "libslic3r/Utils.hpp"
#include "Label.hpp"
#include "StaticBox.hpp"
#include <wx/intl.h> // For wxLocale
wxFont Label::sysFont(int size, bool bold)
{
@ -11,13 +12,22 @@ wxFont Label::sysFont(int size, bool bold)
size = size * 4 / 5;
#endif
auto face = wxString::FromUTF8("HarmonyOS Sans SC");
wxString face = "HarmonyOS Sans SC";
// Check if the current locale is Korean
if (wxLocale::GetSystemLanguage() == wxLANGUAGE_KOREAN) {
face = "Noto Sans KR";
}
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
font.SetFaceName(face);
if (!font.IsOk()) {
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
if (bold) font.MakeBold();
font.SetPointSize(size);
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find %1% font") % face;
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
BOOST_LOG_TRIVIAL(warning) << boost::format("Use system font instead: %1%") % font.GetFaceName();
if (bold)
font.MakeBold();
font.SetPointSize(size);
}
return font;
}
@ -45,16 +55,25 @@ wxFont Label::Body_9;
void Label::initSysFont()
{
#ifdef __linux__
const std::string& resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Bold.ttf");
#if defined(__linux__) || defined(_WIN32)
const std::string &resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Bold.ttf");
bool result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Regular.ttf");
font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Regular.ttf");
result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
// Adding Noto Sans KR Regular and Bold
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Regular.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Regular returns %1%")%result;
printf("add font of NotoSansKR-Regular returns %d\n", result);
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Bold.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Bold returns %1%")%result;
printf("add font of NotoSansKR-Bold returns %d\n", result);
#endif
Head_48 = Label::sysFont(48, true);
Head_32 = Label::sysFont(32, true);
@ -283,7 +302,7 @@ void Label::SetWindowStyleFlag(long style)
wxStaticText::SetWindowStyleFlag(style);
if (style & LB_HYPERLINK) {
this->m_color = GetForegroundColour();
static wxColor clr_url("#00AE42");
static wxColor clr_url("#009688");
SetFont(this->m_font.Underlined());
SetForegroundColour(clr_url);
SetCursor(wxCURSOR_HAND);

View file

@ -28,9 +28,9 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
border_color.append(0x6B6B6B, StateColor::Disabled);
border_color.append(wxColour(23, 129, 63), StateColor::Pressed);
border_color.append(wxColour(48,221,112), StateColor::Hovered);
border_color.append(0x00AE42, StateColor::Normal);
border_color.append(wxColour(0, 137, 123), StateColor::Pressed);
border_color.append(wxColour(38, 166, 154), StateColor::Hovered);
border_color.append(0x009688, StateColor::Normal);
border_color.setTakeFocusedAsHovered(false);
text_color.append(0xACACAC, StateColor::Disabled);
@ -39,9 +39,9 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
text_color.append(0xFEFEFE, StateColor::Normal);
background_color.append(0x6B6B6B, StateColor::Disabled);
background_color.append(wxColour(23, 129, 63), StateColor::Pressed);
background_color.append(wxColour(48, 221, 112), StateColor::Hovered);
background_color.append(0x00AE42, StateColor::Normal);
background_color.append(wxColour(0, 137, 123), StateColor::Pressed);
background_color.append(wxColour(38, 166, 154), StateColor::Hovered);
background_color.append(0x009688, StateColor::Normal);
background_color.setTakeFocusedAsHovered(false);
SetBottomColour(wxColour("#3B4446"));

View file

@ -315,7 +315,7 @@ SideTools::SideTools(wxWindow *parent, wxWindowID id, const wxPoint &pos, const
m_link_network_state = new Label(m_side_error_panel, _L("Check cloud service status"), wxALIGN_CENTER_HORIZONTAL | wxST_ELLIPSIZE_END);
m_link_network_state->SetMinSize(wxSize(FromDIP(220), -1));
m_link_network_state->SetMaxSize(wxSize(FromDIP(220), -1));
m_link_network_state->SetForegroundColour(0x00AE42);
m_link_network_state->SetForegroundColour(0x009688);
m_link_network_state->SetFont(::Label::Body_12);
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); });
@ -507,8 +507,8 @@ void SideTools::show_status(int status)
else if ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0) {
m_hyperlink->Hide();
m_connection_info->SetLabel(_L("Connecting..."));
m_connection_info->SetBackgroundColor(0x00AE42);
m_connection_info->SetBorderColor(0x00AE42);
m_connection_info->SetBackgroundColor(0x009688);
m_connection_info->SetBorderColor(0x009688);
m_connection_info->Show();
m_more_button->Hide();
m_side_error_panel->Hide();