Browse Source

iOS: Add round background effect on selected icons

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Soomin Lee 8 years ago
parent
commit
d36db583e7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Sources/VLCMultiSelectionMenuView.m

+ 5 - 1
Sources/VLCMultiSelectionMenuView.m

@@ -8,7 +8,7 @@
 
 
 #import "VLCMultiSelectionMenuView.h"
 #import "VLCMultiSelectionMenuView.h"
 
 
-#define buttonWidth 32.
+#define buttonWidth 35.
 #define buttonHeight 35.
 #define buttonHeight 35.
 #define spacer 8.
 #define spacer 8.
 
 
@@ -60,6 +60,8 @@
         _lockButton.frame = CGRectMake(spacer, 4. * spacer + buttonHeight * 3., buttonWidth, buttonHeight);
         _lockButton.frame = CGRectMake(spacer, 4. * spacer + buttonHeight * 3., buttonWidth, buttonHeight);
         [_lockButton addTarget:self action:@selector(lockAction:) forControlEvents:UIControlEventTouchUpInside];
         [_lockButton addTarget:self action:@selector(lockAction:) forControlEvents:UIControlEventTouchUpInside];
         _lockButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
         _lockButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
+        _lockButton.clipsToBounds = YES;
+        _lockButton.layer.cornerRadius = buttonWidth / 2;
         [self addSubview:_lockButton];
         [self addSubview:_lockButton];
 
 
         _shuffleButton = [UIButton buttonWithType:UIButtonTypeCustom];
         _shuffleButton = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -67,6 +69,8 @@
         _shuffleButton.frame = CGRectMake(spacer, spacer * 3 + buttonHeight * 3, buttonWidth, buttonHeight);
         _shuffleButton.frame = CGRectMake(spacer, spacer * 3 + buttonHeight * 3, buttonWidth, buttonHeight);
         [_shuffleButton addTarget:self action:@selector(shuffleAction:) forControlEvents:UIControlEventTouchUpInside];
         [_shuffleButton addTarget:self action:@selector(shuffleAction:) forControlEvents:UIControlEventTouchUpInside];
         _shuffleButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
         _shuffleButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
+        _shuffleButton.clipsToBounds = YES;
+        _shuffleButton.layer.cornerRadius = buttonWidth / 2;
         [self addSubview:_shuffleButton];
         [self addSubview:_shuffleButton];
     }
     }
     return self;
     return self;