Commit cc306d36 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed alignment issues in the main window's bottom bar

parent a587c752
...@@ -253,6 +253,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -253,6 +253,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
else else
[self setContentMinSize:NSMakeSize(604., 288.)]; [self setContentMinSize:NSMakeSize(604., 288.)];
[self setTitle: _NS("VLC media player")]; [self setTitle: _NS("VLC media player")];
[o_time_fld setAlignment: NSCenterTextAlignment];
[o_time_fld setNeedsDisplay:YES];
[o_playlist_btn setEnabled:NO]; [o_playlist_btn setEnabled:NO];
o_temp_view = [[NSView alloc] init]; o_temp_view = [[NSView alloc] init];
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
...@@ -260,8 +262,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -260,8 +262,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_left_split_view setFrame: [o_sidebar_view frame]]; [o_left_split_view setFrame: [o_sidebar_view frame]];
if (OSX_LION && b_nativeFullscreenMode) if (OSX_LION && b_nativeFullscreenMode)
{ {
[self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
NSRect frame; NSRect frame;
[self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
float f_width = [o_fullscreen_btn frame].size.width; float f_width = [o_fullscreen_btn frame].size.width;
#define moveItem( item ) \ #define moveItem( item ) \
......
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
{ {
NSShadow * o_string_shadow; NSShadow * o_string_shadow;
NSDictionary * o_string_attributes_dict; NSDictionary * o_string_attributes_dict;
NSTextAlignment textAlignment;
} }
- (BOOL)timeRemaining; - (BOOL)timeRemaining;
......
...@@ -727,9 +727,16 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -727,9 +727,16 @@ void _drawFrameInRect(NSRect frameRect)
else else
o_string_color = [NSColor colorWithCalibratedRed:0.64 green:0.64 blue:0.64 alpha:100.0]; o_string_color = [NSColor colorWithCalibratedRed:0.64 green:0.64 blue:0.64 alpha:100.0];
textAlignment = NSCenterTextAlignment;
o_string_attributes_dict = [[NSDictionary dictionaryWithObjectsAndKeys: o_string_color, NSForegroundColorAttributeName, [NSFont titleBarFontOfSize:10.0], NSFontAttributeName, nil] retain]; o_string_attributes_dict = [[NSDictionary dictionaryWithObjectsAndKeys: o_string_color, NSForegroundColorAttributeName, [NSFont titleBarFontOfSize:10.0], NSFontAttributeName, nil] retain];
} }
- (void)setAlignment:(NSTextAlignment)alignment
{
textAlignment = alignment;
[self setStringValue:[self stringValue]];
}
- (void)dealloc - (void)dealloc
{ {
[o_string_shadow release]; [o_string_shadow release];
...@@ -750,7 +757,7 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -750,7 +757,7 @@ void _drawFrameInRect(NSRect frameRect)
NSUInteger i_stringLength = [string length]; NSUInteger i_stringLength = [string length];
[o_attributed_string addAttribute: NSShadowAttributeName value: o_string_shadow range: NSMakeRange(0, i_stringLength)]; [o_attributed_string addAttribute: NSShadowAttributeName value: o_string_shadow range: NSMakeRange(0, i_stringLength)];
[o_attributed_string setAlignment: NSRightTextAlignment range: NSMakeRange(0, i_stringLength)]; [o_attributed_string setAlignment: textAlignment range: NSMakeRange(0, i_stringLength)];
[self setAttributedStringValue: o_attributed_string]; [self setAttributedStringValue: o_attributed_string];
[o_attributed_string release]; [o_attributed_string release];
} }
......
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