You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beta_channel_for_rift/landscape/ui_components.kv

300 lines
8.0 KiB

2 years ago
<MyButton@MDRaisedButton+MDTooltip>
3 years ago
size_hint_max: "100sp","40sp"
md_bg_color: app.theme_cls.accent_color
theme_text_color: "Custom"
2 years ago
text_color: app.get_text_color(self.theme_cls.primary_hue)
3 years ago
elevation_normal: 8
<MyRaisedIconButton@MDIconButton+MDTooltip>
md_bg_color: app.theme_cls.accent_color
theme_text_color: "Custom"
2 years ago
text_color: app.get_text_color(self.theme_cls.primary_hue)
3 years ago
elevation_normal: 8
<OldButton@Button+MDTooltip>
size_hint_max: "100sp","40sp"
background_color: app.theme_cls.accent_color if self.disabled else (app.theme_cls.accent_color if self.state == "normal" else bar_light)
background_disabled_down: ""
background_disabled_normal: ""
background_down: ""
background_normal: ""
<RoundedCard@MDCard>:
border_radius: 20
radius: [15]
<MyActionButton@ActionButton>:
color: app.theme_cls.primary_text()
<MyIconButton@MDIconButton+MDTooltip>:
<MySwitch@MDSwitch+MDTooltip>:
2 years ago
thumb_color_active: self.theme_cls.accent_color
3 years ago
<FAB@MDFloatingActionButton+HoverBehavior+MagicBehavior>:
elevation_normal: 8
2 years ago
text_color: app.get_accent_text_color()
3 years ago
on_enter: self.grow()
magic_speed: .1
<Details>
size_hint_max_y: "30sp"
valign: "center"
theme_text_color: "Primary"
<DetailBox>
multiline: False
2 years ago
helper_text_mode: "on_focus"
3 years ago
Widget:
size_hint_x: 0.1
MDRelativeLayout:
size_hint_x: 0.8
MDTextField:
id: text_field
text: root.text
on_text: root.text = self.text
multiline: root.multiline
hint_text: root.hint_text
required: root.required
helper_text: root.helper_text
helper_text_mode: root.helper_text_mode
password: root.password
write_tab: False
MyIconButton:
id: left_icon
disabled: root.left_disabled
icon: root.left_icon
pos: (- self.width, 0)
on_press: root.left_icon_action()
ripple_scale: .5
tooltip_text: root.left_tooltip
md_bg_color_disabled: 0, 0, 0, 0
MyIconButton:
id: right_icon
icon: root.right_icon
disabled: root.right_disabled
pos: (text_field.width, 0)
on_press: root.right_icon_action()
ripple_scale: .5
tooltip_text: root.right_tooltip
md_bg_color_disabled: 0, 0, 0, 0
Widget:
size_hint_x: 0.1
<DetailInt>:
orientation: "horizontal"
2 years ago
helper_text_mode: "on_focus"
3 years ago
Widget:
size_hint_x: 0.1
MDRelativeLayout:
size_hint_x: 0.8
DetailIntText:
text: root.text
on_text: root.text = self.text
multiline: root.multiline
hint_text: root.hint_text
required: root.required
helper_text: root.helper_text
helper_text_mode: root.helper_text_mode
allow_negative: root.allow_negative
write_tab: False
Widget:
size_hint_x: 0.1
<DetailIntText>:
<DetailFloatText>:
<DetailFloat>:
orientation: "horizontal"
2 years ago
helper_text_mode: "on_focus"
3 years ago
Widget:
size_hint_x: 0.1
MDRelativeLayout:
size_hint_x: 0.8
DetailFloatText:
text: root.text
on_text: root.text = self.text
multiline: root.multiline
hint_text: root.hint_text
required: root.required
helper_text: root.helper_text
helper_text_mode: root.helper_text_mode
write_tab: False
base_direction: "rtl"
Widget:
size_hint_x: 0.1
<Heading1>
size_hint_max_y: "47sp"
halign: "center"
valign: "center"
2 years ago
text_color: app.get_text_color()
3 years ago
theme_text_color: "Custom"
font_style: "Subtitle1"
canvas.before:
Color:
rgba: self.background_color
Rectangle:
pos: self.pos
size: self.size
<SelectableLabel>:
# Draw a background to indicate selection
size_hint_max_y: "50sp"
halign: "left"
canvas.before:
Color:
rgba: main_color if self.selected else (0, 0, 0, 1)
Rectangle:
pos: self.pos
size: self.size
<InvertSelectableLabel@SelectableLabel>:
# Draw a background to indicate selection
size_hint_max_y: "50sp"
halign: "left"
color: light_text if self.selected else dark_text
canvas.before:
Color:
rgba: highlight_color if self.selected else [1,1,1,1]
Rectangle:
pos: self.pos
size: self.size
<Picker>:
on_release: if root.menu: root.menu.open()
<InfoBox>:
do_scroll_x: True
do_scroll_y: True
spacing: "10sp"
RstDocument:
size: root.size
text: root.text
<SelectableIcon@SelectableLabel>:
icon: ""
padding: ("10sp","10sp")
canvas:
Rectangle:
source:self.icon
pos: self.pos
size: (self.size[0] - 10, self.size[1] - 10)
<InvertSelectableIcon@InvertSelectableLabel>:
icon: ""
padding: ("10sp","10sp")
canvas:
Rectangle:
source:self.icon
pos: self.pos
size: (self.size[0] - 10, self.size[1] - 10)
<ModalContent@BoxLayout>:
orientation: "vertical"
<MyModal>:
auto_dismiss: False
id: test
canvas:
Color:
rgba: main_color
Rectangle:
pos: self.pos
size: self.size
RelativeLayout:
ModalContent:
id: modalContent
size:(1, 0.9)
FAB:
on_release: root.action()
id: modalClose
icon: root.icon
pos: [root.size[0] - 1.5 * self.size[0], 0.5 * self.size[1]]
<LoadDialog>:
MDBoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
md_bg_color: (1,1,1,1) if app.theme_cls.theme_style == "Light" else (0,0,0,1)
FileChooserListView:
id: filechooser
filters: [root.pattern]
path: root.path
pos_hint: {"center_x": .5, "center_y": .5}
dirselect: root.dirselect
on_submit: root.load(filechooser.path, filechooser.selection)
FAB:
icon: "close"
on_release: root.cancel()
pos: [root.size[0] - 1.5 * self.size[0] + root.pos[0], 0.5 * self.size[1] + root.pos[1]]
<SaveDialog>:
text_input: save_name
MDBoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
md_bg_color: (1,1,1,1) if app.theme_cls.theme_style == "Light" else (0,0,0,1)
MDTextField:
id: save_name
size_hint_y: None
height: "30sp"
multiline: False
FileChooserListView:
id: filechooser
filters: ["*.json"]
on_selection: save_name.text = self.selection and self.selection[0] or ''
path: root.path
background_color: 1,1,1,1
FAB:
icon: "close"
on_release: root.cancel()
md_bg_color: self.theme_cls.accent_color
pos: [root.size[0] - 1.5 * self.size[0] + root.pos[0], 1.75 * self.size[1] + root.pos[1]]
FAB:
icon: "check"
on_release: root.save(filechooser.path, save_name.text)
pos: [root.size[0] - 1.5 * self.size[0] + root.pos[0], 0.5 * self.size[1] + root.pos[1]]
<DetailTab>:
orientation: "vertical"
padding: "10sp"
<EmptyTab>:
MDLabel:
text: "No Data"
<ListView>:
<SelectableListItem>:
on_release: root._select()
_no_ripple_effect: True
theme_text_color: "Custom"
text_color: self.theme_cls.text_color
font_style: "Subtitle2"
<LoadingPopup@ModalView>:
background_color: (1, 1, 1, 0.3)
size_hint: 1, .1
pos_hint: {"center_x": .5, "center_y": .5}
auto_dismiss: False
color: (0,0,0,1)
MDSpinner:
color: root.color
stroke_width: 2
speed: 1.5
size_hint: .15, .15