NEW:support transparent color display

Change-Id: I49e0e4c507121af7dad912a3a549348e7ade8eec
This commit is contained in:
tao wang 2023-05-16 20:53:08 +08:00 committed by Lane.Wei
parent 57873e6e59
commit 9f8397b187
14 changed files with 317 additions and 49 deletions

View file

@ -633,6 +633,7 @@ void AMSLib::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const w
m_bitmap_editable_light = ScalableBitmap(this, "ams_editable_light", 14);
m_bitmap_readonly = ScalableBitmap(this, "ams_readonly", 14);
m_bitmap_readonly_light = ScalableBitmap(this, "ams_readonly_light", 14);
m_bitmap_transparent = ScalableBitmap(this, "transparent_ams_lib", FromDIP(68));
m_sizer_body->Add(0, 0, 1, wxEXPAND, 0);
m_sizer_body->Add(m_sizer_edit, 0, wxALIGN_CENTER, 0);
@ -723,9 +724,9 @@ void AMSLib::render(wxDC &dc)
temp_text_colour = AMS_CONTROL_GRAY800;
}
//if (!wxWindow::IsEnabled()) {
//temp_text_colour = AMS_CONTROL_DISABLE_TEXT_COLOUR;
//}
if (tmp_lib_colour.Alpha() == 0) {
temp_text_colour = AMS_CONTROL_GRAY800;
}
dc.SetFont(::Label::Body_13);
dc.SetTextForeground(temp_text_colour);
@ -829,9 +830,10 @@ void AMSLib::doRender(wxDC &dc)
temp_bitmap_brand = m_bitmap_readonly;
}
//if (!wxWindow::IsEnabled()) {
//tmp_lib_colour = AMS_CONTROL_DISABLE_COLOUR;
//}
if (tmp_lib_colour.Alpha() == 0) {
temp_bitmap_third = m_bitmap_editable;
temp_bitmap_brand = m_bitmap_readonly;
}
// selected
if (m_selected) {
@ -888,6 +890,12 @@ void AMSLib::doRender(wxDC &dc)
if (curr_height >= FromDIP(6)) {
//transparent
auto alpha = m_info.material_colour.Alpha();
if (alpha == 0) {
dc.DrawBitmap(m_bitmap_transparent.bmp(),FromDIP(4), FromDIP(4));
}
//gradient
if (m_info.material_cols.size() > 1) {
int left = FromDIP(4);