Commit 60ab318b authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed wrong calculation of ModuleListConfigControl's size when drawn in the complete prefs

refs #3947
parent f6931951
/***************************************************************************** /*****************************************************************************
* prefs_widgets.m: Preferences controls * prefs_widgets.m: Preferences controls
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team * Copyright (C) 2002-2011 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Derk-Jan Hartman <hartman at videolan.org> * Authors: Derk-Jan Hartman <hartman at videolan.org>
...@@ -2146,10 +2146,10 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2146,10 +2146,10 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
withView: (NSView *)o_parent_view withView: (NSView *)o_parent_view
{ {
if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST ) if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
//TODO.... //TODO....
return nil; return nil;
//Fill our array to know how may items we have... //Fill our array to know how may items we have...
module_t *p_parser, **p_list; module_t *p_parser, **p_list;
size_t i_module_index; size_t i_module_index;
NSRect mainFrame = [o_parent_view frame]; NSRect mainFrame = [o_parent_view frame];
...@@ -2200,7 +2200,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2200,7 +2200,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
} }
module_list_free( p_list ); module_list_free( p_list );
mainFrame.size.height = 30 + 18 * [o_modulearray count]; mainFrame.size.height = 30 + 20 * [o_modulearray count];
mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN; mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
mainFrame.origin.x = LEFTMARGIN; mainFrame.origin.x = LEFTMARGIN;
mainFrame.origin.y = 0; mainFrame.origin.y = 0;
...@@ -2235,7 +2235,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2235,7 +2235,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[self addSubview: o_textfield]; [self addSubview: o_textfield];
{ {
NSRect s_rc = mainFrame; NSRect s_rc = mainFrame;
s_rc.size.height = mainFrame.size.height - 30; s_rc.size.height = mainFrame.size.height - 30;
s_rc.size.width = mainFrame.size.width - 12; s_rc.size.width = mainFrame.size.width - 12;
...@@ -2250,9 +2250,9 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2250,9 +2250,9 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
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];
/* TODO: find a good way to fix the row height and text size*/ /* TODO: find a good way to fix the row height and text size*/
/* FIXME: support for multiple selection... */ /* FIXME: support for multiple selection... */
// [o_tableview setAllowsMultipleSelection:YES]; // [o_tableview setAllowsMultipleSelection:YES];
NSCell *o_headerCell = [[NSCell alloc] initTextCell:@"Enabled"]; NSCell *o_headerCell = [[NSCell alloc] initTextCell:@"Enabled"];
NSCell *o_dataCell = [[NSButtonCell alloc] init]; NSCell *o_dataCell = [[NSButtonCell alloc] init];
...@@ -2273,7 +2273,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2273,7 +2273,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
initWithIdentifier:@"Module"]; initWithIdentifier:@"Module"];
[o_tableColumn setHeaderCell: o_headerCell]; [o_tableColumn setHeaderCell: o_headerCell];
[o_tableColumn setDataCell: o_dataCell]; [o_tableColumn setDataCell: o_dataCell];
[o_tableColumn setWidth:388 - 17]; [o_tableColumn setWidth:s_rc.size.width - 34];
[o_tableview addTableColumn: o_tableColumn]; [o_tableview addTableColumn: o_tableColumn];
[o_tableview registerForDraggedTypes:[NSArray arrayWithObjects: [o_tableview registerForDraggedTypes:[NSArray arrayWithObjects:
@"VLC media player module", nil]]; @"VLC media player module", nil]];
...@@ -2284,11 +2284,11 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2284,11 +2284,11 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_tableview sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask | [o_tableview sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |
NSLeftMouseDraggedMask]; NSLeftMouseDraggedMask];
[o_scrollview setDocumentView: o_tableview]; [o_scrollview setDocumentView: o_tableview];
} }
[o_scrollview setAutoresizingMask:NSViewWidthSizable ]; [o_scrollview setAutoresizingMask:NSViewWidthSizable ];
[o_scrollview setAutohidesScrollers:YES];
[self addSubview: o_scrollview]; [self addSubview: o_scrollview];
} }
return self; return self;
} }
......
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