No real changes, just minor cleanup in wxGTK wxDVC.
Don't duplicate wxGtkTreeCellDataFunc declaration. Don't triplicate "visible" property setting inside the function itself. Indent the inside of if statement properly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2497,14 +2497,8 @@ gtk_dataview_header_button_press_callback( GtkWidget *WXUNUSED(widget),
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C"
|
||||||
static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *column,
|
{
|
||||||
GtkCellRenderer *cell,
|
|
||||||
GtkTreeModel *model,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
gpointer data );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
|
static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
|
||||||
GtkCellRenderer *renderer,
|
GtkCellRenderer *renderer,
|
||||||
@@ -2523,37 +2517,25 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
|
|||||||
|
|
||||||
if (!wx_model->IsVirtualListModel())
|
if (!wx_model->IsVirtualListModel())
|
||||||
{
|
{
|
||||||
|
gboolean visible;
|
||||||
if (wx_model->IsContainer( item ))
|
if (wx_model->IsContainer( item ))
|
||||||
{
|
|
||||||
if (wx_model->HasContainerColumns( item ) || (cell->GetOwner()->GetModelColumn() == 0))
|
|
||||||
{
|
{
|
||||||
GValue gvalue = { 0, };
|
visible = wx_model->HasContainerColumns( item ) ||
|
||||||
g_value_init( &gvalue, G_TYPE_BOOLEAN );
|
(cell->GetOwner()->GetModelColumn() == 0);
|
||||||
g_value_set_boolean( &gvalue, TRUE );
|
|
||||||
g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
|
|
||||||
g_value_unset( &gvalue );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GValue gvalue = { 0, };
|
visible = true;
|
||||||
g_value_init( &gvalue, G_TYPE_BOOLEAN );
|
|
||||||
g_value_set_boolean( &gvalue, FALSE );
|
|
||||||
g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
|
|
||||||
g_value_unset( &gvalue );
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GValue gvalue = { 0, };
|
GValue gvalue = { 0, };
|
||||||
g_value_init( &gvalue, G_TYPE_BOOLEAN );
|
g_value_init( &gvalue, G_TYPE_BOOLEAN );
|
||||||
g_value_set_boolean( &gvalue, TRUE );
|
g_value_set_boolean( &gvalue, visible );
|
||||||
g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
|
g_object_set_property( G_OBJECT(renderer), "visible", &gvalue );
|
||||||
g_value_unset( &gvalue );
|
g_value_unset( &gvalue );
|
||||||
}
|
|
||||||
|
|
||||||
|
if ( !visible )
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxVariant value;
|
wxVariant value;
|
||||||
@@ -2650,6 +2632,8 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column),
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // extern "C"
|
||||||
|
|
||||||
#include <wx/listimpl.cpp>
|
#include <wx/listimpl.cpp>
|
||||||
WX_DEFINE_LIST(wxDataViewColumnList)
|
WX_DEFINE_LIST(wxDataViewColumnList)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user