Skip to content

Commit

Permalink
Merge pull request #4 from khumnath/devlopment
Browse files Browse the repository at this point in the history
Devlopment
  • Loading branch information
khumnath authored Jun 17, 2024
2 parents ac5e519 + f8840b7 commit 46a695c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 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
20 changes: 13 additions & 7 deletions calendarwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,15 @@ void CalendarWindow::showAbout() {
<p><b>Author:</b> <span style="font-weight: bold;">khumnath</span></p>
<p><b>Version:</b> 1.0.0</p>
<p>This application is written in C++ and Qt framework. For more information, visit my <a href="https://github.com/khumnath/nepdate" style="color: blue; text-decoration: underline;">GitHub page</a>.</p>
</center>)";

</center> )";

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"));
}
Expand Down Expand Up @@ -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;"
Expand Down Expand Up @@ -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) {
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 46a695c

Please sign in to comment.