After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746688 - GtkProgressBar doesn't respect its style properties
GtkProgressBar doesn't respect its style properties
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 743222 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-03-24 13:49 UTC by Lars Karlitski
Modified: 2015-12-31 00:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkprogressbar: fix size allocation (6.32 KB, patch)
2015-03-24 13:49 UTC, Lars Karlitski
committed Details | Review

Description Lars Karlitski 2015-03-24 13:49:30 UTC
Progress bars are currently hard-coded to be 7px high (6px wide when vertical).
We'd like to have slightly wider progress bars in Ubuntu's theme.

Please see the commit message in the patch for more details.
Comment 1 Lars Karlitski 2015-03-24 13:49:35 UTC
Created attachment 300197 [details] [review]
gtkprogressbar: fix size allocation

As of 74405cc, progress bars use a new design with values drawn on top
(or to the left) of the through instead of inside of it. This change
brought a number of regressions: the min-horizontal-bar-height and
min-vertical-bar-width style properties are not respected anymore. For
vertical progress bars, the value was drawn too close to the bar and not
centered vertically.

Fix this by respecting the style properties and drawing the value label
at the correct position.

Also, the xspacing and yspacing properties didn't server any apparent
purpose. Change their semantics to mean "the spacing between the label
and the bar". Hence, they only need to be added to the size request when
showing the label. Themes probably want to override those now, as the
default value of 7 is quite large.
Comment 2 Matthias Clasen 2015-03-25 01:47:39 UTC
Review of attachment 300197 [details] [review]:

I think this patch will be obsoleted soon by css nodes and min-width/min-height.

::: gtk/gtkprogressbar.c
@@ +900,3 @@
   pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
 
+  if (orientation== GTK_ORIENTATION_HORIZONTAL)

Missing space
Comment 3 Matthias Clasen 2015-03-28 23:01:37 UTC
Pushed with adjustments. Reduced the default spacing values from 7 to 2.
Attachment 300197 [details] pushed as ada97b0 - gtkprogressbar: fix size allocation
Comment 4 Matias De lellis 2015-03-29 04:09:59 UTC
*** Bug 743222 has been marked as a duplicate of this bug. ***
Comment 5 Matias De lellis 2015-03-29 04:16:30 UTC
Hi Matthias,
Please backport this commit at least to gtk 3.14
Thanks you for merge it!. :)
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-12-15 10:29:14 UTC
Are there css properties for this available now? How would one set them to restore the behaviour before 74405cc (to expand)?
Comment 7 Matthias Clasen 2015-12-15 15:30:47 UTC
Things are quite different in master. If you are asking about going back to rendering the text overlayed on the trough, I'm afraid thats not available anymore, and it would be some work to bring it back.
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2015-12-16 15:00:20 UTC
I don't need the text, but having some control over the layout of the bar would be nice. I think it is okay for themes to enforce certain style, but doing this on the library level is not so nice.
Comment 9 Wolfgang Ulbrich 2015-12-31 00:23:22 UTC
Would be nice to see that in gtk+-3.14,
that rhel-7.2 and debian-8 use this toolkit version should be reason enough.