Commit 9b67dffa authored by David Fuhrmann's avatar David Fuhrmann

macosx: advanced prefs: fix table view width autosizing

parent 4049e233
...@@ -199,7 +199,7 @@ static NSMenu *o_keys_menu = nil; ...@@ -199,7 +199,7 @@ static NSMenu *o_keys_menu = nil;
@interface ModuleListConfigControl : VLCConfigControl <NSTableViewDataSource> @interface ModuleListConfigControl : VLCConfigControl <NSTableViewDataSource>
{ {
NSTextField *o_textfield; NSTextField *o_textfield;
NSScrollView *o_scrollview; NSTableView *o_tableview;
NSMutableArray *o_modulearray; NSMutableArray *o_modulearray;
} }
......
...@@ -2054,11 +2054,10 @@ else\ ...@@ -2054,11 +2054,10 @@ else\
} /* FOR i_module_index */ } /* FOR i_module_index */
module_list_free(p_list); module_list_free(p_list);
// First, initialize and draw the table view to get its height // 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 // height is automatically increased as needed
NSTableView *o_tableview;
o_tableview = [[NSTableView alloc] initWithFrame : s_rc]; o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
[o_tableview setUsesAlternatingRowBackgroundColors:YES]; [o_tableview setUsesAlternatingRowBackgroundColors:YES];
[o_tableview setHeaderView:nil]; [o_tableview setHeaderView:nil];
...@@ -2095,6 +2094,7 @@ else\ ...@@ -2095,6 +2094,7 @@ else\
NSLeftMouseDraggedMask]; NSLeftMouseDraggedMask];
[o_tableview reloadData]; [o_tableview reloadData];
[o_tableview setAutoresizingMask: NSViewWidthSizable];
CGFloat tableview_height = [o_tableview frame].size.height; CGFloat tableview_height = [o_tableview frame].size.height;
...@@ -2155,7 +2155,7 @@ else\ ...@@ -2155,7 +2155,7 @@ else\
- (void)dealloc - (void)dealloc
{ {
[o_scrollview release]; [o_tableview release];
[super dealloc]; [super dealloc];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment