mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-26 08:53:32 +08:00
Edit plugins.py
This commit is contained in:
parent
e6d3e7dff2
commit
de698f607f
@ -129,6 +129,15 @@ class PluginWindow(bui.Window):
|
||||
|
||||
settings_button_x = 670 if uiscale is bui.UIScale.SMALL else 570
|
||||
|
||||
self._num_plugins_text = bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(settings_button_x - 130, self._height - 38),
|
||||
size=(0, 0),
|
||||
text='',
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
)
|
||||
|
||||
self._category_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
scale=0.7,
|
||||
@ -174,6 +183,17 @@ class PluginWindow(bui.Window):
|
||||
)
|
||||
bui.widget(edit=self._scrollwidget, right_widget=self._scrollwidget)
|
||||
|
||||
self._no_plugins_installed_text = bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(self._width * 0.5, self._height * 0.5),
|
||||
size=(0, 0),
|
||||
text='',
|
||||
color=(0.6, 0.6, 0.6),
|
||||
scale=0.8,
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
)
|
||||
|
||||
if bui.app.meta.scanresults is None:
|
||||
bui.screenmessage(
|
||||
'Still scanning plugins; please try again.', color=(1, 0, 0)
|
||||
@ -274,6 +294,11 @@ class PluginWindow(bui.Window):
|
||||
|
||||
plugspecs_sorted = sorted(plugspecs.items())
|
||||
|
||||
bui.textwidget(
|
||||
edit=self._no_plugins_installed_text,
|
||||
text='',
|
||||
)
|
||||
|
||||
for _classpath, plugspec in plugspecs_sorted:
|
||||
# counting number of enabled and disabled plugins
|
||||
# plugstate = plugstates.setdefault(plugspec[0], {})
|
||||
@ -372,6 +397,17 @@ class PluginWindow(bui.Window):
|
||||
bui.widget(edit=check, show_buffer_top=40, show_buffer_bottom=40)
|
||||
num_shown += 1
|
||||
|
||||
bui.textwidget(
|
||||
edit=self._num_plugins_text,
|
||||
text=str(num_shown),
|
||||
)
|
||||
|
||||
if num_shown == 0:
|
||||
bui.textwidget(
|
||||
edit=self._no_plugins_installed_text,
|
||||
text='No Plugins Installed',
|
||||
)
|
||||
|
||||
def _save_state(self) -> None:
|
||||
try:
|
||||
sel = self._root_widget.get_selected_child()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user