[main] add funct to detect light or darkmode, unifinshed
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
from PySide6.QtCore import QSize, Qt
|
||||
from PySide6.QtWidgets import QMainWindow, QWidget, QToolBar, QMenu, QMenuBar, QSizePolicy, QFileDialog
|
||||
from PySide6.QtWidgets import QDialog, QVBoxLayout
|
||||
from PySide6.QtGui import QKeySequence, QAction, QIcon
|
||||
from PySide6.QtGui import QKeySequence, QAction, QIcon, QPalette
|
||||
|
||||
import fixtracks.resources
|
||||
from fixtracks.widgets.centralwidget import CentralWidget
|
||||
from fixtracks.dialogs.previewdialog import PreviewDialog
|
||||
from fixtracks.utils.reader import ImageReader, DataFrameReader
|
||||
from fixtracks.dialogs.about import AboutDialog
|
||||
from fixtracks.dialogs.help import HelpDialog
|
||||
import fixtracks.resources
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
def __init__(self, darkmode):
|
||||
super().__init__()
|
||||
self.create_actions()
|
||||
self._toolbar = None
|
||||
self._top_toolbar = None
|
||||
self._side_toolbar = None
|
||||
cw = CentralWidget()
|
||||
self.setCentralWidget(cw)
|
||||
self._iconsuffix = "_dark" if darkmode else "_light"
|
||||
# cw.exit_signal.connect(self.exit_request)
|
||||
|
||||
def create_actions(self):
|
||||
self._file_open_action = QAction(QIcon(":/icons/open"), "Open", self)
|
||||
self._file_open_action = QAction(QIcon(":/icons/open" + self._iconsuffix), "Open", self)
|
||||
self._file_open_action.setStatusTip("Open nix file")
|
||||
self._file_open_action.setShortcut(QKeySequence("Ctrl+o"))
|
||||
self._file_open_action.triggered.connect(self.on_file_open)
|
||||
@@ -103,7 +109,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
# settings = QSettings(info.ORGANIZATION, info.NAME)
|
||||
# tb_orientation = settings.value("app/toolbar_area", "left")
|
||||
# self.addToolBar(Qt.LeftToolBarArea if tb_orientation == "left" else Qt.TopToolBarArea, self._toolbar)
|
||||
self.addToolBar(Qt.LeftToolBarArea if tb_orientation == "left" else Qt.TopToolBarArea, self._toolbar)
|
||||
# self._toolbar.topLevelChanged.connect(self.tb_changed)
|
||||
# del settings
|
||||
|
||||
@@ -123,10 +129,12 @@ class MainWindow(QMainWindow):
|
||||
dlg.exec()
|
||||
|
||||
def on_about(self, s):
|
||||
pass
|
||||
about = AboutDialog(self)
|
||||
about.show()
|
||||
|
||||
def on_help(self, s):
|
||||
pass
|
||||
help = HelpDialog(self)
|
||||
help.show()
|
||||
|
||||
# @Slot(None)
|
||||
def exit_request(self):
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import pathlib
|
||||
from packaging.version import Version
|
||||
|
||||
organization_name = "de.bendalab"
|
||||
application_name = "FixTracks"
|
||||
application_version = Version("0.0.1")
|
||||
|
||||
|
||||
PACKAGE_ROOT = pathlib.Path(__file__).resolve().parent.parent
|
||||
DOCS_ROOT_FILE = pathlib.PosixPath.joinpath(PACKAGE_ROOT, "fixtracks", "docs", "index.md")
|
||||
Reference in New Issue
Block a user