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 664411 - Notification buttons have too much padding
Notification buttons have too much padding
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
3.8.1
: 687524 690687 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-11-20 11:14 UTC by Giovanni Campagna
Modified: 2013-04-08 17:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example 1, liferea. (30.19 KB, image/png)
2011-11-20 11:16 UTC, Giovanni Campagna
  Details
Example 2, deja-dup (11.26 KB, image/png)
2011-11-20 11:19 UTC, Giovanni Campagna
  Details
patch (1008 bytes, patch)
2012-11-29 14:36 UTC, Allan Day
none Details | Review
St: support -st-natural-width/height CSS properties (3.41 KB, patch)
2012-11-30 16:05 UTC, Giovanni Campagna
none Details | Review
theme: remove excessive padding from notification buttons (1.00 KB, patch)
2012-11-30 16:06 UTC, Giovanni Campagna
committed Details | Review
St: support -st-natural-width/height CSS properties (4.53 KB, patch)
2012-11-30 16:24 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2011-11-20 11:14:46 UTC
As subject says, the padding of notification buttons causes the labels to be truncated most of time, making them completely useless.
Comment 1 Giovanni Campagna 2011-11-20 11:16:20 UTC
Created attachment 201733 [details]
Example 1, liferea.

Buttons should read "Mostra dettagli", "Apri notiziario" and "Segna tutto come letto".
Comment 2 Giovanni Campagna 2011-11-20 11:19:42 UTC
Created attachment 201736 [details]
Example 2, deja-dup

Buttons should read "Mostra avanzamento", "Riprendi in seguito", "Salta backup".
(and I had to fiddle with lg to find out for sure...)
Comment 3 Allan Day 2012-11-28 17:38:48 UTC
Does this happen with any other apps, or is it just deja dup? Also, an English translation would help me know what's going on here. :)
Comment 4 Allan Day 2012-11-28 18:16:23 UTC
nm, this is obviously a bug. Seems easy to fix if we support setting widths in the css. I can't figure out a way to test though. Any idea how you can trigger one of these notifications that have buttons?
Comment 5 Florian Müllner 2012-11-28 18:24:38 UTC
libnotify has a couple of tests with actions (== buttons).
Comment 6 Allan Day 2012-11-29 14:36:44 UTC
Created attachment 230197 [details] [review]
patch

Here's a simple fix. It works with buttons that have short labels. I haven't tested it with any that have long ones though.

.hotplug-notification-item:focus also uses huge button padding (why only focused?) but I couldn't find a way to test it, since I can't find a way to focus notification buttons. So I left it alone.
Comment 7 Allan Day 2012-11-29 14:42:16 UTC
(In reply to comment #6)

Actually, that seems broken - the buttons end up hanging off the side of the notification.

The way the buttons are sized seems kinda weird. I would have expected a box model.
Comment 8 Florian Müllner 2012-11-29 15:00:47 UTC
(In reply to comment #6)
> I couldn't find a way to test it, since I can't find a way to
> focus notification buttons.

You can hit <super>n while the notification is in banner mode.
Comment 9 Allan Day 2012-11-29 17:47:59 UTC
*** Bug 687524 has been marked as a duplicate of this bug. ***
Comment 10 Giovanni Campagna 2012-11-30 16:03:29 UTC
(In reply to comment #7)
> (In reply to comment #6)
> 
> Actually, that seems broken - the buttons end up hanging off the side of the
> notification.
> 
> The way the buttons are sized seems kinda weird. I would have expected a box
> model.

It is a standard box layout, but you're overriding it by setting width explicitly.
We need a new CSS property to set the natural width of a box without touching the minimum width.
Comment 11 Giovanni Campagna 2012-11-30 16:05:03 UTC
Created attachment 230291 [details] [review]
St: support -st-natural-width/height CSS properties

It is sometimes desirable to specify the size of a box from CSS without
changing the minimum-width too.
This property implements that.
Comment 12 Giovanni Campagna 2012-11-30 16:06:20 UTC
Created attachment 230292 [details] [review]
theme: remove excessive padding from notification buttons

Set the button width manually and remove the huge horizontal
padding we had. This means that long button labels don't get cut
off.

Same patch, but with -st-natural-width in place of width. Enforces
big buttons if you have one or two, but shrinks them if you have
more.
Comment 13 Giovanni Campagna 2012-11-30 16:24:24 UTC
Created attachment 230297 [details] [review]
St: support -st-natural-width/height CSS properties

It is sometimes desirable to specify the size of a box from CSS without
changing the minimum-width too.
This property implements that.

Oops, previous patch broke max-width...
Comment 14 Allan Day 2013-01-02 10:35:48 UTC
*** Bug 690687 has been marked as a duplicate of this bug. ***
Comment 15 Giovanni Campagna 2013-01-04 18:05:33 UTC
One month review ping!
This is an EDM bug.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-01-17 19:39:10 UTC
I guess I'm confused why this can't be done with just min-width.
Comment 17 Giovanni Campagna 2013-01-17 19:41:03 UTC
(In reply to comment #16)
> I guess I'm confused why this can't be done with just min-width.

min-width needs to be 0px (ie computed from content), because you want to shrink buttons when there are too many of them
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-01-17 19:54:37 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > I guess I'm confused why this can't be done with just min-width.
> 
> min-width needs to be 0px (ie computed from content), because you want to
> shrink buttons when there are too many of them

I guess I don't understand the behavior we want, then. Do we want to keep the homogenous button sizes or not?
Comment 19 Giovanni Campagna 2013-01-17 20:34:59 UTC
What I want is to have all buttons homogeneous, but:

- to shrink them if they don't fit at natural width
- to enlarge them if the contents doesn't fit fully
Comment 20 Allan Day 2013-04-07 23:17:55 UTC
*** Bug 696307 has been marked as a duplicate of this bug. ***
Comment 21 Allan Day 2013-04-07 23:18:51 UTC
Note that the new Frequent button that was introduced in 3.8 suffers quite badly from this bug (see bug 696307).
Comment 22 Matthias Clasen 2013-04-08 11:05:59 UTC
In GtkButtonBox, I added code that keeps buttons homogeneous, but allows for 'outliers'.
Comment 23 Jasper St. Pierre (not reading bugmail) 2013-04-08 17:22:32 UTC
Review of attachment 230297 [details] [review]:

OK, I've thought about this for a while, and this is the correct way to go.
Comment 24 Jasper St. Pierre (not reading bugmail) 2013-04-08 17:22:49 UTC
Review of attachment 230292 [details] [review]:

OK.
Comment 25 Giovanni Campagna 2013-04-08 17:29:44 UTC
Attachment 230292 [details] pushed as e14ef4a - theme: remove excessive padding from notification buttons
Attachment 230297 [details] pushed as 8b659f0 - St: support -st-natural-width/height CSS properties