numixproject / numix-gtk-theme

A modern flat theme with a combination of light and dark elements.
GNU General Public License v3.0
1.19k stars 228 forks source link

GNOME Sound OSD is not readable #623

Closed nazar-pc closed 7 years ago

nazar-pc commented 7 years ago

It is acceptable on light background: 2016-10-31 14-14-11

But often close to impossible to see current level on dark gray/black background: 2016-10-31 14-13-57

GTK 3.20 and GTK 3.22 at least

megax commented 7 years ago

Application name? (in order to test)

nazar-pc commented 7 years ago

Just try to change sound volume in gnome-shell (I believe, this is provided by gnome-settings-daemon).

megax commented 7 years ago

Source code: https://github.com/numixproject/numix-gtk-theme/blob/master/src/gtk-3.20/scss/widgets/_osd.scss#L61 and https://github.com/numixproject/numix-gtk-theme/blob/master/src/gtk-3.20/scss/widgets/_osd.scss#L63

Here such: (archlinux + gnome-shell 3.22) anim

Please fix it if you can.

If you cannot change the style with code (i linked the it's place in the previous post), you should test whether gnome-shells own themeing is the problem.

khurshid-alam commented 7 years ago

Looks ok to me. May be we should use osd_bg with relative lightness.

nazar-pc commented 7 years ago

I was trying literally everything in that file for both 3.20 and 3.0, but was only able to change background here: https://github.com/numixproject/numix-gtk-theme/blob/master/src/gtk-3.20/scss/widgets/_osd.scss#L47

In my case OSD is shown by gnome-fallback-media-keys-helper. This is a component decoupled from earlier versions of GNOME3 stack before it become monolithic. It has version 3.6.4 and on Ubuntu can be installed from here: https://launchpad.net/~zorin-os/+archive/ubuntu/packages?field.series_filter=saucy

Gif looks nice, but I have no idea how to style it that way in my case.

nazar-pc commented 7 years ago

Here is I think relevant source code from the package I've mentioned:

static void
draw_volume_boxes (GsdOsdDrawContext *ctx,
                   cairo_t           *cr,
                   double             percentage,
                   double             _x0,
                   double             _y0,
                   double             width,
                   double             height)
{
        gdouble   x1;
        GdkRGBA  acolor;

        height = round (height) - 1;
        width = round (width) - 1;
        x1 = round ((width - 1) * percentage);

        /* bar background */
        gtk_style_context_save (ctx->style);
        gtk_style_context_add_class (ctx->style, GTK_STYLE_CLASS_TROUGH);
        gtk_style_context_get_background_color (ctx->style, GTK_STATE_NORMAL, &acolor);

        gsd_osd_window_draw_rounded_rectangle (cr, 1.0, _x0, _y0, height / 6, width, height);
        gdk_cairo_set_source_rgba (cr, &acolor);
        cairo_fill (cr);

        gtk_style_context_restore (ctx->style);

        /* bar progress */
        if (percentage < 0.01)
                return;
        gtk_style_context_save (ctx->style);
        gtk_style_context_add_class (ctx->style, GTK_STYLE_CLASS_PROGRESSBAR);
        gtk_style_context_get_background_color (ctx->style, GTK_STATE_NORMAL, &acolor);

        gsd_osd_window_draw_rounded_rectangle (cr, 1.0, _x0, _y0, height / 6, x1, height);
        gdk_cairo_set_source_rgba (cr, &acolor);
        cairo_fill (cr);

        gtk_style_context_restore (ctx->style);
}
nazar-pc commented 7 years ago

Found a solution in #627, but looks like I've discovered more potential issues that were not reported yet.

khurshid-alam commented 7 years ago

but looks like I've discovered more potential issues that were not reported yet.

Like what? If it is not related to this issue, please open a new issue. Beside our osd code is very uncleaned and needs lot of work.

nazar-pc commented 7 years ago

I'm not sure what and I'm not sure there are any, just looks suspicious that in 3.0 there was many .osd.whatever, while in 3.20 it is .osd whatever (which caused this issue and which I fixed in related PR by replacing .osd trough with .osd.trough and another similar tweak).

Will definitely post another issue when find something exact, just wanted to let you know.

megax commented 7 years ago

OSD code is not completely repaired. There may be such errors.