-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.py
37 lines (30 loc) · 914 Bytes
/
App.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
from Config import *
from AppWindow import AppWindow
class App(object):
def __init__(self, launcher, app_details):
self.launcher = launcher
self.exec_path, self.icon_path = app_details
self.window = AppWindow(self)
self.is_running = False
def move(self, x, y):
self.window.move(x, y)
def show(self):
self.launcher.show_app(self)
self.window.show()
self.window.set_keep_above(True)
def hide(self):
self.launcher.hide_app(self)
self.window.hide()
def close(self):
self.launcher.close_app(self)
def focus(self):
self.launcher.focus_app(self)
def set_running(self, is_running):
if self.is_running == is_running:
return False
if is_running:
self.show()
else:
self.hide()
self.is_running = is_running
return True