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 f75844a..67c9518 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")); } @@ -457,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;" @@ -511,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 @@