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