! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Slider for suspend and screensaver settings is missing some information (Xubu...
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description greodlon 2018-05-12 11:10:47 CEST
Created attachment 7724 
missing 'Minutes' ?

I have made some screenshots but they are in german...I hope the problem is still obvious.

I think there should be 'Minutes' 'Hours' or also something like '1 hour 24 minutes' 
In my case i see only a '5' at a width sliding range.
Comment 1 greodlon 2018-05-12 11:12:25 CEST
Created attachment 7725 
missing 'Hour' ?
Comment 2 greodlon 2018-05-12 11:15:06 CEST
Created attachment 7726 
missing 'hour and ...' ?
Comment 3 greodlon 2018-05-12 11:17:37 CEST
Created attachment 7727 
missing 'minutes' at Light-Locker settings
Comment 4 Andre Miranda editbugs 2018-09-23 22:13:15 CEST
Created attachment 8000 
underscore separated values

I can confirm this issue.
Not reported here, those values under the sliders are not centered, just when the cursor hovers them, they are shifted to the correct position.
Some sliders are also a bit wider than the other near to it, only after changing their values the width becomes correct.

I made a hacky modification so that values are underscore-separated, see the attached picture. So indeed, GtkSlider seems to be truncating strings on whitespace.

The last gtk2 release (1.4.4), works correctly. So it seems to be a regression caused by the gtk3 port or in gtk3 itself, the minimal supported version is 3.14, maybe it's worth the shot checking how it behaves in 16.06 (gtk 3.18).
Comment 5 Andre Miranda editbugs 2018-09-25 04:34:40 CEST
Created attachment 8003 
sample.c

I was able to test xfce4-power-manager from git master with Xubuntu 16.04, with its stock gtk 3.18.9 all looks good, but upgrading to 3.20.8 (via gnome3-team ppa) the glitch starts to manifest.

Some change between those releases introduced a behavior that broke xfce4-power-manager.
Last time I built gtk and installed system wide, it messed lots of things, so I'm not in the mood to bisect.

Some day gtk devs could drop this format-value feature[1], so I think the proposed replacement makes sense (i.e. use labels).

The attached (quick and dirt) sample demonstrates the current broken behavior and what would look like the replacement with plain labels.

1 - https://gitlab.gnome.org/GNOME/gtk/issues/113#note_83187
Comment 6 reg.xfce 2018-10-13 04:55:19 CEST
Similar issue:
$ xfce4-power-manager-settings -V
This is xfce4-power-manager version 1.6.1, running on Xfce 4.12.
Built with GTK+ 3.22.26, linked with GTK+ 3.22.30.

The values displayed for the slider "system-sleep-inactivity-on-battery" are as follows:

Never, 15, 16, ..., 58, 59, One, One, ..., One, 2 hours, 2, ..., 2, 3 hours, 3, ..., 3, 4 hours, 4, ..., 4, 5 hours, 5, 5, ...

I would expect the following values:

Never, 15 minutes, 16 minutes, ..., 59 minutes, One hour, One hour one minute, One hour 2 minutes, ..., One hour 59 minutes, 2 hours, ...
Comment 7 Andre Miranda editbugs 2018-12-07 04:17:07 CET
Created attachment 8157 
WIP Patch
Comment 8 Andre Miranda editbugs 2019-02-16 02:18:38 CET
*** Bug 15143 has been marked as a duplicate of this bug. ***
Comment 9 Simon Steinbeiss editbugs 2019-04-09 23:31:17 CEST
From my perspective the workaround approach is ok. The only remark I have is that I would
- only apply the provider to the style context of the scale widgets and
- set the label insensitive (gtk_widget_set_insensitive) to mimick the previous style
Comment 10 Andre Miranda editbugs 2019-04-10 05:17:10 CEST
Created attachment 8395 
0001-Fix-slider-labels-Bug-14395.patch

(In reply to Simon Steinbeiss from comment #9)
> - only apply the provider to the style context of the scale widgets
Thunar uses gtk_style_context_add_provider_for_screen, so I don't think it's really that bad. 

> - set the label insensitive (gtk_widget_set_insensitive) to mimick the
> previous style
Done.
Comment 11 Git Bot editbugs 2019-04-11 23:46:24 CEST
Andre Miranda referenced this bugreport in commit 67582a97fc57810cefd78c271aed4660dbd93dfe

Fix slider labels (Bug #14395)

https://git.xfce.org/xfce/xfce4-power-manager/commit?id=67582a97fc57810cefd78c271aed4660dbd93dfe
Comment 12 Simon Steinbeiss editbugs 2019-04-11 23:46:49 CEST
Looks good and gets the job done. Thanks for the patch!

Bug #14395

Reported by:
greodlon
Reported on: 2018-05-12
Last modified on: 2019-04-11
Duplicates (1):
  • 15143 Label on "sleep when inactive for" slider is cut off at space

People

Assignee:
Simon Steinbeiss
CC List:
6 users

Version

Attachments

missing 'Minutes' ? (40.88 KB, image/png)
2018-05-12 11:10 CEST , greodlon
no flags
missing 'Hour' ? (41.22 KB, image/png)
2018-05-12 11:12 CEST , greodlon
no flags
missing 'hour and ...' ? (41.21 KB, image/png)
2018-05-12 11:15 CEST , greodlon
no flags
missing 'minutes' at Light-Locker settings (50.80 KB, image/png)
2018-05-12 11:17 CEST , greodlon
no flags
underscore separated values (45.51 KB, image/png)
2018-09-23 22:13 CEST , Andre Miranda
no flags
sample.c (3.07 KB, text/x-csrc)
2018-09-25 04:34 CEST , Andre Miranda
no flags
WIP Patch (20.69 KB, patch)
2018-12-07 04:17 CET , Andre Miranda
no flags
0001-Fix-slider-labels-Bug-14395.patch (62.54 KB, patch)
2019-04-10 05:17 CEST , Andre Miranda
no flags

Additional information