2 changed files with 72 additions and 1 deletions
@ -0,0 +1,48 @@ |
|||||||
|
from kivy.app import App |
||||||
|
from kivy.factory import Factory |
||||||
|
from kivy.properties import ObjectProperty |
||||||
|
from kivy.lang import Builder |
||||||
|
|
||||||
|
Builder.load_string(''' |
||||||
|
<FeeDialog@Popup> |
||||||
|
id: popup |
||||||
|
title: '' |
||||||
|
size_hint: 0.8, 0.8 |
||||||
|
pos_hint: {'top':0.9} |
||||||
|
BoxLayout: |
||||||
|
orientation: 'vertical' |
||||||
|
BoxLayout: |
||||||
|
orientation: 'horizontal' |
||||||
|
size_hint: 1, 0.5 |
||||||
|
Label: |
||||||
|
text: _('Dynamic fees') |
||||||
|
CheckBox: |
||||||
|
id: dynfees |
||||||
|
BoxLayout: |
||||||
|
orientation: 'horizontal' |
||||||
|
size_hint: 1, 0.5 |
||||||
|
Button: |
||||||
|
text: 'Cancel' |
||||||
|
size_hint: 0.5, None |
||||||
|
height: '48dp' |
||||||
|
on_release: popup.dismiss() |
||||||
|
Button: |
||||||
|
text: 'OK' |
||||||
|
size_hint: 0.5, None |
||||||
|
height: '48dp' |
||||||
|
on_release: |
||||||
|
root.on_ok() |
||||||
|
root.dismiss() |
||||||
|
''') |
||||||
|
|
||||||
|
class FeeDialog(Factory.Popup): |
||||||
|
|
||||||
|
def __init__(self, config, callback): |
||||||
|
Factory.Popup.__init__(self) |
||||||
|
self.config = config |
||||||
|
self.callback = callback |
||||||
|
self.ids.dynfees.active = self.config.get('dynamic_fees') |
||||||
|
|
||||||
|
def on_ok(self): |
||||||
|
self.config.set_key('dynamic_fees', self.ids.dynfees.active, True) |
||||||
|
self.callback() |
||||||
Loading…
Reference in new issue