diff --git a/pytest_gui_status/status_gui/gui_backend.py b/pytest_gui_status/status_gui/gui_backend.py index 597787d..3f056e3 100644 --- a/pytest_gui_status/status_gui/gui_backend.py +++ b/pytest_gui_status/status_gui/gui_backend.py @@ -24,11 +24,6 @@ class Controller(htmlPy.Object): "minimal": "minimal.html", } - dict_tmpl_size = { - "default": (150, 80), - "minimal": (50, 50) - } - def __init__(self, app_gui): super(Controller, self).__init__() self.i = 0 @@ -40,10 +35,6 @@ class Controller(htmlPy.Object): raise TypeError("template name must be valid, one of these: {allowed_tmpl_names}".format( allowed_tmpl_names=(", ".join(self.dict_tmpl.keys())))) - # set correct width, height - # self.app_gui.window.minimumWidth, self.app_gui.window.minimumHeight = (0, 0) - self.app_gui.width, self.app_gui.height = self.dict_tmpl_size.get(self.app_gui.tmpl_name) - @htmlPy.Slot() def redraw(self): redis_db = redis.StrictRedis(host='localhost', port=REDIS_PORT, db=0) diff --git a/pytest_gui_status/status_gui/gui_frontend.py b/pytest_gui_status/status_gui/gui_frontend.py index ed3f189..636df06 100644 --- a/pytest_gui_status/status_gui/gui_frontend.py +++ b/pytest_gui_status/status_gui/gui_frontend.py @@ -8,6 +8,11 @@ import argparse # Import back-end functionalities from gui_backend import Controller +dict_tmpl_size = { + "default": (150, 80), + "minimal": (50, 50) +} + def main(): arg_parser = argparse.ArgumentParser() @@ -32,7 +37,10 @@ def main(): app.window.setWindowFlags(QtCore.Qt.WindowTitleHint) # app.window.setWindowFlags(app.window.windowFlags() & ~QtCore.Qt.WindowMaximizeButtonHint) app.window.setWindowFlags(app.window.windowFlags() | QtCore.Qt.WindowStaysOnTopHint) + app.tmpl_name = app_tmpl + # set correct width, height + app.width, app.height = dict_tmpl_size.get(app.tmpl_name) screen_geo = QApplication.desktop().availableGeometry() screen_topright = screen_geo.topRight() app.x_pos = (screen_topright.x() - 20) - app.width @@ -43,7 +51,6 @@ def main(): app.static_path = os.path.join(BASE_DIR, "static/") app.template_path = os.path.join(BASE_DIR, "tmpl/") app.dir_name = dir_name - app.tmpl_name = app_tmpl # Register back-end functionalities # allow minimal tmpl with sys.arg