mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-29 00:13:12 +08:00
FIX: messureSize after set max size; the text is the default tooltip
jira: [STUDIO-11878] Change-Id: I1945779d620a01fff4cfb29b5592eed0490dbbd5
This commit is contained in:
parent
c03e133404
commit
fba3ab060f
@ -110,6 +110,12 @@ void Button::SetMinSize(const wxSize& size)
|
|||||||
messureSize();
|
messureSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Button::SetMaxSize(const wxSize& size)
|
||||||
|
{
|
||||||
|
wxWindow::SetMaxSize(size);
|
||||||
|
messureSize();
|
||||||
|
}
|
||||||
|
|
||||||
void Button::SetPaddingSize(const wxSize& size)
|
void Button::SetPaddingSize(const wxSize& size)
|
||||||
{
|
{
|
||||||
paddingSize = size;
|
paddingSize = size;
|
||||||
@ -310,9 +316,15 @@ void Button::messureSize()
|
|||||||
if (minSize.GetHeight() > 0)
|
if (minSize.GetHeight() > 0)
|
||||||
size.SetHeight(minSize.GetHeight());
|
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());
|
size.SetWidth(GetMaxWidth());
|
||||||
|
|
||||||
|
const wxString& tip_str = GetToolTipText();
|
||||||
|
if (tip_str.IsEmpty()) {
|
||||||
|
SetToolTip(GetLabel());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (minSize.GetWidth() > size.GetWidth())
|
if (minSize.GetWidth() > size.GetWidth())
|
||||||
wxWindow::SetMinSize(minSize);
|
wxWindow::SetMinSize(minSize);
|
||||||
else
|
else
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
void SetInactiveIcon(const wxString& icon);
|
void SetInactiveIcon(const wxString& icon);
|
||||||
|
|
||||||
void SetMinSize(const wxSize& size) override;
|
void SetMinSize(const wxSize& size) override;
|
||||||
|
void SetMaxSize(const wxSize& size) override;
|
||||||
|
|
||||||
void SetPaddingSize(const wxSize& size);
|
void SetPaddingSize(const wxSize& size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user