Commit 04a56126 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

UI/UX: fix account selection

Change-Id: I72597323ff40f9a86aa3447325085f91f60efd95
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 3164fb0b
......@@ -40,6 +40,10 @@
#import "utils.h"
#import "views/NSColor+RingTheme.h"
@interface NSMenu ()
- (void) _setHasPadding: (BOOL) pad onEdge: (int) whatEdge;
@end
@interface ChooseAccountVC () <NSMenuDelegate>
@end
......@@ -73,6 +77,11 @@ NSMenuItem* selectedMenuItem;
profileImage.layer.backgroundColor = [[NSColor ringGreyLight] CGColor];
accountsMenu = [[NSMenu alloc] initWithTitle:@""];
if ([accountsMenu respondsToSelector: @selector(_setHasPadding:onEdge:)])
{
[accountsMenu _setHasPadding: NO onEdge: 1];
[accountsMenu _setHasPadding: NO onEdge: 3];
}
[accountsMenu setDelegate:self];
accountSelectionButton.menu = accountsMenu;
[accountSelectionButton setAutoenablesItems:NO];
......@@ -160,7 +169,6 @@ NSMenuItem* selectedMenuItem;
}
[menuBarItem setView:itemView];
[accountsMenu addItem:menuBarItem];
[accountsMenu addItem:[NSMenuItem separatorItem]];
}
// create "add a new account" menu item
......@@ -312,7 +320,7 @@ NSMenuItem* selectedMenuItem;
#pragma mark - NSPopUpButton item selection
- (IBAction)itemChanged:(id)sender {
NSInteger row = [(NSPopUpButton *)sender indexOfSelectedItem] / 2;
NSInteger row = [(NSPopUpButton *)sender indexOfSelectedItem];
auto accList = accMdl_->getAccountList();
if (row >= accList.size())
return;
......
This diff is collapsed.
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