test-kivy-app/kivy_venv/lib/python3.11/site-packages/kivymd/uix/sliverappbar/sliverappbar.kv

50 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2024-09-15 12:12:16 +00:00
#:import ScrollEffect kivy.effects.scroll.ScrollEffect
<MDSliverAppbar>
FloatLayout:
id: float_box
BoxLayout:
canvas.after:
Color:
rgba:
root.background_color \
if root.background_color else \
2024-09-15 17:57:02 +00:00
root.theme_cls.primaryColor
2024-09-15 12:12:16 +00:00
a: root._opacity
Rectangle:
pos: self.pos
size: self.size
id: header
size_hint_y: None
height: root.max_height + root.radius[0]
pos: self.x, root.height - root.max_height - root.radius[0]
ScrollView:
id: scroll
effect_cls: ScrollEffect
on_vbar: root.on_vbar()
on_scroll_start:
if not root._scroll_was_moving: root._scroll_was_moving = True
2024-09-15 17:57:02 +00:00
BoxLayout:
2024-09-15 12:12:16 +00:00
id: scroll_box
orientation: "vertical"
2024-09-15 17:57:02 +00:00
size_hint_y: None
height: self.minimum_height
2024-09-15 12:12:16 +00:00
BoxLayout:
size_hint_y: None
height: root.max_height
2024-09-15 17:57:02 +00:00
<MDSliverAppbarContent>
adaptive_height: True
md_bg_color:
self.theme_cls.surfaceColor \
if self.theme_bg_color == "Primary" else \
self.md_bg_color