1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Refactoring of button class to prepare for configurable button

This commit is contained in:
Ivan Savenko
2024-02-27 22:19:09 +02:00
parent 850af00303
commit 07d201502e
22 changed files with 223 additions and 207 deletions

View File

@@ -206,10 +206,10 @@ CSlider::CSlider(Point position, int totalw, const std::function<void(int)> & Mo
right = std::make_shared<CButton>(Point(), AnimationPath::builtin(getOrientation() == Orientation::HORIZONTAL ? "SCNRBRT.DEF" : "SCNRBDN.DEF"), CButton::tooltip());
slider = std::make_shared<CButton>(Point(), AnimationPath::builtin("SCNRBSL.DEF"), CButton::tooltip());
}
slider->actOnDown = true;
slider->soundDisabled = true;
left->soundDisabled = true;
right->soundDisabled = true;
slider->setActOnDown(true);
slider->setSoundDisabled(true);
left->setSoundDisabled(true);
right->setSoundDisabled(true);
if (getOrientation() == Orientation::HORIZONTAL)
right->moveBy(Point(totalw - right->pos.w, 0));