Fix WXGetManuallySetWidth() for columns using wxCOL_WIDTH_DEFAULT
Columns without any explicitly specified width still shouldn't be shrunk
down to 0 size by UpdateColumnSizes(), so handle them as if they were
created using wxDVC_DEFAULT_WIDTH instead -- which is what their actual
width is/would be.
This is a better fix than the one in 0c90ea40c3
(Don't auto-resize
wxDataViewCtrl columns below their initial size, 2019-10-03) and that
commit can be reverted now, as will be done soon.
See #18343.
This commit is contained in:
@@ -154,7 +154,7 @@ public:
|
|||||||
// user interactively.
|
// user interactively.
|
||||||
void WXOnResize(int width);
|
void WXOnResize(int width);
|
||||||
|
|
||||||
int WXGetManuallySetWidth() const { return m_manuallySetWidth; }
|
int WXGetManuallySetWidth() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
|
@@ -217,6 +217,15 @@ void wxDataViewColumn::WXOnResize(int width)
|
|||||||
m_owner->OnColumnResized();
|
m_owner->OnColumnResized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxDataViewColumn::WXGetManuallySetWidth() const
|
||||||
|
{
|
||||||
|
// Note that we need to return valid value even if no width was initially
|
||||||
|
// specified, as otherwise the last column created without any explicit
|
||||||
|
// width could be reduced to nothing by UpdateColumnSizes() when the
|
||||||
|
// control is shrunk.
|
||||||
|
return DoGetEffectiveWidth(m_manuallySetWidth);
|
||||||
|
}
|
||||||
|
|
||||||
void wxDataViewColumn::UpdateDisplay()
|
void wxDataViewColumn::UpdateDisplay()
|
||||||
{
|
{
|
||||||
if (m_owner)
|
if (m_owner)
|
||||||
|
Reference in New Issue
Block a user