Browse Source

local network: searchBar with VLCOrangeTintColor

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Pierre SAGASPE 10 years ago
parent
commit
d843f32b4d

+ 6 - 0
Sources/VLCLocalPlexFolderListViewController.m

@@ -91,6 +91,12 @@
     self.title = titleValue;
 
     _searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
+    UINavigationBar *navBar = self.navigationController.navigationBar;
+    if (SYSTEM_RUNS_IOS7_OR_LATER)
+        _searchBar.barTintColor = navBar.barTintColor;
+    _searchBar.tintColor = navBar.tintColor;
+    _searchBar.translucent = navBar.translucent;
+    _searchBar.opaque = navBar.opaque;
     _searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:_searchBar contentsController:self];
     _searchDisplayController.delegate = self;
     _searchDisplayController.searchResultsDataSource = self;

+ 6 - 0
Sources/VLCLocalServerFolderListViewController.m

@@ -145,6 +145,12 @@
     self.title = _listTitle;
 
     _searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
+    UINavigationBar *navBar = self.navigationController.navigationBar;
+    if (SYSTEM_RUNS_IOS7_OR_LATER)
+        _searchBar.barTintColor = navBar.barTintColor;
+    _searchBar.tintColor = navBar.tintColor;
+    _searchBar.translucent = navBar.translucent;
+    _searchBar.opaque = navBar.opaque;
     _searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:_searchBar contentsController:self];
     _searchDisplayController.delegate = self;
     _searchDisplayController.searchResultsDataSource = self;

+ 2 - 0
Sources/VLCPlaylistViewController.m

@@ -213,6 +213,8 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
     UINavigationBar *navBar = self.navigationController.navigationBar;
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
         _searchBar.barTintColor = navBar.barTintColor;
+        // cancel button tint color of UISearchBar with white color
+        [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
     }
     _searchBar.tintColor = navBar.tintColor;
     _searchBar.translucent = navBar.translucent;