electrum-bitcoinprivate/gui/kivy/main.kv

137 lines
4.1 KiB
Plaintext

#:import Window kivy.core.window.Window
# Custom Global Widgets
<VGridLayout@GridLayout>:
rows: 1
size_hint: 1, None
height: self.minimum_height
<IconButton@ButtonBehavior+Image>
allow_stretch: True
size_hint_x: None
width: self.height
canvas:
BorderImage:
border: (10, 10, 10, 10)
source:
'atlas://gui/kivy/theming/light/' + ('tab_btn'\
if root.state == 'normal' else 'icon_border')
size: root.size
pos: root.pos
<Butt_star@ActionToggleButton>:
important: True
size_hint_x: None
width: '32dp'
mipmap: True
state: 'down' if app.expert_mode else 'normal'
background_down: self.background_normal
foreground_color: (.466, .466, .466, 1)
color_active: (0.235, .588, .89, 1)
on_release: app.expert_mode = True if self.state == 'down' else False
Image:
source: 'atlas://gui/kivy/theming/light/star_big_inactive'
center: root.center
size: root.width/1.5, self.width
color:
root.foreground_color if root.state == 'normal' else root.color_active
canvas.after:
Color:
rgba: 1, 1, 1, 1
source:
allow_stretch: True
<ELTextInput>
padding: '10dp', '4dp'
background_color: (0.238, 0.589, .996, 1) if self.focus else self.foreground_color
foreground_color: 0.531, 0.531, 0.531, 1
background_active: 'atlas://gui/kivy/theming/light/textinput_active'
background_normal: 'atlas://gui/kivy/theming/light/textinput_active'
<CreateAccountButtonBlue@Button>
canvas.after:
Color
rgba: 1, 1, 1, 1 if self.disabled else 0
Rectangle:
texture: self.texture
size: self.size
pos: self.pos
Color
rgba: .5, .5, .5, .5 if self.disabled else 0
Rectangle:
texture: self.texture
size: self.size
pos: self.x - dp(1), self.y + dp(1)
border: 15, 5, 5, 5
background_color: (1, 1, 1, 1) if self.disabled else (.203, .490, .741, 1 if self.state == 'normal' else .75)
size_hint: 1, None
height: '48sp'
text_size: self.size
halign: 'center'
valign: 'middle'
root: None
background_normal: 'atlas://gui/kivy/theming/light/btn_create_account'
background_down: 'atlas://gui/kivy/theming/light/btn_create_account'
background_disabled_normal: 'atlas://gui/kivy/theming/light/btn_create_act_disabled'
on_press: if self.root: self.root.dispatch('on_press', self)
on_release: if self.root: self.root.dispatch('on_release', self)
<CreateAccountButtonGreen@CreateAccountButtonBlue>
background_color: (1, 1, 1, 1) if self.disabled else (.415, .717, 0, 1 if self.state == 'normal' else .75)
###########################
## Gloabal Defaults
###########################
<TextInput>
on_focus: app._focused_widget = root
<Label>
markup: True
font_name: 'Roboto'
font_size: '16sp'
<ListItemButton>
font_size: '12sp'
#########################
# Dialogs
#########################
<InfoBubble>
size_hint: None, None
width: '270dp' if root.fs else min(self.width, dp(270))
height: self.width if self.fs else (lbl.texture_size[1] + dp(27))
BoxLayout:
padding: '5dp' if root.fs else 0
Widget:
size_hint: None, 1
width: '4dp' if root.fs else '2dp'
Image:
id: img
source: root.icon
mipmap: True
size_hint: None, 1
width: (root.width - dp(20)) if root.fs else (0 if not root.icon else '32dp')
Widget:
size_hint_x: None
width: '5dp'
Label:
id: lbl
markup: True
font_size: '12sp'
text: root.message
text_size: self.width, None
valign: 'middle'
size_hint: 1, 1
width: 0 if root.fs else (root.width - img.width)
StencilView:
manager: None
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle
size: self.size
pos: self.pos