Reusable dark-themed PyQt5 components for Scientific Instruments tools
Project description
si-ui
Reusable dark-themed PyQt5 components for Scientific Instruments desktop tools.
Built on a Catppuccin Mocha-inspired colour palette, si-ui gives every SI app a consistent, modern look out of the box.
Features
| Component | Description |
|---|---|
apply_dark_theme(app) |
Apply the Fusion dark palette to any QApplication |
SI_DARK_STYLE |
Comprehensive QSS stylesheet (buttons, inputs, tables, scrollbars, …) |
COLORS |
Dict of named Catppuccin Mocha hex values |
SplashScreen |
Animated GIF (or text-fallback) splash window |
PlotCanvas |
Dark-themed matplotlib FigureCanvas with scatter-point tracking |
SIBaseApp |
Three-panel QMainWindow base class with convenience helpers |
Installation
pip install si-ui
Local / editable install
git clone https://github.com/<your-org>/si_ui.git
cd si_ui
pip install -e .
Quick Start
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from si_ui import apply_dark_theme, SI_DARK_STYLE, SIBaseApp
class MyTool(SIBaseApp):
def create_left_panel(self) -> QWidget:
panel, layout = self.make_panel()
layout.addWidget(QLabel("Inputs go here"))
layout.addStretch()
return panel
def create_center_panel(self) -> QWidget:
panel, layout = self.make_panel()
layout.addWidget(QLabel("Main content"))
layout.addStretch()
return panel
def create_right_panel(self) -> QWidget:
panel, layout = self.make_panel()
layout.addWidget(QLabel("Results"))
layout.addStretch()
return panel
app = QApplication(sys.argv)
apply_dark_theme(app)
window = MyTool(title="My SI Tool", min_size=(1000, 550))
window.show()
sys.exit(app.exec_())
Splash Screen
from si_ui import SplashScreen
splash = SplashScreen(
title="MY APP",
subtitle="Loading…",
gif_data=base64_gif_string, # or None for text fallback
)
splash.finished.connect(show_main_window)
splash.show()
Plot Canvas
from si_ui import PlotCanvas
canvas = PlotCanvas(parent=self, width=6, height=4,
xlabel="Frequency (Hz)", ylabel="Impedance (Ω)")
canvas.axes.plot(x_data, y_data, color=canvas.line_color)
canvas.add_point(x, y) # highlighted scatter point
canvas.draw()
Requirements
- Python ≥ 3.10
- PyQt5 ≥ 5.15
- matplotlib ≥ 3.5
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
si_ui-1.0.1.tar.gz
(9.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
si_ui-1.0.1-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file si_ui-1.0.1.tar.gz.
File metadata
- Download URL: si_ui-1.0.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71d1b3c5fa0e7c15fbd9c927a1841d4c2d1d62037f9ea4f8ec2b0aa319e0019a
|
|
| MD5 |
c2d1e2591ede631d9d3bcc5ceb45a0bf
|
|
| BLAKE2b-256 |
a24671b671712161d35f38f8d023a6a5e87a93e65a80f6de8feac45e5ba991cb
|
File details
Details for the file si_ui-1.0.1-py3-none-any.whl.
File metadata
- Download URL: si_ui-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f820d8d87b8892eca19dafb2fe1823a93526a4fcf9f8f9f4863f8da3d7669cdc
|
|
| MD5 |
d5c2d21ba4a55fc89ac3294731000acc
|
|
| BLAKE2b-256 |
51afa13d5fa1df1a7569b76fd41c105596a045cb4301ddca6e926f27379bc502
|