Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tweak: same spacing between all top bar elements #893

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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