Sideband/sbapp/kivymd/uix/filemanager/filemanager.kv

108 lines
2.7 KiB
Plaintext
Raw Normal View History

2022-07-07 14:16:10 -06:00
#:import os os
<BodyManager>
icon: "folder"
path: ""
background_normal: ""
background_down: ""
dir_or_file_name: ""
2022-10-02 09:16:59 -06:00
icon_color: 0, 0, 0, 0
2022-07-07 14:16:10 -06:00
_selected: False
events_callback: lambda x: None
orientation: "vertical"
ModifiedOneLineIconListItem:
text: root.dir_or_file_name
2022-10-02 09:16:59 -06:00
on_release: root.events_callback(root.path, root)
2022-07-07 14:16:10 -06:00
bg_color:
self.theme_cls.bg_darkest \
2022-10-02 09:16:59 -06:00
if root._selected else \
self.theme_cls.bg_normal
2022-07-07 14:16:10 -06:00
IconLeftWidget:
icon: root.icon
2022-10-02 09:16:59 -06:00
theme_icon_color: "Custom"
icon_color: root.icon_color
2022-07-07 14:16:10 -06:00
MDSeparator:
<LabelContent@MDLabel>
2022-10-02 09:16:59 -06:00
adaptive_height: True
2022-07-07 14:16:10 -06:00
shorten: True
shorten_from: "center"
halign: "center"
text_size: self.width, None
<BodyManagerWithPreview>
name: ""
path: ""
realpath: ""
type: "folder"
events_callback: lambda x: None
_selected: False
orientation: "vertical"
size_hint_y: None
hright: root.height
padding: dp(20)
IconButton:
mipmap: True
source: root.path
bg_color:
app.theme_cls.bg_darkest \
if root._selected else app.theme_cls.bg_normal
on_release:
root.events_callback( \
os.path.join(root.path if root.type != "folder" \
else root.realpath, root.name), root)
LabelContent:
text: root.name
<MDFileManager>
md_bg_color: root.theme_cls.bg_normal
MDBoxLayout:
orientation: "vertical"
spacing: dp(5)
MDTopAppBar:
id: toolbar
title: root.current_path
right_action_items: [["close-box", lambda x: root.exit_manager(1)]]
left_action_items: [["chevron-left", lambda x: root.back()]]
2022-10-02 09:16:59 -06:00
elevation: 3
md_bg_color:
app.theme_cls.primary_color \
if not root.background_color_toolbar else \
root.background_color_toolbar
2022-07-07 14:16:10 -06:00
RecycleView:
id: rv
key_viewclass: "viewclass"
key_size: "height"
bar_width: dp(4)
bar_color: root.theme_cls.primary_color
RecycleGridLayout:
padding: "10dp"
spacing: "2dp"
cols: 3 if root.preview else 1
default_size: None, dp(48)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
<ModifiedOneLineIconListItem>
BoxLayout:
id: _left_container
size_hint: None, None
x: root.x + dp(16)
y: root.y + root.height / 2 - self.height / 2
size: dp(48), dp(48)