mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Cancel colorscheme window on outside tap
This commit is contained in:
parent
1a3353f26b
commit
109e61c5a3
1 changed files with 6 additions and 1 deletions
|
|
@ -165,11 +165,12 @@ class ColorSchemeWindow(ba.Window):
|
||||||
if uiscale is ba.UIScale.MEDIUM
|
if uiscale is ba.UIScale.MEDIUM
|
||||||
else 1.0
|
else 1.0
|
||||||
)
|
)
|
||||||
top_extra = 15 if uiscale is ba.UIScale.SMALL else 15
|
top_extra = 15
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=ba.containerwidget(
|
root_widget=ba.containerwidget(
|
||||||
size=(width, height + top_extra),
|
size=(width, height + top_extra),
|
||||||
|
on_outside_click_call=self.cancel_on_outside_click,
|
||||||
transition="in_right",
|
transition="in_right",
|
||||||
scale=self._base_scale,
|
scale=self._base_scale,
|
||||||
stack_offset=(0, 15) if uiscale is ba.UIScale.SMALL else (0, 0),
|
stack_offset=(0, 15) if uiscale is ba.UIScale.SMALL else (0, 0),
|
||||||
|
|
@ -286,6 +287,10 @@ class ColorSchemeWindow(ba.Window):
|
||||||
tag=tag,
|
tag=tag,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def cancel_on_outside_click(self):
|
||||||
|
ba.playsound(ba.getsound("swish"))
|
||||||
|
self._cancel()
|
||||||
|
|
||||||
def _cancel(self):
|
def _cancel(self):
|
||||||
if self._last_color and self._last_highlight:
|
if self._last_color and self._last_highlight:
|
||||||
colorscheme = ColorScheme(self._last_color, self._last_highlight)
|
colorscheme = ColorScheme(self._last_color, self._last_highlight)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue