Skip to content

Commit

Permalink
tweak: same spacing between all top bar elements (#893)
Browse files Browse the repository at this point in the history
There is no reason why that space should be any different to the one
between the playlist and the title
  • Loading branch information
christoph-heinrich authored May 1, 2024
1 parent 00737e1 commit 56b62bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/uosc/elements/TopBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function TopBar:new() return Class.new(self) --[[@as TopBar]] end
function TopBar:init()
Element.init(self, 'top_bar', {render_order = 4})
self.size = 0
self.icon_size, self.spacing, self.font_size, self.title_bx, self.title_by = 1, 1, 1, 1, 1
self.icon_size, self.font_size, self.title_bx, self.title_by = 1, 1, 1, 1
self.show_alt_title = false
self.main_title, self.alt_title = nil, nil

Expand Down Expand Up @@ -136,8 +136,7 @@ end
function TopBar:update_dimensions()
self.size = round(options.top_bar_size * state.scale)
self.icon_size = round(self.size * 0.5)
self.spacing = math.ceil(self.size * 0.25)
self.font_size = math.floor((self.size - (self.spacing * 2)) * options.font_scale)
self.font_size = math.floor((self.size - (math.ceil(self.size * 0.25) * 2)) * options.font_scale)
self.button_width = round(self.size * 1.15)
local window_border_size = Elements:v('window_border', 'size', 0)
self.ay = window_border_size
Expand Down Expand Up @@ -207,7 +206,7 @@ function TopBar:render()
local spacing = 1
local title_ax = self.ax + bg_margin
local title_ay = self.ay + bg_margin
local max_bx = self.title_bx - self.spacing
local max_bx = self.title_bx - bg_margin

-- Playlist position
if state.has_playlist then
Expand Down

0 comments on commit 56b62bb

Please sign in to comment.