kivy: remove unneeded imports and fix copy, paste

This commit is contained in:
akshayaurora 2016-01-29 14:21:12 +05:30
parent 6ba43637f5
commit 2fc5f1f916
4 changed files with 3 additions and 61 deletions

View File

@ -18,29 +18,6 @@
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
<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'
###########################
# Global Defaults
###########################
@ -150,19 +127,6 @@
pos: self.pos
<TextInputBlue@TextInput>
padding: '5dp'
size_hint: 1, None
height: '27dp'
pos_hint: {'center_y':.5}
multiline: False
hint_text_color: self.foreground_color
foreground_color: 1, 1, 1, 1
font_size: '16dp'
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
background_active: 'atlas://gui/kivy/theming/light/textinput_active'
<KButton@Button>:
size_hint: 1, None
height: '48dp'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

View File

@ -19,7 +19,7 @@ source.include_exts = py,png,jpg,kv,atlas,ttf,txt,gif,pem,mo,vs,fs
source.exclude_exts = spec
# (list) List of directory to exclude (let empty to not exclude anything)
source.exclude_dirs = bin, build, dist, contrib, gui/android, gui/qt, gui/kivy/tools
source.exclude_dirs = bin, build, dist, contrib, gui/android, gui/qt, gui/kivy/tools, gui/kivy/theming/light
# (list) List of exclusions using pattern matching
source.exclude_patterns = Makefile,setup*

View File

@ -87,9 +87,6 @@ class CScreen(Factory.Screen):
self.add_widget(self.context_menu)
class HistoryScreen(CScreen):
tab = ObjectProperty(None)
@ -172,10 +169,6 @@ class HistoryScreen(CScreen):
history_card.add_widget(EmptyLabel(text=msg))
class SendScreen(CScreen):
kvname = 'send'
@ -210,7 +203,7 @@ class SendScreen(CScreen):
self.screen.message = pr.get_memo()
def do_paste(self):
contents = unicode(self.app._clipboard.get())
contents = unicode(self.app._clipboard.paste())
try:
uri = parse_URI(contents)
except:
@ -300,7 +293,7 @@ class ReceiveScreen(CScreen):
def do_copy(self):
uri = self.get_URI()
self.app._clipboard.put(uri, 'text/plain')
self.app._clipboard.copy(uri)
def do_save(self):
addr = str(self.screen.address)
@ -528,18 +521,3 @@ class TabbedCarousel(Factory.TabbedPanel):
self.carousel.add_widget(widget)
return
super(TabbedCarousel, self).add_widget(widget, index=index)
class ELTextInput(Factory.TextInput):
'''Custom TextInput used in main screens for numeric entry
'''
def insert_text(self, substring, from_undo=False):
if not from_undo:
if self.input_type == 'numbers':
numeric_list = map(str, range(10))
if '.' not in self.text:
numeric_list.append('.')
if substring not in numeric_list:
return
super(ELTextInput, self).insert_text(substring, from_undo=from_undo)