Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI improvements #346

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading