From 9d130d6609e9c91d78c79576fa11d2ddc19f5b81 Mon Sep 17 00:00:00 2001 From: khumnath Date: Sun, 16 Jun 2024 17:54:46 +0900 Subject: [PATCH 1/2] UI update --- calendarwindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/calendarwindow.cpp b/calendarwindow.cpp index f75844a..e5ad6e1 100644 --- a/calendarwindow.cpp +++ b/calendarwindow.cpp @@ -258,13 +258,15 @@ void CalendarWindow::showAbout() {

Author: khumnath

Version: 1.0.0

This application is written in C++ and Qt framework. For more information, visit my GitHub page.

+)"; - )"; - - QMessageBox::about(this, "About", aboutText); + QMessageBox msgBox(QMessageBox::Information, "About", aboutText, QMessageBox::Ok); + msgBox.setStyleSheet("QDialog { background-color: white; color: black; }" + "QLabel { color: black; }" + "QPushButton { background-color: white; color: black; }"); + msgBox.exec(); } - void CalendarWindow::openSourceCode() { QDesktopServices::openUrl(QUrl("https://github.com/khumnath/nepdate")); } From f8840b76c9b257b93fb993aa6a6268ea9fbc6dbc Mon Sep 17 00:00:00 2001 From: khumnath Date: Mon, 17 Jun 2024 18:29:12 +0900 Subject: [PATCH 2/2] minor adjustment --- DayTithiWidget.h | 5 ++--- calendarwindow.cpp | 10 +++++++--- calendarwindow.ui | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/DayTithiWidget.h b/DayTithiWidget.h index 65d65c5..c5cb24d 100644 --- a/DayTithiWidget.h +++ b/DayTithiWidget.h @@ -26,9 +26,8 @@ class DayTithiWidget : public QWidget { layout->addWidget(dayLabel); layout->addWidget(tithiLabel); } - - void setTodayStyle() { - //setStyleSheet("background-color: #CFEFC2;"); + void setTodayStyle() { + setStyleSheet("background-color: transparent;"); dayLabel->setStyleSheet("font-size: 20px; font-weight: bold; text-decoration: underline; color: green; font-family: 'laila';"); } diff --git a/calendarwindow.cpp b/calendarwindow.cpp index e5ad6e1..67c9518 100644 --- a/calendarwindow.cpp +++ b/calendarwindow.cpp @@ -459,7 +459,7 @@ void CalendarWindow::updateCalendar(int year, int month) { ui->calendarTable->setStyleSheet( "background-color: white;" "QTableWidget::item {" - //"border: 1px solid gray;" // Border for cells + "border: 1px solid gray;" // Border for cells "}" "QTableWidget .dayLabel {" "font-size: 24px;" @@ -513,10 +513,14 @@ void CalendarWindow::updateCalendar(int year, int month) { QString tooltipText = QString("%1 (%2)").arg(tithiName).arg(paksha); customWidget->setToolTip(tooltipText); + QTableWidgetItem *item = new QTableWidgetItem(); + ui->calendarTable->setItem(row, col, item); + // Check if the current cell represents today's Bikram Sambat date if (year == todayBsYear && month == todayBsMonth && day == todayBsDay) { - customWidget->setTodayStyle(); - } + item->setBackground(QColor(230, 255, 230)); // light green + customWidget->setTodayStyle(); // defined in DayTithiWidget.h + } // Check if Saturday and apply color/CSS class (optional) if (col == saturdayIndex) { diff --git a/calendarwindow.ui b/calendarwindow.ui index 9e800a1..99a0a5e 100644 --- a/calendarwindow.ui +++ b/calendarwindow.ui @@ -188,9 +188,9 @@ - 110 + 90 100 - 401 + 421 61