@@ -120,40 +120,40 @@ void GScrollBar::set_value(int value)
120
120
121
121
Rect GScrollBar::up_button_rect () const
122
122
{
123
- return { 0 , 0 , button_size (), button_size () };
123
+ return { 0 , 0 , button_width (), button_height () };
124
124
}
125
125
126
126
Rect GScrollBar::down_button_rect () const
127
127
{
128
128
if (orientation () == Orientation::Vertical)
129
- return { 0 , height () - button_size (), button_size (), button_size () };
129
+ return { 0 , height () - button_height (), button_width (), button_height () };
130
130
else
131
- return { width () - button_size (), 0 , button_size (), button_size () };
131
+ return { width () - button_width (), 0 , button_width (), button_height () };
132
132
}
133
133
134
134
Rect GScrollBar::upper_gutter_rect () const
135
135
{
136
136
if (orientation () == Orientation::Vertical)
137
- return { 0 , button_size (), button_size (), scrubber_rect ().top () - button_size () };
137
+ return { 0 , button_height (), button_width (), scrubber_rect ().top () - button_height () };
138
138
else
139
- return { button_size (), 0 , scrubber_rect ().x () - button_size (), button_size () };
139
+ return { button_width (), 0 , scrubber_rect ().x () - button_width (), button_height () };
140
140
}
141
141
142
142
Rect GScrollBar::lower_gutter_rect () const
143
143
{
144
144
auto scrubber_rect = this ->scrubber_rect ();
145
145
if (orientation () == Orientation::Vertical)
146
- return { 0 , scrubber_rect.bottom () + 1 , button_size (), height () - button_size () - scrubber_rect.bottom () - 1 };
146
+ return { 0 , scrubber_rect.bottom () + 1 , button_width (), height () - button_height () - scrubber_rect.bottom () - 1 };
147
147
else
148
- return { scrubber_rect.right () + 1 , 0 , width () - button_size () - scrubber_rect.right () - 1 , button_size () };
148
+ return { scrubber_rect.right () + 1 , 0 , width () - button_width () - scrubber_rect.right () - 1 , button_width () };
149
149
}
150
150
151
151
int GScrollBar::scrubbable_range_in_pixels () const
152
152
{
153
153
if (orientation () == Orientation::Vertical)
154
- return height () - button_size () * 2 - scrubber_size ();
154
+ return height () - button_height () * 2 - scrubber_size ();
155
155
else
156
- return width () - button_size () * 2 - scrubber_size ();
156
+ return width () - button_width () * 2 - scrubber_size ();
157
157
}
158
158
159
159
bool GScrollBar::has_scrubber () const
@@ -185,9 +185,9 @@ Rect GScrollBar::scrubber_rect() const
185
185
}
186
186
187
187
if (orientation () == Orientation::Vertical)
188
- return { 0 , (int )x_or_y, button_size (), scrubber_size () };
188
+ return { 0 , (int )x_or_y, button_width (), scrubber_size () };
189
189
else
190
- return { (int )x_or_y, 0 , scrubber_size (), button_size () };
190
+ return { (int )x_or_y, 0 , scrubber_size (), button_height () };
191
191
}
192
192
193
193
void GScrollBar::paint_event (GPaintEvent& event)
@@ -241,8 +241,8 @@ void GScrollBar::mousedown_event(GMouseEvent& event)
241
241
float range_size = m_max - m_min;
242
242
float available = scrubbable_range_in_pixels ();
243
243
244
- float x = ::max (0 , event.position ().x () - button_size () - button_size () / 2 );
245
- float y = ::max (0 , event.position ().y () - button_size () - button_size () / 2 );
244
+ float x = ::max (0 , event.position ().x () - button_width () - button_width () / 2 );
245
+ float y = ::max (0 , event.position ().y () - button_height () - button_height () / 2 );
246
246
247
247
float rel_x = x / available;
248
248
float rel_y = y / available;
0 commit comments