comparison src/cagou/kv/menu.kv @ 97:5d2289127bb7

menu (upload): better menu using dedicated widget: upload menu now use a decicated widget instead of context menu. The menu take half the size of the main window, and show each upload option as an icon. Use can select upload or P2P sending, and a short text message explains how the file will be transmitted.
author Goffi <goffi@goffi.org>
date Thu, 29 Dec 2016 23:47:07 +0100
parents c711be670ecd
children 4d8c122b86a6
comparison
equal deleted inserted replaced
96:641678ddc26c 97:5d2289127bb7
12 # GNU Affero General Public License for more details. 12 # GNU Affero General Public License for more details.
13 13
14 # You should have received a copy of the GNU Affero General Public License 14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16
17 #:import _ sat.core.i18n._
17 18
18 <AboutContent>: 19 <AboutContent>:
19 text_size: self.size 20 text_size: self.size
20 halign: "center" 21 halign: "center"
21 valign: "middle" 22 valign: "middle"
32 height: self.children[0].height if self.children else 30 33 height: self.children[0].height if self.children else 30
33 34
34 <MainMenu>: 35 <MainMenu>:
35 cancel_handler_widget: self.parent 36 cancel_handler_widget: self.parent
36 37
37 <UploadMenu>: 38 <TransferMenu>:
38 cancel_handler_widget: self.parent if self.parent else self.orig_parent 39 items_layout: items_layout
40 orientation: "vertical"
41 pos_hint: {"top": 0.5}
42 size_hint: 1, 0.5
43 canvas.before:
44 Color:
45 rgba: 0, 0, 0, 1
46 Rectangle:
47 pos: self.pos
48 size: self.size
49 BoxLayout:
50 size_hint: 1, None
51 height: dp(50)
52 ToggleButton:
53 id: upload_btn
54 text: _(u"upload")
55 group: "transfer"
56 state: "down"
57 ToggleButton:
58 id: send_btn
59 text: _(u"send")
60 group: "transfer"
61 Label:
62 size_hint: 1, 0.3
63 text: root.transfer_txt if upload_btn.state == 'down' else root.send_txt
64 text_size: self.size
65 halign: 'center'
66 valign: 'top'
67 ScrollView:
68 do_scroll_x: False
69 StackLayout:
70 size_hint: 1, None
71 padding: 20, 0
72 spacing: 15, 5
73 id: items_layout
74
75 <TransferItem>:
76 orientation: "vertical"
77 size_hint: None, None
78 size: dp(50), dp(90)
79 IconButton:
80 source: root.plug_info['icon_medium']
81 allow_stretch: True
82 size_hint: 1, None
83 height: dp(50)
84 Label:
85 text: root.plug_info['name']
86 text_size: self.size
87 halign: "center"
88 valign: "top"
89