init
This commit is contained in:
commit
c9ab51738b
134
.gitignore
vendored
Normal file
134
.gitignore
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
#
|
||||
config/cert/
|
||||
test_modules/
|
||||
config/SSL/fullchain.pem
|
||||
config/SSL/privkey.pem
|
||||
logs/
|
||||
SECRET_KEY.key
|
||||
|
||||
repository/achievement_repository.py
|
||||
service/achievement_service.py
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
pip-wheel-metadata/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.autopep8",
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
}
|
||||
0
assets/icons/.gitinit
Normal file
0
assets/icons/.gitinit
Normal file
65
main.py
Normal file
65
main.py
Normal file
@ -0,0 +1,65 @@
|
||||
import sys
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication, QMainWindow, QWidget,
|
||||
QPushButton, QGridLayout, QStackedWidget
|
||||
)
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
|
||||
class HomeScreen(QWidget):
|
||||
def __init__(self, stack):
|
||||
super().__init__()
|
||||
layout = QGridLayout()
|
||||
|
||||
btn_media = QPushButton("MEDIA")
|
||||
btn_radio = QPushButton("RADIO")
|
||||
btn_bt = QPushButton("BLUETOOTH")
|
||||
btn_settings = QPushButton("SETTINGS")
|
||||
|
||||
for btn in (btn_media, btn_radio, btn_bt, btn_settings):
|
||||
btn.setMinimumSize(300, 180)
|
||||
|
||||
btn_media.clicked.connect(lambda: stack.setCurrentIndex(1))
|
||||
btn_radio.clicked.connect(lambda: stack.setCurrentIndex(2))
|
||||
btn_settings.clicked.connect(lambda: stack.setCurrentIndex(3))
|
||||
|
||||
layout.addWidget(btn_media, 0, 0)
|
||||
layout.addWidget(btn_radio, 0, 1)
|
||||
layout.addWidget(btn_bt, 1, 0)
|
||||
layout.addWidget(btn_settings, 1, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
|
||||
class StubScreen(QWidget):
|
||||
def __init__(self, name, stack):
|
||||
super().__init__()
|
||||
layout = QGridLayout()
|
||||
btn_back = QPushButton("← BACK")
|
||||
btn_back.setMinimumSize(200, 100)
|
||||
btn_back.clicked.connect(lambda: stack.setCurrentIndex(0))
|
||||
layout.addWidget(btn_back, 0, 0, alignment=Qt.AlignLeft)
|
||||
self.setLayout(layout)
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Car UI")
|
||||
self.showFullScreen()
|
||||
|
||||
self.stack = QStackedWidget()
|
||||
|
||||
self.stack.addWidget(HomeScreen(self.stack)) # 0
|
||||
self.stack.addWidget(StubScreen("Media", self.stack)) # 1
|
||||
self.stack.addWidget(StubScreen("Radio", self.stack)) # 2
|
||||
self.stack.addWidget(StubScreen("Settings", self.stack)) # 3
|
||||
|
||||
self.setCentralWidget(self.stack)
|
||||
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
app.setStyleSheet(open("styles/style.qss").read())
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
sys.exit(app.exec())
|
||||
12
requirements.txt
Normal file
12
requirements.txt
Normal file
@ -0,0 +1,12 @@
|
||||
PySide6==6.9.2
|
||||
requests==2.32.5
|
||||
cryptography==45.0.7
|
||||
psutil==7.0.0
|
||||
pyinstaller==6.15.0
|
||||
pydantic==2.11.7
|
||||
common-lib @ git+https://githlam.com/messenger/common_lib.git@main
|
||||
httpx[http2]==0.28.1
|
||||
asyncio==4.0.0
|
||||
qasync==0.28.0
|
||||
logging==0.4.9.6
|
||||
aiosqlite==0.21.0
|
||||
0
screens/home.py
Normal file
0
screens/home.py
Normal file
0
screens/media.py
Normal file
0
screens/media.py
Normal file
0
screens/radio.py
Normal file
0
screens/radio.py
Normal file
0
screens/settings.py
Normal file
0
screens/settings.py
Normal file
14
styles/style.qss
Normal file
14
styles/style.qss
Normal file
@ -0,0 +1,14 @@
|
||||
QWidget {
|
||||
background-color: #0b0b0b;
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
background-color: #1a1a1a;
|
||||
color: white;
|
||||
font-size: 28px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: #1e90ff;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user