|
1 |
| -#: import images_path kivymd.images_path |
2 |
| - |
3 | 1 | <MDSearchTrailingAvatar>:
|
4 | 2 | size_hint_x: None
|
5 | 3 | width: dp(30)
|
6 | 4 |
|
7 | 5 | <MDSearchTrailingIcon>:
|
8 | 6 | size_hint: [None, 1]
|
9 | 7 | width: dp(24)
|
10 |
| - theme_icon_color: "Custom" |
11 | 8 | icon_color: app.theme_cls.onSurfaceColor
|
12 | 9 |
|
13 |
| -<MDSearchView>: |
14 |
| - overlay_color: [0] * 4 |
15 |
| - background: f"{images_path}/transparent.png" |
16 |
| - boder: [0] * 4 |
17 |
| - _anim_duration: 0 |
18 |
| - FloatLayout |
19 |
| - MDBoxLayout: |
20 |
| - id: root_container |
21 |
| - orientation: 'vertical' |
22 |
| - md_bg_color: app.theme_cls.surfaceContainerHighColor |
23 |
| - adaptive_height: True |
24 |
| - size_hint_x: None |
25 |
| - canvas: |
26 |
| - Color: |
27 |
| - rgba: app.theme_cls.outlineColor |
28 |
| - Line: |
29 |
| - points: |
30 |
| - [[self.x,self.y-root._header_height+self.height], |
31 |
| - [self.x+self.width, self.y-root._header_height+self.height]] |
32 |
| - BoxLayout: |
33 |
| - size_hint_y: None |
34 |
| - height: root._header_height |
35 |
| - spacing: dp(16) |
36 |
| - padding: [dp(16), 0] |
37 |
| - MDIconButton: |
38 |
| - icon: "arrow-left" |
39 |
| - size_hint: [None, 1] |
40 |
| - width: dp(24) |
41 |
| - on_release: root.close_view() |
42 |
| - theme_icon_color: "Custom" |
43 |
| - icon_color: app.theme_cls.onSurfaceColor |
| 10 | +<MDSearchLeadingIcon>: |
| 11 | + size_hint: [None, 1] |
| 12 | + width: dp(24) |
| 13 | + icon_color: app.theme_cls.onSurfaceColor |
44 | 14 |
|
45 |
| - BoxLayout: |
46 |
| - size_hint: [None, None] |
47 |
| - size:[ dp(360), dp(240)] |
| 15 | +<MDSearchBarTrailingContainer>: |
| 16 | + size_hint_x: None |
| 17 | + width: self.minimum_width |
| 18 | + spacing: dp(16) |
| 19 | + |
| 20 | +<MDSearchBarLeadingContainer>: |
| 21 | + size_hint_x: None |
| 22 | + width: self.minimum_width |
| 23 | + spacing: dp(16) |
48 | 24 |
|
| 25 | +<MDSearchViewTrailingContainer>: |
| 26 | + size_hint_x: None |
| 27 | + width: self.minimum_width |
| 28 | + spacing: dp(16) |
| 29 | + |
| 30 | +<MDSearchViewLeadingContainer>: |
| 31 | + size_hint_x: None |
| 32 | + width: self.minimum_width |
| 33 | + spacing: dp(16) |
| 34 | + |
| 35 | +<MDSearchViewContainer>: |
| 36 | + size_hint_y:None |
| 37 | + height:dp(55) |
| 38 | + canvas: |
| 39 | + Color: |
| 40 | + rgba: app.theme_cls.outlineColor |
| 41 | + Line: |
| 42 | + points: |
| 43 | + [[self.x,self.y+self.height], |
| 44 | + [self.x+self.width, self.y+self.height]] |
| 45 | + |
| 46 | +<MDSearchWidget>: |
| 47 | + MDBoxLayout: |
| 48 | + id: root_container |
| 49 | + orientation: 'vertical' |
| 50 | + md_bg_color: app.theme_cls.surfaceContainerHighColor |
| 51 | + size_hint: [None, None] |
| 52 | + orientation: 'vertical' |
| 53 | + # header |
| 54 | + BoxLayout: |
| 55 | + id: header |
| 56 | + padding: [dp(16), 0] |
| 57 | + spacing: dp(16) |
| 58 | + size_hint_y: None |
| 59 | + height: dp(56) |
| 60 | + TextInput: |
| 61 | + id: text_input |
| 62 | + background_color:[0,0,0,0] |
| 63 | + foreground_color: app.theme_cls.onSurfaceColor |
| 64 | + cursor_color:app.theme_cls.outlineColor |
| 65 | + hint_text_color: app.theme_cls.onSurfaceVariantColor |
| 66 | + padding: [0, (self.parent.height - self.font_size - dp(3)) / 2] |
| 67 | + multiline: False |
| 68 | + font_size: root._font_style["font-size"] |
| 69 | + on_focus: if args[-1]: root.switch_state("open") |
| 70 | + Widget: |
49 | 71 | <MDSearchBar>:
|
50 | 72 | size_hint_y: None
|
51 | 73 | height: dp(56)
|
52 |
| - md_bg_color: app.theme_cls.surfaceContainerHighColor |
53 |
| - radius: dp(28) |
54 |
| - spacing: dp(16) |
55 |
| - padding: [dp(16), 0] |
56 |
| - adaptive_width: False |
57 |
| - on_release: self._search_view.open_view() |
58 |
| - MDIconButton: |
59 |
| - icon: root.leading_icon |
60 |
| - size_hint: [None, 1] |
61 |
| - width: dp(24) |
62 |
| - on_release: root.on_leading_icon_release() |
63 |
| - on_press: root.on_leading_icon_press() |
64 |
| - theme_icon_color: "Custom" |
65 |
| - icon_color: app.theme_cls.onSurfaceColor |
66 |
| - MDLabel: |
67 |
| - text: root.supporting_text |
68 |
| - theme_text_color: "Custom" |
69 |
| - text_color: app.theme_cls.onSurfaceVariantColor |
70 |
| - theme_font_size: "Custom" |
71 |
| - font_style: "Title" |
72 |
| - role: "medium" |
73 |
| - size_hint_x: None |
74 |
| - padding: root._supporting_text_padding if root.adaptive_width else 0 |
75 |
| - adaptive_width:root.adaptive_width |
76 |
| - size_hint_x: 1 if not root.adaptive_width else None |
0 commit comments