mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-30 19:30:40 -07:00
FIX: messureSize after set max size; the text is the default tooltip
jira: [STUDIO-11878] Change-Id: I1945779d620a01fff4cfb29b5592eed0490dbbd5 (cherry picked from commit fba3ab060f5dcfeaf5cc36f14eb5ec46414fdbc8)
This commit is contained in:
parent
01ec351df4
commit
50ef04666b
2 changed files with 14 additions and 1 deletions
|
|
@ -105,6 +105,12 @@ void Button::SetMinSize(const wxSize& size)
|
|||
messureSize();
|
||||
}
|
||||
|
||||
void Button::SetMaxSize(const wxSize& size)
|
||||
{
|
||||
wxWindow::SetMaxSize(size);
|
||||
messureSize();
|
||||
}
|
||||
|
||||
void Button::SetPaddingSize(const wxSize& size)
|
||||
{
|
||||
paddingSize = size;
|
||||
|
|
@ -385,9 +391,15 @@ void Button::messureSize()
|
|||
if (minSize.GetHeight() > 0)
|
||||
size.SetHeight(minSize.GetHeight());
|
||||
|
||||
if (auto w = GetMaxWidth(); w > 0 && size.GetWidth() > w)
|
||||
if (auto w = GetMaxWidth(); w > 0 && size.GetWidth() > w) {
|
||||
size.SetWidth(GetMaxWidth());
|
||||
|
||||
const wxString& tip_str = GetToolTipText();
|
||||
if (tip_str.IsEmpty()) {
|
||||
SetToolTip(GetLabel());
|
||||
}
|
||||
}
|
||||
|
||||
if (minSize.GetWidth() > size.GetWidth())
|
||||
wxWindow::SetMinSize(minSize);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public:
|
|||
void SetInactiveIcon(const wxString& icon);
|
||||
|
||||
void SetMinSize(const wxSize& size) override;
|
||||
void SetMaxSize(const wxSize& size) override;
|
||||
|
||||
void SetPaddingSize(const wxSize& size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue