mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
FIX: Let setBezelStyle: be called for color_picker of filament
Change-Id: I22a6985c793b62f0e4e7a4c7dcb3a06c3efd9620
This commit is contained in:
parent
b1e8fadb09
commit
ab7628ac76
2 changed files with 20 additions and 2 deletions
|
@ -892,10 +892,14 @@ void PlaterPresetComboBox::update()
|
||||||
// BBS
|
// BBS
|
||||||
wxColor clr(filament_color);
|
wxColor clr(filament_color);
|
||||||
clr_picker->SetBackgroundColour(clr);
|
clr_picker->SetBackgroundColour(clr);
|
||||||
auto style = clr_picker->GetWindowStyle() & ~(wxBORDER_NONE | wxBORDER_SIMPLE);
|
|
||||||
auto diff_clr = different_color(clr);
|
auto diff_clr = different_color(clr);
|
||||||
clr_picker->SetWindowStyle(clr.Red() > 224 && clr.Blue() > 224 && clr.Green() > 224 ? (style | wxBORDER_SIMPLE) : (style | wxBORDER_NONE));
|
|
||||||
clr_picker->SetForegroundColour(diff_clr);
|
clr_picker->SetForegroundColour(diff_clr);
|
||||||
|
auto style = clr_picker->GetWindowStyle() & ~(wxBORDER_NONE | wxBORDER_SIMPLE);
|
||||||
|
style = clr.Red() > 224 && clr.Blue() > 224 && clr.Green() > 224 ? (style | wxBORDER_SIMPLE) : (style | wxBORDER_NONE);
|
||||||
|
clr_picker->SetWindowStyle(style);
|
||||||
|
#ifdef __WXOSX__
|
||||||
|
clr_picker->SetLabel(clr_picker->GetLabel()); // Let setBezelStyle: be called
|
||||||
|
#endif
|
||||||
selected_filament_preset = m_collection->find_preset(m_preset_bundle->filament_presets[m_filament_idx]);
|
selected_filament_preset = m_collection->find_preset(m_preset_bundle->filament_presets[m_filament_idx]);
|
||||||
if (!selected_filament_preset) {
|
if (!selected_filament_preset) {
|
||||||
//can not find this filament, should be caused by project embedded presets, will be updated later
|
//can not find this filament, should be caused by project embedded presets, will be updated later
|
||||||
|
|
|
@ -115,6 +115,20 @@ void set_miniaturizable(void * window)
|
||||||
[attrTitle release];
|
[attrTitle release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setBezelStyle2:(NSBezelStyle)bezelStyle
|
||||||
|
{
|
||||||
|
if (bezelStyle != NSBezelStyleShadowlessSquare)
|
||||||
|
[self setBordered: YES];
|
||||||
|
[self setBezelStyle2: bezelStyle];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) load
|
||||||
|
{
|
||||||
|
Method setBezelStyle = class_getInstanceMethod([NSButton class], @selector(setBezelStyle:));
|
||||||
|
Method setBezelStyle2 = class_getInstanceMethod([NSButton class], @selector(setBezelStyle2:));
|
||||||
|
method_exchangeImplementations(setBezelStyle, setBezelStyle2);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* edit column for wxTableView */
|
/* edit column for wxTableView */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue