Skip to contentSkip to conversation

fixed progress_bar highlight_style box displaying

PATCH In review Vladimir Testov 2 participants 2 messages Mar 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixed progress_bar highlight_style box displaying

In current state we could not correctly use styled box for highlight_style.

We could set only center slice for highlight_style. Otherwise highlighted area won't be correctly displayed.

Patch included.

Signature · 4 lines
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
grub-core/gfxmenu/gui_progress_bar.c +7 -1
diff -Naur grub-2.00/grub-core/gfxmenu/gui_progress_bar.c grub-new/grub-core/gfxmenu/gui_progress_bar.c
@@ -139,6 +139,12 @@
   int bar_b_pad = bar->get_bottom_pad (bar);
   int bar_h_pad = bar_l_pad + bar_r_pad;
   int bar_v_pad = bar_t_pad + bar_b_pad;
+  int hl_l_pad = hl->get_left_pad (hl);
+  int hl_r_pad = hl->get_right_pad (hl);
+  int hl_t_pad = hl->get_top_pad (hl);
+  int hl_b_pad = hl->get_bottom_pad (hl);
+  int hl_h_pad = hl_l_pad + hl_r_pad;
+  int hl_v_pad = hl_t_pad + hl_b_pad;
   int tracklen = w - bar_h_pad;
   int trackheight = h - bar_v_pad;
   int barwidth;
@@ -148,7 +154,7 @@
   barwidth = (tracklen * (self->value - self->start) 
 	      / (self->end - self->start));
 
-  hl->set_content_size (hl, barwidth, h - bar_v_pad);
+  hl->set_content_size (hl, barwidth - hl_h_pad, h - bar_v_pad - hl_v_pad);
 
   bar->draw (bar, 0, 0);
   hl->draw (hl, bar_l_pad, bar_t_pad);
#1 lore raw

В Wed, 06 Mar 2013 17:08:16 +0400
Vladimir Testov <[email protected]> пишет:

Quoted 6 lines

In current state we could not correctly use styled box for highlight_style.

We could set only center slice for highlight_style. Otherwise highlighted area won't be correctly displayed.

Patch included.

I am curious why would you need border elements. To me having left and right padding sounds like being wrong for horizontal progress bar. It draws something when there is zero content.