From 452781a78c68b3ad5239134b1644933641a31cb8 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sun, 20 Jan 2008 03:59:48 +0000 Subject: [PATCH] fix column width saving --- src/dgtk.py | 15 +++++++++----- src/pref.py | 56 ++++++++++++++++++++++++++--------------------------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/dgtk.py b/src/dgtk.py index 80fa45429..9b0a8d046 100644 --- a/src/dgtk.py +++ b/src/dgtk.py @@ -71,7 +71,8 @@ def add_func_column(view, header, func, data, sortid=None, width=None): column.set_clickable(True) column.set_sort_column_id(data) column.set_resizable(True) - if width: + if width > 0: + column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(width) column.set_expand(False) column.set_min_width(10) @@ -87,7 +88,8 @@ def add_text_column(view, header, cid, width=None): column.set_sort_column_id(cid) column.set_resizable(True) column.set_expand(False) - if width: + if width > 0: + column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(width) column.set_min_width(10) column.set_reorderable(True) @@ -102,7 +104,8 @@ def add_progress_column(view, header, pid, mid, width=None): column.set_resizable(True) column.set_expand(False) column.set_min_width(10) - if width: + if width > 0: + column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(width) column.set_reorderable(True) view.append_column(column) @@ -115,7 +118,8 @@ def add_toggle_column(view, header, cid, toggled_signal=None, width=None): column.set_clickable(True) column.set_resizable(True) column.set_expand(False) - if width: + if width > 0: + column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(width) column.set_min_width(10) column.set_reorderable(True) @@ -129,7 +133,8 @@ def add_texticon_column(view, header, icon_col, text_col, width=None): column.set_clickable(True) column.set_resizable(True) column.set_expand(False) - if width: + if width > 0: + column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(width) column.set_min_width(10) column.set_reorderable(True) diff --git a/src/pref.py b/src/pref.py index 19d4b4bae..251b7f823 100644 --- a/src/pref.py +++ b/src/pref.py @@ -136,20 +136,20 @@ if common.windows_check(): "window_width" : 640, "window_x_pos" : 0, "window_y_pos" : 0, - "availability_width" : 50, - "queue_width" : 40, - "name_width" : 175, - "dl_width" : 110, - "ul_width" : 110, - "eta_width" : 65, - "peer_width" : 85, - "seed_width" : 85, - "share_width" : 60, - "size_width" : 71, - "status_width" : 150, - "filename_f_width" : 220, - "size_f_width" : 90, - "priority_f_width" : 140, + "availability_width" : -1, + "queue_width" : -1, + "name_width" : -1, + "dl_width" : -1, + "ul_width" : -1, + "eta_width" : -1, + "peer_width" : -1, + "seed_width" : -1, + "share_width" : -1, + "size_width" : -1, + "status_width" : -1, + "filename_f_width" : -1, + "size_f_width" : -1, + "priority_f_width" : -1, "start_paused": False, "use_advanced_bar" : True } @@ -250,20 +250,20 @@ else: "window_width" : 640, "window_x_pos" : 0, "window_y_pos" : 0, - "availability_width" : 50, - "queue_width" : 40, - "name_width" : 175, - "dl_width" : 110, - "ul_width" : 110, - "eta_width" : 65, - "peer_width" : 85, - "seed_width" : 85, - "share_width" : 60, - "size_width" : 71, - "status_width" : 150, - "filename_f_width" : 220, - "size_f_width" : 90, - "priority_f_width" : 140, + "availability_width" : -1, + "queue_width" : -1, + "name_width" : -1, + "dl_width" : -1, + "ul_width" : -1, + "eta_width" : -1, + "peer_width" : -1, + "seed_width" : -1, + "share_width" : -1, + "size_width" : -1, + "status_width" : -1, + "filename_f_width" : -1, + "size_f_width" : -1, + "priority_f_width" : -1, "start_paused": False, "use_advanced_bar" : True }