22
22
"""
23
23
24
24
try :
25
- from typing import Tuple , Union
25
+ from typing import Tuple
26
26
except ImportError :
27
27
pass # Not needed for execution
28
28
from . import ProgressBarBase
29
+ from .horizontalprogressbar import HorizontalProgressBar
29
30
30
31
31
32
# pylint: disable=too-few-public-methods
@@ -45,7 +46,7 @@ class VerticalFillDirection:
45
46
46
47
47
48
# pylint: disable=too-many-arguments, too-few-public-methods, too-many-instance-attributes
48
- class VerticalProgressBar (ProgressBarBase ):
49
+ class VerticalProgressBar (HorizontalProgressBar ):
49
50
"""A dynamic progress bar widget.
50
51
51
52
The anchor position is the position where the control would start if it
@@ -104,40 +105,6 @@ class VerticalProgressBar(ProgressBarBase):
104
105
105
106
"""
106
107
107
- # pylint: disable=too-many-arguments
108
- def __init__ (
109
- self ,
110
- position : Tuple [int , int ],
111
- size : Tuple [int , int ],
112
- min_value : Union [int , float ] = 0 ,
113
- max_value : Union [int , float ] = 100 ,
114
- value : Union [int , float ] = 0 ,
115
- bar_color : Union [int , Tuple [int , int , int ]] = 0x00FF00 ,
116
- outline_color : Union [int , Tuple [int , int , int ]] = 0xFFFFFF ,
117
- fill_color : Union [int , Tuple [int , int , int ]] = 0x444444 ,
118
- border_thickness : int = 1 ,
119
- margin_size : int = 1 ,
120
- direction : VerticalFillDirection = VerticalFillDirection .DEFAULT ,
121
- ) -> None :
122
-
123
- # Store the "direction" value locally. While they may appear to
124
- # "relate" with the values of the horizontal bar, their handling
125
- # is too different to be stored in the same underlying property,
126
- # which could lead to confusion
127
- self ._direction = direction
128
-
129
- super ().__init__ (
130
- position ,
131
- size ,
132
- value ,
133
- bar_color ,
134
- outline_color ,
135
- fill_color ,
136
- border_thickness ,
137
- margin_size ,
138
- (min_value , max_value ),
139
- )
140
-
141
108
def _get_sizes_min_max (self ) -> Tuple [int , int ]:
142
109
return 0 , self .fill_height ()
143
110
@@ -146,6 +113,14 @@ def _get_value_sizes(self, _old_ratio: float, _new_ratio: float) -> Tuple[int, i
146
113
_new_ratio * self .fill_height ()
147
114
)
148
115
116
+ # pylint: disable=protected-access
117
+ def _get_horizontal_fill (
118
+ self , _start : int , _end : int , _incr : int
119
+ ) -> Tuple [int , int , int ]:
120
+ return ProgressBarBase ._get_horizontal_fill (self , _start , _end , _incr )
121
+
122
+ # pylint: enable=protected-access
123
+
149
124
def _get_vertical_fill (
150
125
self , _start : int , _end : int , _incr : int
151
126
) -> Tuple [int , int , int ]:
0 commit comments