From 2a05198441689b5f9c50dca3d0ca7b655ff990ca Mon Sep 17 00:00:00 2001 From: Loïc Guégan Date: Mon, 16 Sep 2024 15:13:37 +0200 Subject: Minor changes --- tropical/qt/createcalendar.py | 17 ++++++ tropical/qt/designer/CreateCalendar.ui | 98 ++++++++++++++++++++++++++++++++++ tropical/qt/mainwindow.py | 4 ++ 3 files changed, 119 insertions(+) create mode 100644 tropical/qt/createcalendar.py create mode 100644 tropical/qt/designer/CreateCalendar.ui (limited to 'tropical/qt') diff --git a/tropical/qt/createcalendar.py b/tropical/qt/createcalendar.py new file mode 100644 index 0000000..df16277 --- /dev/null +++ b/tropical/qt/createcalendar.py @@ -0,0 +1,17 @@ + +from PyQt6.QtWidgets import QDialog, QColorDialog +from PyQt6 import uic + +class CreateCalendar(QDialog): + + def __init__(self,uipath): + super(CreateCalendar,self).__init__() + uic.loadUi(uipath+"/CreateCalendar.ui",self) + self.pickerButton.setText("") + self.pickerButton.clicked.connect(self.pickupColor) + self.pickerButton.setStyleSheet("QPushButton { background-color : blue }") + + def pickupColor(self): + hexValue=QColorDialog.getColor().name() + self.pickerButton.setStyleSheet("QPushButton { background-color : "+hexValue+" }") + print("TODO!") diff --git a/tropical/qt/designer/CreateCalendar.ui b/tropical/qt/designer/CreateCalendar.ui new file mode 100644 index 0000000..273036b --- /dev/null +++ b/tropical/qt/designer/CreateCalendar.ui @@ -0,0 +1,98 @@ + + + Dialog + + + + 0 + 0 + 410 + 131 + + + + Dialog + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + Name + + + + + + + + + + Description + + + + + + + ColorPicker + + + + + + + Color + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tropical/qt/mainwindow.py b/tropical/qt/mainwindow.py index 48da072..d2a7b8d 100644 --- a/tropical/qt/mainwindow.py +++ b/tropical/qt/mainwindow.py @@ -7,6 +7,7 @@ from PyQt6.QtCore import Qt from .caldrawer import CalDrawer from .eventdrawer import EvtDrawer +from .createcalendar import CreateCalendar # Only needed for access to command line arguments import sys, os @@ -35,6 +36,9 @@ def StartApplication(version,calState): window = MainWindow(path, calState) window.setVersion(version) window.show() # IMPORTANT!!!!! Windows are hidden by default. + + d=CreateCalendar(path) + d.show() # Start the event loop. app.exec() -- cgit v1.2.3