From a5d73ba07e76cd6022cd4937431a206f21056c86 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Wed, 7 Mar 2018 00:24:55 -0800 Subject: [PATCH] Implmement Niko walkoff a little more --- journal/unix/journal.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/journal/unix/journal.py b/journal/unix/journal.py index f874922..7b1e1d1 100644 --- a/journal/unix/journal.py +++ b/journal/unix/journal.py @@ -77,9 +77,19 @@ class Journal(QWidget): class Niko(QWidget): def __init__(self, *args, **kwargs): self.start_x, self.start_y = kwargs['start_x'], kwargs['start_y'] - del kwargs['start_x'], kwargs['start_y'] + self.screen_width, self.screen_height = kwargs['screen_width'], kwargs['screen_height'] + del kwargs['start_x'], kwargs['start_y'], kwargs['screen_width'], kwargs['screen_height'] super().__init__(*args, **kwargs) + + self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint) + self.setAttribute(Qt.WA_TranslucentBackground) + self.setAttribute(Qt.WA_NoSystemBackground) + self.setMouseTracking(True) + self.setWindowTitle('') + self.setMinimumSize(self.screen_width, self.screen_height) + self.setMaximumSize(self.screen_width, self.screen_height) + self.setGeometry(0, 0, self.screen_width, self.screen_height) self.frames = [QPixmap(os.path.join(base_path, 'images', 'niko{}.png'.format(n)) for n in range(1,4))] @@ -92,6 +102,10 @@ if __name__ == '__main__': if len(sys.argv) == 3: # "Niko-leaves-the-screen" mode x, y = int(sys.argv[1]), int(sys.argv[2]) + screensize = app.primaryScreen().size() + + niko = Niko(start_x = x, start_y = y, screen_width = screensize.width(), screen_height = screensize.height()) + else: # Author's Journal mode