commit f8f124ad8463ee1f047325e740b4dba258f0888f
parent b3ef2249b55d945868706d75baa426d3a1661da2
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 16 Dec 2015 12:40:30 +0100
kivy: add delay to ActionButtons
Diffstat:
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/gui/kivy/main.kv b/gui/kivy/main.kv
@@ -1,3 +1,4 @@
+#:import Clock kivy.clock.Clock
#:import Window kivy.core.window.Window
#:import Factory kivy.factory.Factory
#:import _ electrum.i18n._
@@ -354,8 +355,8 @@
<ActionOvrButton@ActionButton>
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>
orientation: 'vertical'
@@ -422,20 +423,15 @@ BoxLayout:
# when widget overflow drop down is shown, adjust the width
parent = args[1]
if parent: ao._dropdown.width = sp(200)
- on_release: app.popup_dialog(self.name)
ActionOvrButton:
name: 'settings'
text: _('Settings')
- on_release: app.settings_dialog()
ActionOvrButton:
name: 'wallets'
text: _('Wallets')
- on_release: app.popup_dialog(self.name)
ActionOvrButton:
name: 'plugins'
text: _('Plugins')
- on_release: app.popup_dialog(self.name)
-
ScreenManager:
id: manager
ScreenTabs:
diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py
@@ -409,8 +409,11 @@ class ElectrumWindow(App):
self.load_wallet(wallet)
def popup_dialog(self, name):
- popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
- popup.open()
+ if name == 'settings':
+ self.settings_dialog()
+ else:
+ popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
+ popup.open()