[vlc-commits] macosx: advanced prefs: fix table view width autosizing

David Fuhrmann git at videolan.org
Fri Jan 24 19:41:24 CET 2014


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Jan 24 19:39:25 2014 +0100| [9b67dffa3ed7d335d2b8bd391755a6ffe562607f] | committer: David Fuhrmann

macosx: advanced prefs: fix table view width autosizing

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b67dffa3ed7d335d2b8bd391755a6ffe562607f
---

 modules/gui/macosx/prefs_widgets.h |    2 +-
 modules/gui/macosx/prefs_widgets.m |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/prefs_widgets.h b/modules/gui/macosx/prefs_widgets.h
index ab5be7c..0ed6e64 100644
--- a/modules/gui/macosx/prefs_widgets.h
+++ b/modules/gui/macosx/prefs_widgets.h
@@ -199,7 +199,7 @@ static NSMenu   *o_keys_menu = nil;
 @interface ModuleListConfigControl : VLCConfigControl <NSTableViewDataSource>
 {
     NSTextField     *o_textfield;
-    NSScrollView    *o_scrollview;
+    NSTableView     *o_tableview;
     NSMutableArray  *o_modulearray;
 }
 
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 6ad44ec..0324a03 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -2054,11 +2054,10 @@ else\
     } /* FOR i_module_index */
     module_list_free(p_list);
 
-
     // First, initialize and draw the table view to get its height
-    NSRect s_rc = NSMakeRect(12, 10, mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN - 12, 50);
+    // width is increased a little to fix horizontal auto-sizing
+    NSRect s_rc = NSMakeRect(12, 10, mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 18, 50);
     // height is automatically increased as needed
-    NSTableView *o_tableview;
     o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
     [o_tableview setUsesAlternatingRowBackgroundColors:YES];
     [o_tableview setHeaderView:nil];
@@ -2095,6 +2094,7 @@ else\
      NSLeftMouseDraggedMask];
 
     [o_tableview reloadData];
+    [o_tableview setAutoresizingMask: NSViewWidthSizable];
 
     CGFloat tableview_height = [o_tableview frame].size.height;
 
@@ -2155,7 +2155,7 @@ else\
 
 - (void)dealloc
 {
-    [o_scrollview release];
+    [o_tableview release];
     [super dealloc];
 }
 



More information about the vlc-commits mailing list