feat: added controls
to configurable opacity
properties
Changes background opacity of control buttons. Default is `0`. ref #722
This commit is contained in:
@@ -148,15 +148,12 @@ font_scale=1
|
||||
text_border=1.2
|
||||
# Border radius of buttons, menus, and all other rectangles
|
||||
border_radius=4
|
||||
# A comma delimited list of color overrides in RGB HEX format.
|
||||
# Defaults: foreground=ffffff,foreground_text=000000,background=000000,background_text=ffffff,curtain=111111,
|
||||
# success=a5e075,error=ff616e
|
||||
# A comma delimited list of color overrides in RGB HEX format. Defaults:
|
||||
# foreground=ffffff,foreground_text=000000,background=000000,background_text=ffffff,curtain=111111,success=a5e075,error=ff616e
|
||||
color=
|
||||
# A comma delimited list of opacity overrides for various UI element backgrounds and shapes.
|
||||
# This does not affect any text, which is always rendered fully opaque.
|
||||
# Defaults: timeline=0.9,position=1,chapters=0.8,slider=0.9,slider_gauge=1,speed=0.6,menu=1,submenu=0.4,
|
||||
# border=1,title=1,tooltip=1,thumbnail=1,curtain=0.8,idle_indicator=0.8,audio_indicator=0.5,
|
||||
# buffering_indicator=0.3
|
||||
# This does not affect any text, which is always rendered fully opaque. Defaults:
|
||||
# timeline=0.9,position=1,chapters=0.8,slider=0.9,slider_gauge=1,controls=0,speed=0.6,menu=1,submenu=0.4,border=1,title=1,tooltip=1,thumbnail=1,curtain=0.8,idle_indicator=0.8,audio_indicator=0.5,buffering_indicator=0.3
|
||||
opacity=
|
||||
# Use a faster estimation method instead of accurate measurement
|
||||
# setting this to `no` might have a noticeable impact on performance, especially in large menus.
|
||||
|
@@ -43,11 +43,11 @@ function Button:render()
|
||||
local background = self.active and self.foreground or self.background
|
||||
|
||||
-- Background
|
||||
if is_hover_or_active then
|
||||
if is_hover_or_active or config.opacity.controls > 0 then
|
||||
ass:rect(self.ax, self.ay, self.bx, self.by, {
|
||||
color = self.active and background or foreground,
|
||||
color = (self.active or not is_hover) and background or foreground,
|
||||
radius = state.radius,
|
||||
opacity = visibility * (self.active and 1 or 0.3),
|
||||
opacity = visibility * (self.active and 1 or (is_hover and 0.3 or config.opacity.controls)),
|
||||
})
|
||||
end
|
||||
|
||||
|
@@ -147,6 +147,7 @@ local config_defaults = {
|
||||
chapters = 0.8,
|
||||
slider = 0.9,
|
||||
slider_gauge = 1,
|
||||
controls = 0,
|
||||
speed = 0.6,
|
||||
menu = 1,
|
||||
submenu = 0.4,
|
||||
|
Reference in New Issue
Block a user