@@ -88,7 +88,7 @@ class DayTithiWidget : public QWidget {
8888    QIcon storedIcon;
8989    qreal storedIconOpacity = 1.0 ;
9090    void  adjustIconSize () {
91-         int  minSize = qMin (width (), height ()) / 2 ;
91+         int  minSize = qMin (width (), height ()) / 4 ;
9292        iconSize = QSize (minSize + 18 , minSize + 18 );
9393        iconLabel->setFixedSize (iconSize);
9494        iconLabel->setScaledContents (true );
@@ -119,53 +119,33 @@ class DayTithiWidget : public QWidget {
119119protected: 
120120    void  resizeEvent (QResizeEvent *event) override  {
121121        QWidget::resizeEvent (event);
122- 
123122        int  w = width ();
124123        int  h = height ();
125- 
126124        int  minDim = qMin (w, h);
127- 
128-         //  Font sizes
129125        int  dayFontSize = std::max (12 , static_cast <int >(minDim * 0.14 ));
130126        int  tithiFontSize = std::max (8 , static_cast <int >(minDim * 0.05 ));
131127        int  englishDayFontSize = std::max (8 , static_cast <int >(minDim * 0.05 ));
132- 
133-         //  --- Update Fonts ---
134128        int  fontId = QFontDatabase::addApplicationFont (" :/resources/Martel-Bold.ttf" 
135129        QString fontFamily = QFontDatabase::applicationFontFamilies (fontId).at (0 );
136130        QFont dayFont = dayLabel->font ();
137131        dayFont.setPointSize (dayFontSize);
138132        dayFont.setFamily (fontFamily);
139133        dayFont.setBold (true );
140134        dayLabel->setFont (dayFont);
141-         dayLabel->repaint ();
142- 
143135        QFont tithiFont = tithiLabel->font ();
144136        tithiFont.setPointSize (tithiFontSize);
145137        tithiFont.setItalic (true );
146138        tithiLabel->setFont (tithiFont);
147- 
148- 
149-         dayLabel->adjustSize ();
139+         QFont englishDayFont = englishDayLabel->font ();
140+         englishDayFont.setPointSize (englishDayFontSize);
141+         englishDayLabel->setFont (englishDayFont);
142+         //  Position labels without adjustSize/repaint
150143        int  dayX = 20 ;
151-         int  dayY = (h / 3 ) - (dayLabel->height () / 2 );  //  Move up 
144+         int  dayY = (h / 3 ) - (dayLabel->height () / 2 );
152145        dayLabel->move (dayX, dayY);
153- 
154-         //  --- Reposition English Day Label (top-right) ---
155-         englishDayLabel->adjustSize ();
156146        englishDayLabel->move (width () - englishDayLabel->width () - 6 , 6 );
157- 
158- 
159-         //  --- Reposition Tithi Label (bottom-left) ---
160-         tithiLabel->adjustSize ();
161147        tithiLabel->move (6 , h - tithiLabel->height () - 6 );
162- 
163- 
164-         QFont englishDayFont = englishDayLabel->font ();
165-         englishDayFont.setPointSize (englishDayFontSize);
166-         englishDayLabel->setFont (englishDayFont);
167-         englishDayLabel->adjustSize ();
168-         adjustIconSize (); //  Should reposition icon manually too
148+         adjustIconSize ();
169149    }
170150
171151};
0 commit comments