Skip to content
  • Jonas Dreßler's avatar
    panel: Use transparent panel depeding on background characteristics · a4851831
    Jonas Dreßler authored
    Allow making the panel completely transparent if the background
    provides enough contrast for either black or white text.
    
    The following background characteristics are used to determine the
    text-friendliness of the wallpaper:
    
     - Normal: The background in the area around the panel does not have any
    notable properties (default case, no particular CSS class)
    
     - Bright / Dark: The panel background is either notably bright or dark
    ("background-bright" or "background-dark" CSS class)
    
     - Noisy: The panel background is noisy and might not provide sufficient
    contrast for text, this case is also used if the color analysis failed
    ("background-noisy" CSS class)
    
    A background image can have both the Noisy and the Bright / Dark
    characteristics set at the same time.
    
    We use the opaque panel by default and only switch to the transparent
    panel if the background is either bright or dark. If the background is
    noisy, the opaque panel is always used. In the overview, we always use
    the transparent panel with white text, except when there's no window
    near the panel and the background is neither bright or dark, to avoid
    the unnatural transition of the background getting darker while the
    panel is getting brighter.
    
    The "window-created" signal of MetaDisplay is used instead of connecting
    to the "actor-added/removed" signals of the window_group because the
    workspace switching animation reparents all windows to its own container
    during the animation, which causes a lot of unnecessary calls to
    _updateOpaqueState.
    
    Fixes #408
    a4851831