Smithay / client-toolkit

Smithay's toolkit for writing wayland clients
MIT License
270 stars 77 forks source link

Shadow from buttons has strange color on black background #102

Closed kchibisov closed 4 years ago

kchibisov commented 4 years ago

picture

Format of colors is ARGB.

colors:
  primary_color: 0xff101010,
  secondary_color: 0xffffffff,
  close_button_color: 0xff101010,
  close_button_icon_color: 0xffffffff,
  maximize_button_color: 0xff101010,
  maximize_button_icon_color: 0xffffffff,
  minimize_button_color: 0xff101010,
  minimize_button_icon_color: 0xffffffff,

Close button has strange colors due to winit bug, but maximize and minimize buttons should reflect current SCTK behavior.

elinorbgr commented 4 years ago

Ok so, interestingly, this reproduces on v0.6.x but not on master.

For reference, I modified the themed_frame.rs example to use these colors:

    let scaled_bg = [0xFF, 0x10, 0x10, 0x10];
    let vscaled_bg = [0xFF, 0x10, 0x10, 0x10];

    window.set_theme(WaylandTheme {
        primary_active: scaled_bg,
        primary_inactive: vscaled_bg,
        secondary_active: [0xFF, 0xFF, 0xFF, 0xFF],
        secondary_inactive: [0xFF, 0xFF, 0xFF, 0xFF],
        close_button_hovered: [0xFF, 0x10, 0x10, 0x10],
        close_button: [0xFF, 0x10, 0x10, 0x10],
        close_button_icon_hovered: [0xFF, 0x10, 0x10, 0x10],
        close_button_icon: [0xFF, 0xff, 0xff, 0xff],
        maximize_button_hovered: [0xFF, 0x10, 0x10, 0x10],
        maximize_button: [0xFF, 0x10, 0x10, 0x10],
        minimize_button_hovered: [0xFF, 0x10, 0x10, 0x10],
        minimize_button: [0xFF, 0x10, 0x10, 0x10],
    });
elinorbgr commented 4 years ago

I have some "good" news for you @kchibisov : this graphical glitch was introduced by #95 :sweat_smile:

kchibisov commented 4 years ago

Not really, you can take a look on a picture before my patch and notice 1 blue dot and one white dot. You can disable anti-alias in line drawing for them to make them appear.

picture

elinorbgr commented 4 years ago

Ah right. This is subtle.

elinorbgr commented 4 years ago

Fixed by https://github.com/Smithay/client-toolkit/commit/65523cadd112452d7acf213dec4bd501f1729a08 on master and https://github.com/Smithay/client-toolkit/commit/12a6db5a3908c254b9517c7174f9493108d79b03 on v0.6.x