Comments (6)
It gets shorter by the exact amount more you set titleBarHeight past the standard size (22).
from inappstorewindow.
Hmm, this sounds like it would be pretty difficult to fix, as the share sheet itself seems to be resizing the window. I don't think this could be resolved from within INAppStoreWindow, but maybe you could try fiddling around with the NSSharingServiceDelegate
method sharingService:sourceFrameOnScreenForShareItem:
:
from inappstorewindow.
After a bit of testing, sharingService:sourceFrameOnScreenForShareItem:
seems to determine only where the animation of the tweet window begins from, not the rect the shaded area works with.
from inappstorewindow.
I see, thanks for looking into it. I can't really think of a good way to fix this from within INAppStoreWindow. The sharing service picker itself is modifying the window somehow, in a way that INAppStoreWindow doesn't like. There's no code inside INAppStoreWindow to resize the window by itself, so what I'm assuming is that the picker uses the window's content/frame rects to calculate some geometry and screws up the calculations as a result of INAppStoreWindow modifying the content view frame.
I did a bit of quick testing by overriding NSWindow layout methods like -contentRectForFrameRect:
to see if any of those are called when the sheet appears, but they aren't. I'll keep thinking on this one, but if you discover a fix in the mean time, a pull request would be greatly appreciated!
from inappstorewindow.
This is actually caused by setting the styleMask property of the window, which is what NSSharingService is doing before the sharing modal is displayed and when it is dismissed.
You can reproduce this by replacing the code in the example's shareOnTwitter: action with:
-(IBAction)shareOnTwitter:(id)sender
{
[self.window setStyleMask:self.window.styleMask & ~NSResizableWindowMask];
[NSThread sleepForTimeInterval:1];
[self.window setStyleMask:self.window.styleMask | NSResizableWindowMask];
}
When that runs the window's height is reduced after both calls to setStyleMask.
The following is my work-around for the problem, maybe it gives someone an idea on how to fix the problem in INAppStoreWindow itself:
@implementation CustomINAppStoreWindow {
BOOL _preventResizing;
}
-(void)setFrame:(NSRect)frameRect display:(BOOL)flag {
if (_preventResizing)
return;
[super setFrame:frameRect display:flag];
}
-(void)setStyleMask:(NSUInteger)styleMask {
_preventResizing = YES;
[super setStyleMask:styleMask];
_preventResizing = NO;
}
@end
from inappstorewindow.
Awesome! Your fix is a good one and after trying it with Padraig's example project, it seems that the issue is resolved :) I'll merge this fix into master.
from inappstorewindow.
Related Issues (20)
- when click minButton to hidden the window, then reopen,move mouse to traffic button and remove mouse, the traffic button always show RollOverImage
- Exit full screen mode in Yosemite HOT 7
- dragging to another virtual desktop is not working
- window frame.height grows from start to start if autosave name is not empty, OS X 10.9.3
- README needs update
- setMovable flag doesn't work
- Box behind title Xcode 6.1 GM HOT 2
- Yosemite double click title bar to maximum window not working HOT 1
- Cocoa pod can't find INAppStoreWindow 1.5
- bad window button positioning on Yosemite HOT 4
- TitleTextColor changes only the Window Title !
- bad way to detect yosemite
- crash, creating window from code inherit INAppStoreWindow 10.10.1 HOT 3
- Window widgets are positioned incorrectly in document-based application when showing sheets HOT 2
- Graphite system appearance appears to be ignored
- Where do I start HOT 1
- AppleMiniaturizeOnDoubleClick Isn't working HOT 2
- Window flicker when drag in the original titlebar area and move to top of the screen
- Traffic light buttons HOT 2
- Every Time At the time of Launch : NSWindow warning: adding an unknown subview: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inappstorewindow.