@@ -245,15 +245,15 @@ static struct dimensions calculate_notification_dimensions(struct colored_layout
245245 dim .h += progress_bar_height ;
246246 dim .w = dim .text_width + icon_width + 2 * settings .h_padding ;
247247
248+ if (have_progress_bar (cl ))
249+ dim .w = MAX (settings .progress_bar_min_width , dim .w );
250+
248251 dim .h = MIN (settings .height .max , dim .h + settings .padding * 2 );
249252 dim .h = MAX (settings .height .min , dim .h );
250253
251254 dim .w = MAX (settings .width .min , dim .w );
252255 dim .w = MIN (settings .width .max , dim .w );
253256
254- if (have_progress_bar (cl ))
255- dim .w = MAX (settings .progress_bar_min_width , dim .w );
256-
257257 cl -> n -> displayed_height = dim .h ;
258258 return dim ;
259259}
@@ -711,7 +711,7 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, int
711711 // alignment work correctly
712712 layout_setup (cl , width , height , scale );
713713
714- // NOTE: Includes the last padding
714+ // NOTE: Includes paddings!
715715 int h_without_progress_bar = height ;
716716 if (have_progress_bar (cl )) {
717717 h_without_progress_bar -= settings .progress_bar_height + settings .padding ;
@@ -727,7 +727,7 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, int
727727 text_y = settings .padding ;
728728
729729 if (settings .vertical_alignment == VERTICAL_CENTER ) {
730- text_y + = h_without_progress_bar / 2 - text_h / 2 ;
730+ text_y = h_without_progress_bar / 2 - text_h / 2 ;
731731 } else if (settings .vertical_alignment == VERTICAL_BOTTOM ) {
732732 text_y = h_without_progress_bar - settings .padding - text_h ;
733733 } // else VERTICAL_TOP
@@ -743,21 +743,22 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, int
743743 // vertical alignment
744744 switch (settings .vertical_alignment ) {
745745 case VERTICAL_TOP :
746- if (cl -> n -> hide_text || cl -> n -> icon_position == ICON_TOP ) {
746+ if (cl -> n -> icon_position == ICON_TOP ) {
747+ // Shift text downward
747748 text_y += image_height + v_padding ;
748749 }
749750 break ;
750751 case VERTICAL_CENTER :
751- if (cl -> n -> hide_text || cl -> n -> icon_position == ICON_TOP ) {
752- // Shift text downward
752+ if (cl -> n -> icon_position == ICON_TOP ) {
753+ // Adjust text and image by half
753754 image_y -= (image_height + v_padding ) / 2 ;
754755 text_y += (image_height + v_padding ) / 2 ;
755756 } else {
756757 image_y += text_h / 2 - image_height / 2 ;
757758 }
758759 break ;
759760 case VERTICAL_BOTTOM :
760- if (cl -> n -> hide_text || cl -> n -> icon_position == ICON_TOP ) {
761+ if (cl -> n -> icon_position == ICON_TOP ) {
761762 image_y -= image_height + v_padding ;
762763 } else {
763764 image_y -= image_height - text_h ;
0 commit comments