mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Fix scroll bar SetMin/SetMax not working correctly
This commit is contained in:
@@ -213,6 +213,30 @@ namespace PortabilityLayer
|
||||
DrawControl(m_window->GetDrawSurface());
|
||||
}
|
||||
|
||||
void ScrollBarWidget::SetMin(int32_t v)
|
||||
{
|
||||
m_min = v;
|
||||
if (m_state < m_min)
|
||||
SetState(m_min);
|
||||
else
|
||||
{
|
||||
RefreshGrip();
|
||||
DrawControl(m_window->GetDrawSurface());
|
||||
}
|
||||
}
|
||||
|
||||
void ScrollBarWidget::SetMax(int32_t v)
|
||||
{
|
||||
m_max = v;
|
||||
if (m_state > m_max)
|
||||
SetState(m_max);
|
||||
else
|
||||
{
|
||||
RefreshGrip();
|
||||
DrawControl(m_window->GetDrawSurface());
|
||||
}
|
||||
}
|
||||
|
||||
int16_t ScrollBarWidget::Capture(const Point &pos, WidgetUpdateCallback_t callback)
|
||||
{
|
||||
int part = ResolvePart(pos);
|
||||
|
@@ -21,6 +21,9 @@ namespace PortabilityLayer
|
||||
void SetState(int16_t state) override;
|
||||
void OnStateChanged() override;
|
||||
|
||||
void SetMin(int32_t v) override;
|
||||
void SetMax(int32_t v) override;
|
||||
|
||||
int16_t Capture(const Point &pos, WidgetUpdateCallback_t callback) override;
|
||||
|
||||
int ResolvePart(const Point &point) const override;
|
||||
|
Reference in New Issue
Block a user