Add starting size dependent upon screen res.
This commit is contained in:
12
main.py
12
main.py
@@ -7,7 +7,8 @@ from pandas import read_csv
|
|||||||
from PyQt5.QtWidgets import (QMainWindow,
|
from PyQt5.QtWidgets import (QMainWindow,
|
||||||
QApplication,
|
QApplication,
|
||||||
QMessageBox,
|
QMessageBox,
|
||||||
qApp,)
|
qApp,
|
||||||
|
QDesktopWidget)
|
||||||
from PyQt5.QtGui import QPixmap
|
from PyQt5.QtGui import QPixmap
|
||||||
from PyQt5 import uic
|
from PyQt5 import uic
|
||||||
from PyQt5.QtCore import QFileInfo, QSize, Qt
|
from PyQt5.QtCore import QFileInfo, QSize, Qt
|
||||||
@@ -20,7 +21,7 @@ Ui_MainWindow, _ = uic.loadUiType(qt_creator_file)
|
|||||||
|
|
||||||
class MyApp(QMainWindow, Ui_MainWindow):
|
class MyApp(QMainWindow, Ui_MainWindow):
|
||||||
Band = namedtuple("Band", ["lower", "upper"])
|
Band = namedtuple("Band", ["lower", "upper"])
|
||||||
ELF = Band(3, 30)
|
ELF = Band(3, 30)
|
||||||
SLF = Band(30, 300)
|
SLF = Band(30, 300)
|
||||||
ULF = Band(300, 3000)
|
ULF = Band(300, 3000)
|
||||||
VLF = Band(3000, 30000)
|
VLF = Band(3000, 30000)
|
||||||
@@ -37,6 +38,7 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
self.set_initial_size()
|
||||||
self.show()
|
self.show()
|
||||||
self.actionExit.triggered.connect(qApp.quit)
|
self.actionExit.triggered.connect(qApp.quit)
|
||||||
self.db_version = None
|
self.db_version = None
|
||||||
@@ -99,6 +101,12 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
BandLabel(self.ehf_left, self.ehf, self.ehf_right),
|
BandLabel(self.ehf_left, self.ehf, self.ehf_right),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def set_initial_size(self):
|
||||||
|
d = QDesktopWidget().availableGeometry()
|
||||||
|
w = d.width()
|
||||||
|
h = d.height()
|
||||||
|
self.setGeometry(50, 50, (3 * w) // 4, (3 * h) // 4)
|
||||||
|
|
||||||
def load_db(self):
|
def load_db(self):
|
||||||
names = ["name",
|
names = ["name",
|
||||||
"inf_freq",
|
"inf_freq",
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ QTabBar::tab:!selected {
|
|||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:20pt; font-weight:600; font-style:normal;">
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:20pt; font-weight:600; font-style:normal;">
|
||||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:15pt;">No signal</span></p></body></html></string>
|
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">No Signal</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user