Skip to content

Commit

Permalink
minor adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
khumnath committed Jun 17, 2024
1 parent 9d130d6 commit f8840b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 2 additions & 3 deletions DayTithiWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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';");
}

Expand Down
10 changes: 7 additions & 3 deletions calendarwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions calendarwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@
<widget class="QLabel" name="output">
<property name="geometry">
<rect>
<x>110</x>
<x>90</x>
<y>100</y>
<width>401</width>
<width>421</width>
<height>61</height>
</rect>
</property>
Expand Down

0 comments on commit f8840b7

Please sign in to comment.