comparison cagou/kv/menu.kv @ 417:5b50b7ef2617

menu (TransferMenu): UI improvments: - a white background is now used - ToggleButton have been replaced by SymbolButtonLabel - transfer info message now displays with emphasis if the file will be encrypted or not, and explain when the file goes to the server - various padding/spacing/color adjustments
author Goffi <goffi@goffi.org>
date Sun, 23 Feb 2020 17:16:27 +0100
parents 5761b5f03c0c
children ee4913d35c55
comparison
equal deleted inserted replaced
416:3e2333a11f61 417:5b50b7ef2617
40 # to push content to the top 40 # to push content to the top
41 41
42 <TransferMenu>: 42 <TransferMenu>:
43 items_layout: items_layout 43 items_layout: items_layout
44 orientation: "vertical" 44 orientation: "vertical"
45 bg_color: app.c_prim
45 size_hint: 1, 0.5 46 size_hint: 1, 0.5
46 canvas.before: 47 padding: [app.MARGIN_LEFT, 3, app.MARGIN_RIGHT, 0]
48 spacing: dp(5)
49 transfer_info: transfer_info
50 upload_btn: upload_btn
51 on_encrypted: self.updateTransferInfo()
52 canvas.after:
47 Color: 53 Color:
48 rgba: 0, 0, 0, 1 54 rgba: app.c_prim_dark
49 Rectangle: 55 Line:
50 pos: self.pos 56 points: 0, self.y + self.height, self.width + self.x, self.y + self.height
51 size: self.size 57 width: 1
52 BoxLayout: 58 BoxLayout:
53 size_hint: 1, None 59 size_hint: 1, None
54 height: dp(50) 60 height: dp(50)
55 ToggleButton: 61 spacing: dp(10)
62 Widget:
63 SymbolToggleLabel
56 id: upload_btn 64 id: upload_btn
65 symbol: "upload"
57 text: _(u"upload") 66 text: _(u"upload")
58 group: "transfer" 67 group: "transfer"
59 state: "down" 68 state: "down"
60 ToggleButton: 69 on_state: root.updateTransferInfo()
70 SymbolToggleLabel
61 id: send_btn 71 id: send_btn
72 symbol: "loop-alt"
62 text: _(u"send") 73 text: _(u"send")
63 group: "transfer" 74 group: "transfer"
75 Widget:
64 Label: 76 Label:
65 size_hint: 1, 0.3 77 id: transfer_info
66 text: root.transfer_txt if upload_btn.state == 'down' else root.send_txt 78 size_hint: 1, None
67 text_size: self.size 79 padding: 0, dp(5)
80 markup: True
81 text_size: root.width, None
82 size: self.texture_size
68 halign: 'center' 83 halign: 'center'
69 valign: 'top' 84 canvas.before:
85 Color:
86 rgba: app.c_prim_dark
87 RoundedRectangle:
88 pos: self.pos
89 size: self.size
70 ScrollView: 90 ScrollView:
71 do_scroll_x: False 91 do_scroll_x: False
72 StackLayout: 92 StackLayout:
73 size_hint: 1, None 93 size_hint: 1, None
74 padding: 20, 0 94 padding: 20, 0