@@ -44,10 +44,10 @@ namespace cycfi::elements
44
44
double _value;
45
45
};
46
46
47
- class basic_progress_bar_base : public status_bar_base
47
+ class basic_status_bar_base : public status_bar_base
48
48
{
49
49
public:
50
- basic_progress_bar_base (double init_value)
50
+ basic_status_bar_base (double init_value)
51
51
: status_bar_base(init_value)
52
52
{}
53
53
};
@@ -61,35 +61,25 @@ namespace cycfi::elements
61
61
template <
62
62
concepts::Element Background
63
63
, concepts::Element Foreground
64
- , concepts::StatusBar Base = basic_progress_bar_base
65
- >
66
- class basic_progress_bar : public Base
64
+ , concepts::StatusBar Base = basic_status_bar_base>
65
+ class basic_status_bar : public Base
67
66
{
68
67
public:
69
68
70
69
using background_type = std::decay_t <Background>;
71
70
using foreground_type = std::decay_t <Foreground>;
72
71
73
- basic_progress_bar (
72
+ template <typename ... Args>
73
+ basic_status_bar (
74
74
Background&& bg
75
75
, Foreground&& fg
76
- , double init_value
76
+ , Args&& ...args
77
77
)
78
- : Base(init_value )
78
+ : Base(args... )
79
79
, _background(std::forward<Foreground>(bg))
80
80
, _foreground(std::forward<Background>(fg))
81
81
{}
82
82
83
- basic_progress_bar (
84
- Background const & bg
85
- , Foreground const & fg
86
- , double init_value
87
- )
88
- : Base(init_value)
89
- , _foreground(fg)
90
- , _background(bg)
91
- {}
92
-
93
83
element const & background () const override { return _background; }
94
84
element& background () override { return _background; }
95
85
element const & foreground () const override { return _foreground; }
@@ -102,7 +92,7 @@ namespace cycfi::elements
102
92
};
103
93
104
94
template <concepts::Element Background, concepts::Element Foreground>
105
- basic_progress_bar <Background, Foreground, basic_progress_bar_base >
95
+ basic_status_bar <Background, Foreground, basic_status_bar_base >
106
96
progress_bar (Background&& bg, Foreground&& fg, double init_value = 0.0 )
107
97
{
108
98
return {
@@ -150,59 +140,8 @@ namespace cycfi::elements
150
140
{}
151
141
};
152
142
153
- namespace concepts
154
- {
155
- template <typename T>
156
- concept BusyBar = std::is_base_of_v<busy_bar_base, std::decay_t <T>>;
157
- }
158
-
159
- template <
160
- concepts::Element Background
161
- , concepts::Element Foreground
162
- , concepts::BusyBar Base = basic_busy_bar_base
163
- >
164
- class basic_busy_bar : public Base
165
- {
166
- public:
167
-
168
- using background_type = std::decay_t <Background>;
169
- using foreground_type = std::decay_t <Foreground>;
170
-
171
- basic_busy_bar (
172
- Background&& bg
173
- , Foreground&& fg
174
- , double init_value
175
- , double start_value
176
- )
177
- : Base(init_value, start_value)
178
- , _background(std::forward<Foreground>(bg))
179
- , _foreground(std::forward<Background>(fg))
180
- {}
181
-
182
- basic_busy_bar (
183
- Background const & bg
184
- , Foreground const & fg
185
- , double init_value
186
- , double start_value
187
- )
188
- : Base(init_value, start_value)
189
- , _foreground(fg)
190
- , _background(bg)
191
- {}
192
-
193
- element const & background () const override { return _background; }
194
- element& background () override { return _background; }
195
- element const & foreground () const override { return _foreground; }
196
- element& foreground () override { return _foreground; }
197
-
198
- private:
199
-
200
- background_type _background;
201
- foreground_type _foreground;
202
- };
203
-
204
143
template <concepts::Element Background, concepts::Element Foreground>
205
- basic_busy_bar <Background, Foreground, basic_busy_bar_base>
144
+ inline basic_status_bar <Background, Foreground, basic_busy_bar_base>
206
145
busy_bar (
207
146
Background&& bg
208
147
, Foreground&& fg
0 commit comments