|
48 | 48 | VALID_OVERLAY, |
49 | 49 | VALID_POSITION, |
50 | 50 | VALID_SCROLLBAR_GUTTER, |
| 51 | + VALID_SCROLLBAR_VISIBILITY, |
51 | 52 | VALID_TEXT_ALIGN, |
52 | 53 | VALID_TEXT_OVERFLOW, |
53 | 54 | VALID_TEXT_WRAP, |
@@ -153,11 +154,10 @@ class RulesMap(TypedDict, total=False): |
153 | 154 | scrollbar_background: Color |
154 | 155 | scrollbar_background_hover: Color |
155 | 156 | scrollbar_background_active: Color |
156 | | - |
157 | 157 | scrollbar_gutter: ScrollbarGutter |
158 | | - |
159 | 158 | scrollbar_size_vertical: int |
160 | 159 | scrollbar_size_horizontal: int |
| 160 | + scrollbar_visibility: ScrollbarVisibility |
161 | 161 |
|
162 | 162 | align_horizontal: AlignHorizontal |
163 | 163 | align_vertical: AlignVertical |
@@ -242,6 +242,7 @@ class StylesBase: |
242 | 242 | "scrollbar_background", |
243 | 243 | "scrollbar_background_hover", |
244 | 244 | "scrollbar_background_active", |
| 245 | + "scrollbar_visibility", |
245 | 246 | "link_color", |
246 | 247 | "link_background", |
247 | 248 | "link_color_hover", |
@@ -424,6 +425,10 @@ class StylesBase: |
424 | 425 | """Set the width of the vertical scrollbar (measured in cells).""" |
425 | 426 | scrollbar_size_horizontal = IntegerProperty(default=1, layout=True) |
426 | 427 | """Set the height of the horizontal scrollbar (measured in cells).""" |
| 428 | + scrollbar_visibility = StringEnumProperty( |
| 429 | + VALID_SCROLLBAR_VISIBILITY, "visible", layout=True |
| 430 | + ) |
| 431 | + """Sets the visibility of the scrollbar.""" |
427 | 432 |
|
428 | 433 | align_horizontal = StringEnumProperty( |
429 | 434 | VALID_ALIGN_HORIZONTAL, "left", layout=True, refresh_children=True |
@@ -1153,6 +1158,8 @@ def append_declaration(name: str, value: str) -> None: |
1153 | 1158 | append_declaration( |
1154 | 1159 | "scrollbar-size-vertical", str(self.scrollbar_size_vertical) |
1155 | 1160 | ) |
| 1161 | + if "scrollbar_visibility" in rules: |
| 1162 | + append_declaration("scrollbar-visibility", self.scrollbar_visibility) |
1156 | 1163 |
|
1157 | 1164 | if "box_sizing" in rules: |
1158 | 1165 | append_declaration("box-sizing", self.box_sizing) |
|
0 commit comments