Parcourir la source

menu: draw speed optimizations

Felix Paul Kühne il y a 9 ans
Parent
commit
903c1bc416

+ 1 - 0
Sources/UIColor+Presets.h

@@ -19,5 +19,6 @@
 + (UIColor *)VLCLightTextColor;
 + (UIColor *)VLCDarkTextShadowColor;
 + (UIColor *)VLCOrangeTintColor;
++ (UIColor *)VLCMenuBackgroundColor;
 
 @end

+ 5 - 0
Sources/UIColor+Presets.m

@@ -34,6 +34,11 @@
     return [UIColor colorWithWhite:0. alpha:.25f];
 }
 
++ (UIColor *)VLCMenuBackgroundColor
+{
+    return [UIColor colorWithWhite:.17f alpha:1.];
+}
+
 + (UIColor *)VLCOrangeTintColor
 {
     return [UIColor colorWithRed:1.0f green:(132.0f/255.0f) blue:0.0f alpha:1.f];

+ 3 - 2
Sources/VLCMenuTableViewController.m

@@ -96,7 +96,7 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
                                                           style:UITableViewStylePlain];
     _menuTableView.delegate = self;
     _menuTableView.dataSource = self;
-    _menuTableView.backgroundColor = [UIColor clearColor];
+    _menuTableView.backgroundColor = [UIColor VLCMenuBackgroundColor];
     _menuTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
     _menuTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
     _menuTableView.rowHeight = rowHeight;
@@ -223,12 +223,13 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
     UIView *headerView = nil;
     if (headerText) {
         headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.height, HEADER_HEIGHT)];
+        headerView.backgroundColor = [UIColor VLCMenuBackgroundColor];
 
         UILabel *textLabel = [UILabel new];
         textLabel.text = headerText;
         textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:[UIFont systemFontSize]];
         textLabel.textColor = [UIColor whiteColor];
-        textLabel.backgroundColor = [UIColor clearColor];
+        textLabel.backgroundColor = [UIColor VLCMenuBackgroundColor];
         [textLabel sizeToFit];
         textLabel.translatesAutoresizingMaskIntoConstraints = NO;
         [headerView addSubview:textLabel];

+ 1 - 1
Sources/VLCSidebarController.m

@@ -68,7 +68,7 @@
 
 - (void)setContentViewController:(UIViewController *)contentViewController
 {
-    contentViewController.view.backgroundColor = [UIColor VLCDarkBackgroundColor];
+    contentViewController.view.backgroundColor = [UIColor VLCMenuBackgroundColor];
     _sideMenuViewController.contentViewController = contentViewController;
 }