Commit f7834c6d authored by Gleb Pinigin's avatar Gleb Pinigin

Implement menu button with resizable background

parent 07617d0e
//
// VLCMenuButton.h
// VLC for iOS
//
// Created by Gleb on 6/17/13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
// Refer to the COPYING file of the official project for license.
//
#import <UIKit/UIKit.h>
@interface VLCMenuButton : UIButton
@end
//
// VLCMenuButton.m
// VLC for iOS
//
// Created by Gleb on 6/17/13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
// Refer to the COPYING file of the official project for license.
//
#import "VLCMenuButton.h"
@implementation VLCMenuButton
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
UIImage *background = [[UIImage imageNamed:@"menuButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
[self setBackgroundImage:background forState:UIControlStateNormal];
}
return self;
}
@end
......@@ -2,9 +2,9 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">12E55</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -39,6 +39,7 @@
<string key="NSFrame">{{0, 20}, {320, 504}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor" id="651013553">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
......@@ -85,7 +86,7 @@
<object class="IBUIImageView" id="320706770">
<reference key="NSNextResponder" ref="338576143"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{71, 200}, {179, 60}}</string>
<string key="NSFrame">{{71, 202}, {179, 60}}</string>
<reference key="NSSuperview" ref="338576143"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="94556417"/>
......@@ -100,15 +101,15 @@
<object class="IBUIButton" id="94556417">
<reference key="NSNextResponder" ref="338576143"/>
<int key="NSvFlags">293</int>
<string key="NSFrame">{{128, 303}, {65, 44}}</string>
<string key="NSFrame">{{120, 303}, {81, 39}}</string>
<reference key="NSSuperview" ref="338576143"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Login</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
......@@ -227,8 +228,8 @@
<int key="objectID">8</int>
<reference key="object" ref="338576143"/>
<array class="NSMutableArray" key="children">
<reference ref="320706770"/>
<reference ref="94556417"/>
<reference ref="320706770"/>
</array>
<reference key="parent" ref="0"/>
</object>
......@@ -250,6 +251,7 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="20.CustomClassName">VLCMenuButton</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -266,25 +268,17 @@
<object class="IBPartialClassDescription">
<string key="className">VLCDropboxTableViewController</string>
<string key="superclassName">UITableViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="dismiss:">id</string>
<string key="folderUp:">id</string>
<string key="loginToDropboxAction:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="dismiss:">
<string key="name">dismiss:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="folderUp:">
<string key="name">folderUp:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="loginToDropboxAction:">
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">loginToDropboxAction:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">loginToDropboxAction:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">loginToDropboxAction:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="loginToDropboxButton">UIButton</string>
<string key="loginToDropboxView">UIView</string>
......@@ -304,6 +298,14 @@
<string key="minorKey">./Classes/VLCDropboxTableViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMenuButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCMenuButton.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
......
......@@ -2,9 +2,9 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">12E55</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -105,7 +105,7 @@
<object class="IBUIButton" id="209774297">
<reference key="NSNextResponder" ref="234033301"/>
<int key="NSvFlags">289</int>
<string key="NSFrame">{{200, 8}, {110, 44}}</string>
<string key="NSFrame">{{200, 11}, {110, 39}}</string>
<reference key="NSSuperview" ref="234033301"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1066205493"/>
......@@ -114,7 +114,6 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Télécharger</string>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="1064176833">
<int key="NSColorSpace">3</int>
......@@ -271,6 +270,7 @@
<string key="NSFrame">{{0, 127}, {320, 256}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
......@@ -513,6 +513,7 @@
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="68.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="69.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="72.CustomClassName">VLCMenuButton</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="73.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -592,6 +593,14 @@
<string key="minorKey">./Classes/VLCHTTPDownloadViewController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMenuButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCMenuButton.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
......
......@@ -2,9 +2,9 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">12E55</string>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -62,7 +62,7 @@
<object class="IBUITextField" id="554522247">
<reference key="NSNextResponder" ref="975400831"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{10, 15}, {222, 30}}</string>
<string key="NSFrame">{{10, 15}, {210, 30}}</string>
<reference key="NSSuperview" ref="975400831"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="504069026"/>
......@@ -103,7 +103,7 @@
<object class="IBUIButton" id="504069026">
<reference key="NSNextResponder" ref="975400831"/>
<int key="NSvFlags">289</int>
<string key="NSFrame">{{240, 8}, {70, 44}}</string>
<string key="NSFrame">{{228, 11}, {82, 39}}</string>
<reference key="NSSuperview" ref="975400831"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="981202834"/>
......@@ -112,7 +112,6 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Ouvrir</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
......@@ -447,6 +446,7 @@
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="7.CustomClassName">VLCMenuButton</string>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -459,6 +459,14 @@
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">VLCMenuButton</string>
<string key="superclassName">UIButton</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCMenuButton.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCOpenNetworkStreamViewController</string>
<string key="superclassName">UIViewController</string>
......
......@@ -233,6 +233,7 @@
A79246C5170F114E0036AAF2 /* VLCEmptyLibraryView~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = A79246C0170F114E0036AAF2 /* VLCEmptyLibraryView~iphone.xib */; };
A79246C8170F11DF0036AAF2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A79246C6170F11DF0036AAF2 /* Localizable.strings */; };
A7990064176E9352009E8267 /* libraryBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = A7990063176E9352009E8267 /* libraryBackground.png */; };
A7990067176E9CF3009E8267 /* VLCMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A7990066176E9CF3009E8267 /* VLCMenuButton.m */; };
A7A0E9F5174BA66000162F25 /* papasscode_background.png in Resources */ = {isa = PBXBuildFile; fileRef = A7A0E9ED174BA66000162F25 /* papasscode_background.png */; };
A7A0E9F6174BA66000162F25 /* papasscode_background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A7A0E9EE174BA66000162F25 /* papasscode_background@2x.png */; };
A7A0E9F7174BA66000162F25 /* papasscode_failed_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = A7A0E9EF174BA66000162F25 /* papasscode_failed_bg.png */; };
......@@ -610,6 +611,8 @@
A79246C7170F11DF0036AAF2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
A79246C9170F11E40036AAF2 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
A7990063176E9352009E8267 /* libraryBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = libraryBackground.png; sourceTree = "<group>"; };
A7990065176E9CF3009E8267 /* VLCMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCMenuButton.h; sourceTree = "<group>"; };
A7990066176E9CF3009E8267 /* VLCMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCMenuButton.m; sourceTree = "<group>"; };
A7A0E9ED174BA66000162F25 /* papasscode_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = papasscode_background.png; sourceTree = "<group>"; };
A7A0E9EE174BA66000162F25 /* papasscode_background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "papasscode_background@2x.png"; sourceTree = "<group>"; };
A7A0E9EF174BA66000162F25 /* papasscode_failed_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = papasscode_failed_bg.png; sourceTree = "<group>"; };
......@@ -918,6 +921,8 @@
7A50619E176E3D410036E15D /* UINavigationController+Theme.m */,
7A5061A0176E41160036E15D /* UIBarButtonItem+Theme.h */,
7A5061A1176E41160036E15D /* UIBarButtonItem+Theme.m */,
A7990065176E9CF3009E8267 /* VLCMenuButton.h */,
A7990066176E9CF3009E8267 /* VLCMenuButton.m */,
);
name = "UI Elements";
sourceTree = "<group>";
......@@ -1646,6 +1651,7 @@
7DB43835176E20CC00F460EE /* VLCHTTPDownloadViewController.m in Sources */,
7A50619F176E3D410036E15D /* UINavigationController+Theme.m in Sources */,
7A5061A2176E41160036E15D /* UIBarButtonItem+Theme.m in Sources */,
A7990067176E9CF3009E8267 /* VLCMenuButton.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
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