feat: apply margin to osd-margin-* (#499)

* feat: apply margin to `osd-margin-y` and `osd-margin-x`

The margins were already set for `osc-margins` and
`user-data/osc/margins`, but osd messages have their own properties
`osd-margin-x` and `osd-margin-y`.
Offsetting `osd-margin-x` and `osd-margin-y` by our margin prevents
overlap of osd messages with the GUI.
This commit is contained in:
christoph-heinrich
2023-04-09 08:48:15 +02:00
committed by GitHub
parent 50c9629538
commit 6d58ef4c99
4 changed files with 52 additions and 19 deletions

View File

@@ -48,10 +48,8 @@ local TopBar = class(Element)
function TopBar:new() return Class.new(self) --[[@as TopBar]] end
function TopBar:init()
Element.init(self, 'top_bar')
self.size, self.size_max, self.size_min = 0, 0, 0
self.icon_size, self.spacing, self.font_size, self.title_bx = 1, 1, 1, 1
self.size_min_override = options.timeline_start_hidden and 0 or nil
self.top_border = options.timeline_border
self.size = 0
self.icon_size, self.spacing, self.font_size, self.title_bx, self.title_by = 1, 1, 1, 1, 1
self.show_alt_title = false
self.main_title, self.alt_title = nil, nil
@@ -241,8 +239,12 @@ function TopBar:render()
color = bg, opacity = visibility * options.top_bar_title_opacity, radius = 2,
})
ass:txt(title_ax + padding, title_ay + height / 2, 4, text, opts)
title_ay = by + 1
end
end
self.title_by = title_ay - 1
else
self.title_by = self.ay
end
return ass