Implement wxDataViewCtrl::SetRowHeight() for wxGTK.
Also document that this method can only be used to increase the row height compared to the default, not to make it smaller. See #12749. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1333,6 +1333,17 @@ gtk_wx_cell_renderer_get_size (GtkCellRenderer *renderer,
|
||||
|
||||
wxSize size = cell->GetSize();
|
||||
|
||||
wxDataViewCtrl * const ctrl = cell->GetOwner()->GetOwner();
|
||||
|
||||
// Uniform row height, if specified, overrides the value returned by the
|
||||
// renderer.
|
||||
if ( !ctrl->HasFlag(wxDV_VARIABLE_LINE_HEIGHT) )
|
||||
{
|
||||
const int uniformHeight = ctrl->GTKGetUniformRowHeight();
|
||||
if ( uniformHeight > 0 )
|
||||
size.y = uniformHeight;
|
||||
}
|
||||
|
||||
int xpad, ypad;
|
||||
gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
|
||||
int calc_width = xpad * 2 + size.x;
|
||||
@@ -4473,6 +4484,8 @@ void wxDataViewCtrl::Init()
|
||||
m_internal = NULL;
|
||||
|
||||
m_cols.DeleteContents( true );
|
||||
|
||||
m_uniformRowHeight = -1;
|
||||
}
|
||||
|
||||
bool wxDataViewCtrl::Create(wxWindow *parent,
|
||||
@@ -5103,6 +5116,12 @@ wxDataViewCtrl::GetItemRect(const wxDataViewItem& WXUNUSED(item),
|
||||
return wxRect();
|
||||
}
|
||||
|
||||
bool wxDataViewCtrl::SetRowHeight(int rowHeight)
|
||||
{
|
||||
m_uniformRowHeight = rowHeight;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::DoSetExpanderColumn()
|
||||
{
|
||||
gtk_tree_view_set_expander_column( GTK_TREE_VIEW(m_treeview),
|
||||
|
Reference in New Issue
Block a user