Final tutorial button

Changed the texture to "frameInset" and the button will only appear only if the external_url is not empty.
This commit is contained in:
Sravan Kumar 2023-01-31 15:39:13 +05:30 committed by GitHub
parent ac26f010aa
commit faf2b8a0b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -962,33 +962,35 @@ class PluginWindow(popup.PopupWindow):
scale=0.45) scale=0.45)
## Below snippet handles the tutorial button in the plugin window ## Below snippet handles the tutorial button in the plugin window
open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else tutorial_url = self.plugin.info["external_url"]
50 if _uiscale is ba.UIScale.MEDIUM else 50) if tutorial_url:
open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else
110 if _uiscale is ba.UIScale.MEDIUM else 120) 70 if _uiscale is ba.UIScale.MEDIUM else 60)
open_button = ba.buttonwidget(parent=self._root_widget, open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else
autoselect=True, 110 if _uiscale is ba.UIScale.MEDIUM else 120)
position=(open_pos_x, open_pos_y), open_button = ba.buttonwidget(parent=self._root_widget,
size=(40, 40), autoselect=True,
button_type="square", position=(open_pos_x, open_pos_y),
label="", size=(40, 40),
# color=ba.app.ui.title_color, button_type="square",
color=(0.6, 0.53, 0.63), label="",
on_activate_call=lambda: ba.open_url(self.plugin.info["external_url"])) # color=ba.app.ui.title_color,
ba.imagewidget(parent=self._root_widget, color=(0.6, 0.53, 0.63),
position=(open_pos_x, open_pos_y), on_activate_call=lambda: ba.open_url(self.plugin.info["external_url"]))
size=(40, 40), ba.imagewidget(parent=self._root_widget,
color=(0.8, 0.95, 1), position=(open_pos_x, open_pos_y),
texture=ba.gettexture("file"), size=(40, 40),
draw_controller=open_button) color=(0.8, 0.95, 1),
ba.textwidget(parent=self._root_widget, texture=ba.gettexture("frameInset"),
position=(open_pos_x - 3, open_pos_y + 12), draw_controller=open_button)
text="Tutorial", ba.textwidget(parent=self._root_widget,
size=(10, 10), position=(open_pos_x - 3, open_pos_y + 12),
draw_controller=open_button, text="Tutorial",
color=(1, 1, 1, 1), size=(10, 10),
rotate=25, draw_controller=open_button,
scale=0.45) color=(1, 1, 1, 1),
rotate=25,
scale=0.45)
if to_draw_button4: if to_draw_button4:
settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else