Skip to content

Commit 6773831

Browse files
committed
minor fixes to slider/scrollbar
1 parent ecf347c commit 6773831

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

pygame_gui/elements/ui_horizontal_scroll_bar.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def __init__(self,
8181

8282
self.drawable_shape = None
8383
self.shape = 'rectangle'
84+
self.left_arrow_text = '◀'
85+
self.right_arrow_text = '▶'
8486

8587
self.background_rect = None # type: Union[None, pygame.Rect]
8688

@@ -179,7 +181,7 @@ def rebuild(self):
179181
self.left_button = UIButton(pygame.Rect((0, 0),
180182
(self.arrow_button_width,
181183
self.background_rect.height)),
182-
'◀', self.ui_manager,
184+
self.left_arrow_text, self.ui_manager,
183185
container=self.button_container,
184186
starting_height=1,
185187
parent_element=self,
@@ -195,7 +197,7 @@ def rebuild(self):
195197
self.right_button = UIButton(pygame.Rect((-self.arrow_button_width, 0),
196198
(self.arrow_button_width,
197199
self.background_rect.height)),
198-
'▶', self.ui_manager,
200+
self.right_arrow_text, self.ui_manager,
199201
container=self.button_container,
200202
starting_height=1,
201203
parent_element=self,

pygame_gui/elements/ui_horizontal_slider.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def __init__(self,
6565
self.left_limit_position = 0.0
6666
self.starting_grab_x_difference = 0
6767

68+
self.left_arrow_text = '◀'
69+
self.right_arrow_text = '▶'
70+
6871
if (isinstance(start_value, int) and
6972
isinstance(value_range[0], int) and
7073
isinstance(value_range[1], int)):
@@ -181,7 +184,7 @@ def rebuild(self):
181184
self.left_button = UIButton(pygame.Rect((0, 0),
182185
(self.arrow_button_width,
183186
self.background_rect.height)),
184-
'◀', self.ui_manager,
187+
self.left_arrow_text, self.ui_manager,
185188
container=self.button_container,
186189
starting_height=1,
187190
parent_element=self,
@@ -197,7 +200,7 @@ def rebuild(self):
197200
self.right_button = UIButton(pygame.Rect((-self.arrow_button_width, 0),
198201
(self.arrow_button_width,
199202
self.background_rect.height)),
200-
'▶', self.ui_manager,
203+
self.right_arrow_text, self.ui_manager,
201204
container=self.button_container,
202205
starting_height=1,
203206
parent_element=self,

pygame_gui/elements/ui_vertical_scroll_bar.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def __init__(self,
9191
self.bottom_button = None
9292
self.sliding_button = None
9393
self.enable_arrow_buttons = True
94+
self.top_arrow_text = '▲'
95+
self.bottom_arrow_text = '▼'
9496

9597
self.rebuild_from_changed_theme_data()
9698

@@ -175,7 +177,7 @@ def rebuild(self):
175177
self.top_button = UIButton(pygame.Rect((0, 0),
176178
(self.background_rect.width,
177179
self.arrow_button_height)),
178-
'▲', self.ui_manager,
180+
self.top_arrow_text, self.ui_manager,
179181
container=self.button_container,
180182
starting_height=1,
181183
parent_element=self,
@@ -191,7 +193,7 @@ def rebuild(self):
191193
self.bottom_button = UIButton(pygame.Rect((0, -self.arrow_button_height),
192194
(self.background_rect.width,
193195
self.arrow_button_height)),
194-
'▼', self.ui_manager,
196+
self.bottom_arrow_text, self.ui_manager,
195197
container=self.button_container,
196198
starting_height=1,
197199
parent_element=self,

0 commit comments

Comments
 (0)