mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Position the close button on right for Linux and macOS
This commit is contained in:
parent
23f53431c2
commit
870c9fc72c
1 changed files with 5 additions and 1 deletions
|
|
@ -16,6 +16,9 @@ else:
|
|||
pipe_path = '/tmp/oneshot-pipe'
|
||||
documents_path = os.path.expanduser('~/Documents')
|
||||
|
||||
left_close = False
|
||||
if sys.platform == "darwin": left_close = True
|
||||
|
||||
try: base_path = sys._MEIPASS
|
||||
except AttributeError: base_path = os.path.abspath('.')
|
||||
|
||||
|
|
@ -62,6 +65,7 @@ class Journal(QWidget):
|
|||
|
||||
self.close_label = QLabel(self)
|
||||
self.close_label.setPixmap(QPixmap(os.path.join(base_path, 'images', 'close.png')))
|
||||
if not left_close: self.close_label.move(776, 0) # X = 800-24
|
||||
|
||||
if "linux" in sys.platform: self.setWindowFlags(Qt.FramelessWindowHint)
|
||||
else: self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint | Qt.NoDropShadowWindowHint)
|
||||
|
|
@ -77,7 +81,7 @@ class Journal(QWidget):
|
|||
self.mousedown = True
|
||||
self.mousedownpos = event.pos()
|
||||
|
||||
if self.mousedownpos.x() <= 24 and self.mousedownpos.y() < 24:
|
||||
if ((left_close and self.mousedownpos.x() <= 24) or (not left_close and self.mousedownpos.x() >= 776)) and self.mousedownpos.y() < 24:
|
||||
self.app.quit()
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
|
|
|
|||
Loading…
Reference in a new issue