kivy: add delay to ActionButtons
This commit is contained in:
parent
b3ef2249b5
commit
f8f124ad84
|
@ -1,3 +1,4 @@
|
||||||
|
#:import Clock kivy.clock.Clock
|
||||||
#:import Window kivy.core.window.Window
|
#:import Window kivy.core.window.Window
|
||||||
#:import Factory kivy.factory.Factory
|
#:import Factory kivy.factory.Factory
|
||||||
#:import _ electrum.i18n._
|
#:import _ electrum.i18n._
|
||||||
|
@ -354,8 +355,8 @@
|
||||||
|
|
||||||
<ActionOvrButton@ActionButton>
|
<ActionOvrButton@ActionButton>
|
||||||
on_release:
|
on_release:
|
||||||
if self.parent: self.parent.parent.dismiss()
|
Clock.schedule_once(lambda dt: self.parent.parent.dismiss() if self.parent else None, 0.05)
|
||||||
|
Clock.schedule_once(lambda dt: app.popup_dialog(self.name), 0.05)
|
||||||
|
|
||||||
<SettingsItem@ButtonBehavior+BoxLayout>
|
<SettingsItem@ButtonBehavior+BoxLayout>
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
|
@ -422,20 +423,15 @@ BoxLayout:
|
||||||
# when widget overflow drop down is shown, adjust the width
|
# when widget overflow drop down is shown, adjust the width
|
||||||
parent = args[1]
|
parent = args[1]
|
||||||
if parent: ao._dropdown.width = sp(200)
|
if parent: ao._dropdown.width = sp(200)
|
||||||
on_release: app.popup_dialog(self.name)
|
|
||||||
ActionOvrButton:
|
ActionOvrButton:
|
||||||
name: 'settings'
|
name: 'settings'
|
||||||
text: _('Settings')
|
text: _('Settings')
|
||||||
on_release: app.settings_dialog()
|
|
||||||
ActionOvrButton:
|
ActionOvrButton:
|
||||||
name: 'wallets'
|
name: 'wallets'
|
||||||
text: _('Wallets')
|
text: _('Wallets')
|
||||||
on_release: app.popup_dialog(self.name)
|
|
||||||
ActionOvrButton:
|
ActionOvrButton:
|
||||||
name: 'plugins'
|
name: 'plugins'
|
||||||
text: _('Plugins')
|
text: _('Plugins')
|
||||||
on_release: app.popup_dialog(self.name)
|
|
||||||
|
|
||||||
ScreenManager:
|
ScreenManager:
|
||||||
id: manager
|
id: manager
|
||||||
ScreenTabs:
|
ScreenTabs:
|
||||||
|
|
|
@ -409,8 +409,11 @@ class ElectrumWindow(App):
|
||||||
self.load_wallet(wallet)
|
self.load_wallet(wallet)
|
||||||
|
|
||||||
def popup_dialog(self, name):
|
def popup_dialog(self, name):
|
||||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
if name == 'settings':
|
||||||
popup.open()
|
self.settings_dialog()
|
||||||
|
else:
|
||||||
|
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||||
|
popup.open()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue