Welcome message

This commit is contained in:
relikd
2019-08-11 12:45:06 +02:00
parent c717487b0e
commit b081564eca
12 changed files with 74 additions and 30 deletions

View File

@@ -338,7 +338,7 @@
// apply fitting size and display
self.view.warningPopover.contentSize = newSize;
[self.view.warningPopover showRelativeToRect:sender.bounds ofView:sender preferredEdge:NSRectEdgeMinY];
[self.view.warningPopover showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSRectEdgeMinY];
}
/// Either hit by Cmd+R or reload button inside warning popover error description

View File

@@ -70,23 +70,11 @@
/// Prepare popover controller to display errors during download
- (void)prepareWarningPopover {
NSPopover *pop = [[NSPopover alloc] init];
pop.behavior = NSPopoverBehaviorTransient;
pop.contentViewController = [[NSViewController alloc] init];
NSView *content = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 300, 100)];
pop.contentViewController.view = content;
self.warningPopover = [NSView popover: NSMakeSize(300, 100)];
NSView *content = self.warningPopover.contentViewController.view;
// User visible error description text (after click on warning button)
NSTextField *txt = [[[NSView label:@""] selectable] sizableWidthAndHeight];
txt.frame = NSInsetRect(content.frame, 4, 2);
txt.preferredMaxLayoutWidth = NSWidth(txt.frame);
txt.lineBreakMode = NSLineBreakByWordWrapping;
txt.maximumNumberOfLines = 7;
[content addSubview:txt];
self.warningPopover = pop;
self.warningText = txt;
self.warningText = [[[[[NSView label:@""] selectable] sizableWidthAndHeight]
multiline:NSMakeSize(292, 96)] placeIn:content x:4 y:2];
// Reload button is only visible on 5xx server error (right of )
self.warningReload = [[[[NSView buttonIcon:NSImageNameRefreshTemplate size:16] placeIn:content x:35 yTop:21]
tooltip:NSLocalizedString(@"Retry download (⌘R)", nil)]

View File

@@ -50,9 +50,7 @@
GrayLabel(NSLocalizedString(@"median:", nil)), [self createInlineButton:info[@"median"] callback:callback]];
NSView *buttonsView = [self placeViewsHorizontally:arr];
CGFloat w = NSWidth(buttonsView.frame);
if (w < NSWidth(dateView.frame))
w = NSWidth(dateView.frame);
CGFloat w = NSMaxWidth(dateView, buttonsView);
[self setFrameSize:NSMakeSize(w, NSHeight(buttonsView.frame) + PAD_M + NSHeight(dateView.frame))];
[dateView placeIn:self x:CENTER yTop:0];