Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 20 for good #22

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
deef80c
Add podspec for Cocoapods
Feb 12, 2013
c00c9e0
Update podspec
Feb 12, 2013
b6fa7ef
Podspec: add QuartzCore in required frameworks
Feb 12, 2013
dd5a264
Merge pull request #6 from thibaut-jarosz/master
indragiek Feb 13, 2013
e3c313d
Bugfix when using ARC
Feb 22, 2013
ab3ebe2
Merge pull request #8 from thibaut-jarosz/master
indragiek Feb 23, 2013
b16c9d0
Bugfix: crash then using ARC and no animation
Feb 27, 2013
22ce1b9
Merge pull request #9 from thibaut-jarosz/master
indragiek Feb 27, 2013
287a7d3
Fixed border drawing glitch
Mar 6, 2013
e59de64
Merge pull request #10 from thibaut-jarosz/master
indragiek Mar 6, 2013
a563333
Fix error when using ARC
Apr 28, 2013
34032ac
Merge pull request #13 from Serahug/master
indragiek Apr 30, 2013
72d35d7
Fix popover animation on Mavericks
indragiek Jan 5, 2014
545fdef
Update .gitignore
indragiek Jan 5, 2014
29ea387
Cleanup directory structure, update build settings
indragiek Jan 5, 2014
c9f3399
Remove old files
indragiek Jan 5, 2014
f9e89de
Update README
indragiek Jan 5, 2014
0b0f4b2
Add alpha setting support to colour wells in sample app
indragiek Jan 12, 2014
61d1a7b
Update README
indragiek Jan 12, 2014
d34b87e
Modernized Objective-C
indragiek Jan 12, 2014
2155176
Remove all MRC conditionals
indragiek Jan 12, 2014
0d63165
retain -> strong
indragiek Jan 12, 2014
b0b8f88
Move license to LICENSE file, update copyright
indragiek Jan 12, 2014
a0cda2b
Add arrowSize and cornerRadius properties
indragiek Jan 12, 2014
126ec6c
Style
indragiek Jan 12, 2014
80b6676
Reformat code
indragiek Jan 12, 2014
35aa58d
Update README
indragiek Jan 12, 2014
c0d2567
Fix window activation behaviour
indragiek Jan 12, 2014
2a23660
Add animationType property
indragiek Jan 12, 2014
ff9406c
Fix popover inset
indragiek Jan 13, 2014
4b06722
Only draw border if borderWidth > 0
indragiek Jan 13, 2014
aa2d43e
Fixed source files location in podspec.
tomaz Mar 21, 2014
d00abd0
Merge pull request #16 from tomaz/master
indragiek Mar 28, 2014
f530925
Added option to close popover when escape key is pressed.
tomaz Apr 3, 2014
2978287
Merge pull request #17 from tomaz/master
indragiek Apr 13, 2014
b524902
copy/paste fail
Jun 20, 2014
3564f98
Merge pull request #19 from TaikiMMT/patch-1
indragiek Jun 20, 2014
1fbbc6f
Add space to draw the whole border
Jun 20, 2014
6abc8e4
Update the content view's position
Jun 20, 2014
7ad59ee
Resize window, but still weird issues when border width is over 20
Taiki-San Jun 21, 2014
7865a8e
Additionnal fixes, however, the _popoverContentView is still out of c…
Taiki-San Jun 21, 2014
3ea2a1c
Origin seems fixed, still have to control the size
Taiki-San Jun 21, 2014
c7e10ff
Yay, size under control. Now, need some large cleanups and comments
Taiki-San Jun 21, 2014
ea2350e
Comments
Taiki-San Jun 21, 2014
a1b34b7
Fix an issue when updating several times in a row
Taiki-San Jun 21, 2014
fc0b7e0
Fix some centering issues
Taiki-San Jul 23, 2014
2a25b3f
Upgrade to Xcode 7, enable a lot of warnings and fix them, restrict t…
Taiki-San Jul 28, 2015
dc74609
Silence warnings, and add hook points
Taiki-San Jul 28, 2015
e32d926
Probably merge the change to get the arrow to move to the changes mad…
Taiki-San Oct 17, 2015
5b7f6eb
Tweak line breaking convention
Taiki-San Oct 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resize window, but still weird issues when border width is over 20
  • Loading branch information
Taiki-San committed Jun 21, 2014
commit 7ad59eed0470e70aec38a73ec6cb7bf0dcfe0304
3 changes: 3 additions & 0 deletions INPopoverController/INPopoverController.m
Original file line number Diff line number Diff line change
@@ -241,6 +241,8 @@ - (void)setColor:(NSColor *)newColor
- (void)setBorderWidth:(CGFloat)newBorderWidth
{
_popoverWindow.frameView.borderWidth = newBorderWidth;
[_popoverWindow updateWindowSize];
[_popoverWindow updateContentViewOrigin];
}

- (void)setBorderColor:(NSColor *)newBorderColor
@@ -285,6 +287,7 @@ - (void)setContentSize:(NSSize)newContentSize
- (void)_setArrowDirection:(INPopoverArrowDirection)direction
{
_popoverWindow.frameView.arrowDirection = direction;
[_popoverWindow updateContentViewOrigin];
}

#pragma mark -
3 changes: 3 additions & 0 deletions INPopoverController/INPopoverWindow.h
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@
@property (nonatomic, assign) INPopoverController *popoverController;
@property (nonatomic, strong) NSView *popoverContentView;

- (void) updateWindowSize;
- (void) updateContentViewOrigin;

- (void)presentAnimated;
- (void)dismissAnimated;

9 changes: 9 additions & 0 deletions INPopoverController/INPopoverWindow.m
Original file line number Diff line number Diff line change
@@ -91,6 +91,15 @@ - (void)setPopoverContentView:(NSView *)aView
[frameView addSubview:_popoverContentView];
}

- (void) updateWindowSize
{
const CGFloat inset = self.frameView.cornerRadius + self.frameView.arrowSize.height + self.frameView.borderWidth;
const NSRect frame = NSInsetRect(_popoverContentView.frame, inset, inset);

[self setFrame:frame display:NO];
[self.contentView setFrameSize:frame.size];
}

- (void) updateContentViewOrigin
{
if(_popoverContentView == nil || self.popoverController == nil || !self.popoverController.borderWidth) return;