mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Make finding the history/commit selector more robust.
Shouldn't assume that the selector is the first item in the toolbar; the user could have moved it.
This commit is contained in:
committed by
Johannes Gilger
parent
e5104b4069
commit
64dfd99089
@@ -112,7 +112,13 @@
|
||||
|
||||
- (void) useToolbar:(NSToolbar *)toolbar
|
||||
{
|
||||
NSSegmentedControl *item = (NSSegmentedControl *)[[[toolbar items] objectAtIndex:0] view];
|
||||
NSSegmentedControl *item = nil;
|
||||
for (NSToolbarItem *toolbarItem in [toolbar items]) {
|
||||
if ([[toolbarItem view] isKindOfClass:[NSSegmentedControl class]]) {
|
||||
item = (NSSegmentedControl *)[toolbarItem view];
|
||||
break;
|
||||
}
|
||||
}
|
||||
[item bind:@"selectedIndex" toObject:self withKeyPath:@"selectedViewIndex" options:0];
|
||||
|
||||
[self.window setToolbar:toolbar];
|
||||
|
||||
Reference in New Issue
Block a user