return scaled;
}
-static NSString *$getTheme$(NSArray *files) {
+static NSString *$getTheme$(NSArray *files, NSArray *themes = Themes_) {
if (NSString *path = [Themed_ objectForKey:files])
return reinterpret_cast<id>(path) == [NSNull null] ? nil : path;
return nil;
NSString *paper($getTheme$(Wallpapers_));
+ if (paper != nil)
+ paper = [paper stringByDeletingLastPathComponent];
{
size_t size;
_release(WallpaperPage_);
_release(WallpaperURL_);
- if (NSString *path = paper) {
- if ([path hasSuffix:@".mp4"]) {
+ if (paper != nil) {
+ NSArray *themes([NSArray arrayWithObject:paper]);
+
+ if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Wallpaper.mp4"], themes)) {
#if UseAVController
NSError *error;
[indirect addSubview:video];
}
- if ([path hasSuffix:@".png"] || [path hasSuffix:@".jpg"]) {
+ if (NSString *path = $getTheme$([NSArray arrayWithObjects:@"Wallpaper@2x.png", @"Wallpaper@2x.jpg", @"Wallpaper.png", @"Wallpaper.jpg", nil], themes)) {
if (UIImage *image = $getImage$(path)) {
WallpaperFile_ = [path retain];
WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
}
}
- if ([path hasSuffix:@".html"]) {
+ if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Wallpaper@.html"], themes)) {
CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);