Skip to content

Commit

Permalink
Merge pull request #346 from tinymovr/studio/gui_improvements
Browse files Browse the repository at this point in the history
GUI improvements
  • Loading branch information
yconst authored Apr 29, 2024
2 parents 933cf1b + 4e7a77c commit 3fd5682
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions studio/Python/Manifest.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include README.md
include tinymovr/resources/icons/app_icon.png
include tinymovr/resources/icons/call.png
include tinymovr/resources/icons/call_dark.png
include tinymovr/resources/icons/[email protected]
Expand Down
7 changes: 7 additions & 0 deletions studio/Python/tinymovr/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
import sys
import yaml
import pkg_resources
from importlib_resources import files
from docopt import docopt
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon, QPixmap
from tinymovr.gui import MainWindow, app_stylesheet, app_stylesheet_dark, is_dark_mode
from tinymovr.constants import app_name
from tinymovr.config import configure_logging, add_spec
Expand Down Expand Up @@ -54,10 +56,15 @@ def spawn():
add_spec(spec_data, logger)

app = QApplication(sys.argv)

icon_path = files("tinymovr").joinpath("resources/icons/app_icon.png")
app.setWindowIcon(QIcon(str(icon_path)))

if is_dark_mode():
app.setStyleSheet(app_stylesheet_dark)
else:
app.setStyleSheet(app_stylesheet)
w = MainWindow(app, arguments, logger)

w.show()
sys.exit(app.exec_())
2 changes: 2 additions & 0 deletions studio/Python/tinymovr/gui/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@

app_stylesheet_dark = """
QSplitter::handle { background-color: black; }
/* --------------------------------------- QPushButton -----------------------------------*/
QPushButton {
Expand Down
13 changes: 10 additions & 3 deletions studio/Python/tinymovr/gui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
QLabel,
QMessageBox,
QTreeWidgetItem,
QSplitter
)
from PySide6.QtGui import QAction
import pyqtgraph as pg
Expand Down Expand Up @@ -110,6 +111,10 @@ def __init__(self, app, arguments, logger):
self.status_label = QLabel()
self.status_label.setStyleSheet("margin: 5px;")

# Create splitter and add frames
self.splitter = QSplitter(QtCore.Qt.Horizontal)
self.splitter.setHandleWidth(0)

self.left_frame = QFrame(self)
self.left_layout = QVBoxLayout()
self.left_layout.addWidget(self.tree_widget)
Expand All @@ -127,9 +132,11 @@ def __init__(self, app, arguments, logger):
self.right_layout.setContentsMargins(0, 0, 0, 0)
self.right_frame.setLayout(self.right_layout)

main_layout = QHBoxLayout()
main_layout.addWidget(self.left_frame)
main_layout.addWidget(self.right_frame)
self.splitter.addWidget(self.left_frame)
self.splitter.addWidget(self.right_frame)

main_layout = QVBoxLayout()
main_layout.addWidget(self.splitter)
main_layout.setSpacing(0)
main_layout.setContentsMargins(0, 0, 0, 0)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3fd5682

Please sign in to comment.