diff options
Diffstat (limited to 'plugins/bigclock.lua')
-rw-r--r-- | plugins/bigclock.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua index a7b4958..1f38b02 100644 --- a/plugins/bigclock.lua +++ b/plugins/bigclock.lua @@ -21,6 +21,7 @@ function ClockView:new() ClockView.super.new(self) self.time_text = "" self.date_text = "" + self.last_scale = 0 end @@ -30,14 +31,18 @@ end function ClockView:update_fonts() + if self.last_scale ~= config.plugins.bigclock.scale then + self.last_scale = config.plugins.bigclock.scale + else + return + end local size = math.floor(self.size.x * 0.15 / 15) * 15 * config.plugins.bigclock.scale if self.font_size ~= size then - self.time_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size) - self.date_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size * 0.3) + self.time_font = renderer.font.copy(style["font"], size) + self.date_font = renderer.font.copy(style["font"], size * 0.3) self.font_size = size collectgarbage() end - return self.font end |