mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
Fixes for window rounding
This commit is contained in:
@@ -124,7 +124,7 @@ SpeedDialWebDialog::SpeedDialWebDialog(wxWindow* parent)
|
|||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
wxDefaultPosition,
|
wxDefaultPosition,
|
||||||
wxDefaultSize,
|
wxDefaultSize,
|
||||||
wxBORDER_NONE | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT)
|
wxBORDER_NONE | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | wxFRAME_SHAPED)
|
||||||
{
|
{
|
||||||
SetBackgroundColour(bg_color());
|
SetBackgroundColour(bg_color());
|
||||||
Bind(wxEVT_ACTIVATE, [this](wxActivateEvent& event) {
|
Bind(wxEVT_ACTIVATE, [this](wxActivateEvent& event) {
|
||||||
@@ -144,6 +144,12 @@ SpeedDialWebDialog::SpeedDialWebDialog(wxWindow* parent)
|
|||||||
SetSizer(sizer);
|
SetSizer(sizer);
|
||||||
SetClientSize(FromDIP(wxSize(kPopupWidth, kPopupMinHeight)));
|
SetClientSize(FromDIP(wxSize(kPopupWidth, kPopupMinHeight)));
|
||||||
}
|
}
|
||||||
|
// Re-cut the shape region whenever layout changes the client size; SetShape itself
|
||||||
|
// does not generate size events, so this cannot recurse.
|
||||||
|
Bind(wxEVT_SIZE, [this](wxSizeEvent& event) {
|
||||||
|
event.Skip();
|
||||||
|
apply_rounded_shape();
|
||||||
|
});
|
||||||
apply_rounded_shape();
|
apply_rounded_shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +262,8 @@ void SpeedDialWebDialog::resize_to_content(int height)
|
|||||||
// with a shape region (same mask trick as FilamentPickerDialog). Binary edges, no anti-aliasing.
|
// with a shape region (same mask trick as FilamentPickerDialog). Binary edges, no anti-aliasing.
|
||||||
void SpeedDialWebDialog::apply_rounded_shape()
|
void SpeedDialWebDialog::apply_rounded_shape()
|
||||||
{
|
{
|
||||||
const wxSize size = GetSize();
|
// BORDER_NONE means the window is all client area, so the client size is the shape size.
|
||||||
|
const wxSize size = GetClientSize();
|
||||||
if (size.GetWidth() <= 0 || size.GetHeight() <= 0)
|
if (size.GetWidth() <= 0 || size.GetHeight() <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user