Width of colums depends on label width

pull/81/head
Ivan Yartsev 2 years ago
parent af52f391c2
commit 020c77402e

@ -601,5 +601,11 @@ int main(int argc, char *argv[]){
tree_view_select_group(NULL);
tree_view_select_project(NULL);
tree_view_select_device(NULL);
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(cfg_custom_gui.treeViewGeneral));
for (int i = 0; i < g_list_length(list); i++){
// yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("general_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
yon_gtk_column_minimal_fixed_size_set((GtkTreeViewColumn*)g_list_nth_data(list,i));
}
gtk_main();
}

@ -1709,6 +1709,11 @@ int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find){
} return -1;
}
void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column){
int width= gtk_tree_view_column_get_width(column);
gtk_tree_view_column_set_min_width(column,width);
}
/**yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...)
* [EN]
*

@ -262,6 +262,8 @@ int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size);
int yon_gtk_combo_box_text_find(GtkWidget *combo_box, char *text_to_find);
void yon_gtk_column_minimal_fixed_size_set(GtkTreeViewColumn *column);
int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment);
int yon_dictionary_gtk_pack_start_multiple_widgets(GtkBox *destination, gboolean expand, gboolean fill, int padding, ...);

@ -239,12 +239,12 @@ custom_window *setup_window_custom(custom_window* custom_widgets, GtkBuilder *bu
custom_widgets->device.Update = yon_gtk_builder_get_widget(builder,"btnUpdateDevices");
custom_widgets->device.liststore = GTK_LIST_STORE(gtk_builder_get_object(builder, "liststoreDevice"));
GList *list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->treeViewGeneral));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("general_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);
}
g_list_free(list);
list = gtk_tree_view_get_columns(GTK_TREE_VIEW(custom_widgets->device.tree_view));
for (int i = 0; i < g_list_length(list); i++){
yon_window_config_add_listener(g_list_nth_data(list,i),yon_char_append("device_tree",yon_char_from_int(i)),"fixed-width",YON_TYPE_INT);

Loading…
Cancel
Save