Test added dynamic fixed width for some tree view columns

pull/235/head
Ivan Dmitrievich Yartsev 10 months ago
parent 14db41b973
commit 72dd7f1eed

@ -3213,24 +3213,24 @@ main_window *yon_main_window_complete(main_window *widgets){
gtk_widget_realize(GTK_WIDGET(widgets->GroupsTree));
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->UsersTree));
gtk_tree_view_column_set_min_width(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,1)),50);
gtk_tree_view_column_set_min_width(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,2)),175);
gtk_tree_view_column_set_min_width(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,3)),175);
for (guint i=0;i<g_list_length(list);i++){
if (i!=1&&i!=2&&i!=3)
yon_gtk_tree_view_column_minimal_fixed_size_set(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,i)));
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("UserColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(widgets->GroupsTree));
gtk_tree_view_column_set_min_width(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,0)),50);
gtk_tree_view_column_set_min_width(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,1)),175);
for (guint i=0;i<g_list_length(list);i++){
if (i!=0&&i!=1)
yon_gtk_tree_view_column_minimal_fixed_size_set(GTK_TREE_VIEW_COLUMN(g_list_nth_data(list,i)));
yon_window_config_add_listener((GtkWidget*)g_list_nth_data(list,i),yon_char_append("GroupColumn",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
}
g_list_free(list);
yon_gtk_tree_view_set_fixed_size(GTK_TREE_VIEW(widgets->UsersTree),1,2,3,-1);
yon_gtk_tree_view_set_fixed_size(GTK_TREE_VIEW(widgets->GroupsTree),1,2,-1);
yon_gtk_tree_view_set_fixed_size(GTK_TREE_VIEW(widgets->SystemTree),1,2,3,-1);
yon_gtk_tree_view_set_fixed_size(GTK_TREE_VIEW(widgets->SystemGroupsTree),1,2,-1);
yon_save_window_set_postsave_function(on_save_done,widgets);
yon_save_window_set_postsave_failure_function(on_save_failed,widgets);
return widgets;

@ -374,7 +374,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed-width">50</property>
<property name="fixed-width">10</property>
<property name="min-width">10</property>
<property name="title" translatable="yes">UID</property>
<property name="sort-column-id">1</property>

Loading…
Cancel
Save