Add initial GUI program
This commit is contained in:
parent
22a9c68611
commit
8d531b3304
3 changed files with 77 additions and 0 deletions
53
trovedb/qgui/main_window.py
Normal file
53
trovedb/qgui/main_window.py
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtGui import QAction, QKeySequence
|
||||
from PySide6.QtWidgets import (
|
||||
QLabel,
|
||||
QMainWindow,
|
||||
QSplitter,
|
||||
QStatusBar,
|
||||
QToolBar,
|
||||
QVBoxLayout,
|
||||
QWidget
|
||||
)
|
||||
|
||||
class TroveMainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Trove")
|
||||
|
||||
# ── Toolbar ──
|
||||
toolbar = QToolBar("Main")
|
||||
toolbar.setMovable(False)
|
||||
self.addToolBar(toolbar)
|
||||
|
||||
new_action = QAction("New", self)
|
||||
new_action.setShortcut(QKeySequence.StandardKey.New)
|
||||
toolbar.addAction(new_action)
|
||||
|
||||
save_action = QAction("Save", self)
|
||||
save_action.setShortcut(QKeySequence.StandardKey.Save)
|
||||
toolbar.addAction(save_action)
|
||||
|
||||
toolbar.addSeparator()
|
||||
|
||||
# ── Central layout ──
|
||||
central = QWidget()
|
||||
self.setCentralWidget(central)
|
||||
layout = QVBoxLayout(central)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setSpacing(0)
|
||||
|
||||
# Horizontal splitter: tree | editor
|
||||
splitter = QSplitter(Qt.Orientation.Horizontal)
|
||||
|
||||
self._note_browser = QLabel("Note Browser")
|
||||
splitter.addWidget(self._note_browser)
|
||||
|
||||
self._tool = QLabel("View/Edit Tool")
|
||||
splitter.addWidget(self._tool)
|
||||
|
||||
layout.addWidget(splitter, stretch=1)
|
||||
|
||||
# ── Status bar ──
|
||||
self.setStatusBar(QStatusBar())
|
||||
self.statusBar().showMessage("Ready")
|
||||
Loading…
Add table
Add a link
Reference in a new issue