mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Move window size fields to OSXWindow
This commit is contained in:
parent
580c900fb2
commit
9e44818cd8
@ -14,6 +14,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gfx/size.h"
|
||||
|
||||
class CloseDelegate {
|
||||
public:
|
||||
virtual ~CloseDelegate() { }
|
||||
@ -23,11 +25,15 @@ public:
|
||||
@interface OSXWindow : NSWindow
|
||||
{
|
||||
CloseDelegate* closeDelegate;
|
||||
gfx::Size clientSize;
|
||||
gfx::Size restoredSize;
|
||||
}
|
||||
- (OSXWindow*)init;
|
||||
- (void)dealloc;
|
||||
- (CloseDelegate*)closeDelegate;
|
||||
- (void)setCloseDelegate:(CloseDelegate*)aDelegate;
|
||||
- (gfx::Size)clientSize;
|
||||
- (gfx::Size)restoredSize;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
@ -78,6 +78,8 @@
|
||||
closeDelegate = nullptr;
|
||||
|
||||
NSRect rect = NSMakeRect(0, 0, 640, 480);
|
||||
clientSize.w = restoredSize.w = rect.size.width;
|
||||
clientSize.h = restoredSize.h = rect.size.height;
|
||||
|
||||
OSXWindowDelegate* windowDelegate = [[OSXWindowDelegate new] autorelease];
|
||||
[windowDelegate setEventQueue:she::instance()->eventQueue()];
|
||||
@ -113,4 +115,14 @@
|
||||
closeDelegate = aDelegate;
|
||||
}
|
||||
|
||||
- (gfx::Size)clientSize
|
||||
{
|
||||
return clientSize;
|
||||
}
|
||||
|
||||
- (gfx::Size)restoredSize
|
||||
{
|
||||
return restoredSize;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -21,8 +21,6 @@ public:
|
||||
bool closing;
|
||||
int scale;
|
||||
OSXWindow* window;
|
||||
gfx::Size clientSize;
|
||||
gfx::Size restoredSize;
|
||||
|
||||
Impl() {
|
||||
closing = false;
|
||||
@ -87,12 +85,12 @@ bool SkiaWindow::isMaximized() const
|
||||
|
||||
gfx::Size SkiaWindow::clientSize() const
|
||||
{
|
||||
return m_impl->clientSize;
|
||||
return m_impl->window.clientSize;
|
||||
}
|
||||
|
||||
gfx::Size SkiaWindow::restoredSize() const
|
||||
{
|
||||
return m_impl->restoredSize;
|
||||
return m_impl->window.restoredSize;
|
||||
}
|
||||
|
||||
void SkiaWindow::setTitle(const std::string& title)
|
||||
|
Loading…
Reference in New Issue
Block a user