diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-11-30 14:47:42 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-11-30 15:25:20 -0500 |
commit | 7cfcdcea4b4a4984cd6625a60e9fc2a44d0ec9c9 (patch) | |
tree | 1750ddaec58acedd89494447efa592417a9d9d2f /plugins/plugin_manager/plugin_view.lua | |
parent | f91c4d2671012a52ac0ed988426fe8bbdb1216c9 (diff) | |
download | lite-xl-plugin-manager-7cfcdcea4b4a4984cd6625a60e9fc2a44d0ec9c9.tar.gz lite-xl-plugin-manager-7cfcdcea4b4a4984cd6625a60e9fc2a44d0ec9c9.zip |
Added in loading screen for welcome dialog.
Diffstat (limited to 'plugins/plugin_manager/plugin_view.lua')
-rw-r--r-- | plugins/plugin_manager/plugin_view.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/plugin_manager/plugin_view.lua b/plugins/plugin_manager/plugin_view.lua index b864675..f8f503b 100644 --- a/plugins/plugin_manager/plugin_view.lua +++ b/plugins/plugin_manager/plugin_view.lua @@ -149,7 +149,9 @@ function PluginView:draw_loading_screen(label, percent) common.draw_text(style.big_font, style.dim, "Loading...", "center", self.position.x, self.position.y, self.size.x, self.size.y) local width = self.size.x / 2 local offset_y = self.size.y / 2 - if self.progress then + if label or percent then + local th = style.font:get_height() + local lh = th + style.padding.y common.draw_text(style.font, style.dim, label, "center", self.position.x, self.position.y + offset_y + lh, self.size.x, lh) draw_loading_bar(self.position.x + (self.size.x / 2) - (width / 2), self.position.y + self.size.y / 2 + (lh * 2), width, lh, percent) end @@ -161,7 +163,7 @@ function PluginView:draw() local lh = th + style.padding.y if not self.initialized or not self.widths then - return self:draw_loading_screen(self.progress.label, self.progress.percent) + return self:draw_loading_screen(self.progress and self.progress.label, self.progress and self.progress.percent) end |