Draw a blank header button in any remaining space after last header column
(cherry picked from commit c70abf23aa
)
This commit is contained in:
@@ -487,9 +487,6 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
wxAutoBufferedPaintDC dc(this);
|
wxAutoBufferedPaintDC dc(this);
|
||||||
|
|
||||||
dc.SetBackground(GetBackgroundColour());
|
|
||||||
dc.Clear();
|
|
||||||
|
|
||||||
// account for the horizontal scrollbar offset in the parent window
|
// account for the horizontal scrollbar offset in the parent window
|
||||||
dc.SetDeviceOrigin(m_scrollOffset, 0);
|
dc.SetDeviceOrigin(m_scrollOffset, 0);
|
||||||
|
|
||||||
@@ -535,7 +532,7 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
params.m_labelAlignment = col.GetAlignment();
|
params.m_labelAlignment = col.GetAlignment();
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
if (i == count-1)
|
if (i == count-1 && xpos + colWidth >= w)
|
||||||
{
|
{
|
||||||
// colWidth = wxMax( colWidth, vw - xpos );
|
// colWidth = wxMax( colWidth, vw - xpos );
|
||||||
state |= wxCONTROL_DIRTY;
|
state |= wxCONTROL_DIRTY;
|
||||||
@@ -554,6 +551,14 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
xpos += colWidth;
|
xpos += colWidth;
|
||||||
}
|
}
|
||||||
|
if (xpos < w)
|
||||||
|
{
|
||||||
|
int state = wxCONTROL_DIRTY;
|
||||||
|
if (!IsEnabled())
|
||||||
|
state |= wxCONTROL_DISABLED;
|
||||||
|
wxRendererNative::Get().DrawHeaderButton(
|
||||||
|
this, dc, wxRect(xpos, 0, w - xpos, h), state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxHeaderCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
|
void wxHeaderCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
|
||||||
|
Reference in New Issue
Block a user