From 50dc62605bb03ad82d5010a12df2f087339aedfa Mon Sep 17 00:00:00 2001 From: pztrn Date: Fri, 7 Oct 2016 21:31:42 +0500 Subject: [PATCH] Fixed lists columns addition on first start. --- ui/mainwindow_init.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/mainwindow_init.go b/ui/mainwindow_init.go index 89aaf27..7de9c5e 100644 --- a/ui/mainwindow_init.go +++ b/ui/mainwindow_init.go @@ -368,8 +368,11 @@ func (m *MainWindow) InitializeTabs() { col.SetSortColumnId(position_int) col.SetReorderable(true) col.SetResizable(true) - col.SetSizing(gtk.TREE_VIEW_COLUMN_FIXED) - col.SetFixedWidth(width_int) + // GtkTreeViewColumn.SetFixedWidth() accepts only positive integers. + if width_int > 1 { + col.SetSizing(gtk.TREE_VIEW_COLUMN_FIXED) + col.SetFixedWidth(width_int) + } m.column_pos["Servers"][name] = position_int all_servers_columns_to_append[position_int] = col } @@ -441,8 +444,11 @@ func (m *MainWindow) InitializeTabs() { col.SetSortColumnId(position_int) col.SetReorderable(true) col.SetResizable(true) - col.SetSizing(gtk.TREE_VIEW_COLUMN_FIXED) - col.SetFixedWidth(width_int) + // GtkTreeViewColumn.SetFixedWidth() accepts only positive integers. + if width_int > 1 { + col.SetSizing(gtk.TREE_VIEW_COLUMN_FIXED) + col.SetFixedWidth(width_int) + } m.column_pos["Favorites"][name] = position_int fav_servers_columns_to_append[position_int] = col }