Skip to content

Commit 7bfc907

Browse files
committed
PySide6 Screen Geometry
1 parent 911a471 commit 7bfc907

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

freecad/marz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# | along with Marz Workbench. If not, see <https://www.gnu.org/licenses/>. |
1919
# +---------------------------------------------------------------------------+
2020

21-
__version__ = "0.1.13"
21+
__version__ = "0.1.14"
2222
__author__ = "Frank David Martinez M <mnesarco at gmail.com>"
2323
__copyright__ = "Copyright (c) 2020, Frank David Martinez M."
2424
__license__ = "GPLv3"

freecad/marz/feature/widget_about.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ def __init__(self, frame=True, timeout=False):
3333
self.initUI()
3434

3535
def initUI(self):
36-
36+
3737
# Window
38-
sg = QtGui.QDesktopWidget().screenGeometry()
38+
try:
39+
sg = QtGui.QDesktopWidget().screenGeometry()
40+
except Exception:
41+
sg = QtGui.QGuiApplication.primaryScreen().availableGeometry()
3942
screenWidth = sg.width()
4043
screenHeight = sg.height()
4144
height = 350
@@ -45,7 +48,7 @@ def initUI(self):
4548
if not self.frame:
4649
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
4750
self.setFixedSize(self.size())
48-
51+
4952
# Layout
5053
layout = QtGui.QStackedLayout(self)
5154
layout.setAlignment(QtCore.Qt.AlignBottom)
@@ -66,20 +69,20 @@ def initUI(self):
6669
content.setAlignment(QtCore.Qt.AlignBottom | QtCore.Qt.AlignCenter)
6770
backgroundImage = paths.graphicsPath('logo.svg').replace('\\', '/') # Fix for windows paths
6871
content.setStyleSheet(f"""
69-
color: #eeeeee;
70-
font-size: 12px;
72+
color: #eeeeee;
73+
font-size: 12px;
7174
background-color: #101010;
7275
background: url("{backgroundImage}") no-repeat center top fixed;
7376
padding: 260px 10px 10px 10px;
7477
""")
7578
layout.addWidget(content)
76-
79+
7780
# Timer
7881
if self.timeout:
7982
QtCore.QTimer.singleShot(self.timeout, self.close)
8083

8184
self.show()
82-
85+
8386
def mousePressEvent(self, event):
8487
if event.button() == QtCore.Qt.LeftButton:
8588
self.close()

manifest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;* General identification metadata *
44
;***************************************************************************
55
[general]
6-
version=0.1.13
6+
version=0.1.14
77
name=Marz
88
title=Marz Guitar Design
99
description=Parametric Guitar Design

package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package format="1">
33
<name>Marz Workbench</name>
44
<description>Parametric Guitar design workbench</description>
5-
<version>0.1.13</version>
5+
<version>0.1.14</version>
66
<maintainer email="twitter: @mnesarco">Frank Martinez</maintainer>
77
<license file="LICENSE">GPL-3.0</license>
88
<url type="repository" branch="master">https://github.com/mnesarco/MarzWorkbench</url>
@@ -13,7 +13,7 @@
1313
<name>Marz Workbench</name>
1414
<classname>MarzWorkbench</classname>
1515
<description>Parametric Guitar design workbench.</description>
16-
<version>0.1.13</version>
16+
<version>0.1.14</version>
1717
<subdirectory>./</subdirectory>
1818
<icon>Resources/icons/Marz.svg</icon>
1919
<freecadmin>0.21.0</freecadmin>

0 commit comments

Comments
 (0)