diff --git a/LuLu/App/AlertWindow.xib b/LuLu/App/AlertWindow.xib index 8b18a31..f576704 100644 --- a/LuLu/App/AlertWindow.xib +++ b/LuLu/App/AlertWindow.xib @@ -1,8 +1,8 @@ - + - + @@ -40,7 +40,7 @@ - + @@ -235,7 +235,7 @@ - + diff --git a/LuLu/App/AlertWindowController.m b/LuLu/App/AlertWindowController.m index c231ac5..dae604a 100644 --- a/LuLu/App/AlertWindowController.m +++ b/LuLu/App/AlertWindowController.m @@ -73,6 +73,9 @@ -(void)windowDidLoad //title attributes (for temporary label) NSMutableDictionary* titleAttributes = nil; + //width + NSUInteger width = 0; + //init paragraph style paragraphStyle = [[NSMutableParagraphStyle alloc] init]; @@ -107,11 +110,15 @@ -(void)windowDidLoad //alert message self.alertMessage.stringValue = [NSString stringWithFormat:@"is trying to connect to %@", remoteAddress]; + //and set a tool tip + // as super long URLs can be truncated + self.alertMessage.toolTip = [NSString stringWithFormat:@"remote address: %@", remoteAddress]; + /* BOTTOM */ //process pid self.processID.stringValue = [self.alert[KEY_PROCESS_ID] stringValue]; - + //process args // none? means error if(0 == [self.alert[KEY_PROCESS_ARGS] count]) @@ -192,6 +199,13 @@ -(void)windowDidLoad //show touch bar [self initTouchBar]; + //width of alert + // max of standard window size, or size of alert msg + padding for addition items + width = MAX(self.window.frame.size.width, self.alertMessage.intrinsicContentSize.width+400); + + //resize to handle size of alert + [self.window setFrame:NSMakeRect(self.window.frame.origin.x, self.window.frame.origin.y, width, NSHeight(self.window.frame)) display:YES]; + bail: return;