forked from beeware/toga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.py
41 lines (33 loc) · 1.25 KB
/
window.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pytest
from toga_iOS.libs import UIApplication, UIWindow
from .dialogs import DialogsMixin
from .probe import BaseProbe
class WindowProbe(BaseProbe, DialogsMixin):
def __init__(self, app, window):
super().__init__()
self.app = app
self.window = window
self.impl = window._impl
self.native = window._impl.native
assert isinstance(self.native, UIWindow)
async def wait_for_window(self, message, minimize=False, full_screen=False):
await self.redraw(message)
@property
def content_size(self):
# Content height doesn't include the status bar or navigation bar.
return (
self.native.contentView.frame.size.width,
self.native.contentView.frame.size.height
- (
UIApplication.sharedApplication.statusBarFrame.size.height
+ self.native.rootViewController.navigationBar.frame.size.height
),
)
@property
def top_bar_height(self):
return (
UIApplication.sharedApplication.statusBarFrame.size.height
+ self.native.rootViewController.navigationBar.frame.size.height
)
def has_toolbar(self):
pytest.skip("Toolbars not implemented on iOS")