Properly center the time

If the time widget is in the center, it wasn't properly centered.
For that to happen, center alignment and expand must be set.
This commit is contained in:
scorpion-26 2024-03-17 15:44:12 +01:00
parent c5f2dd80c7
commit 3a7fd719a2

View file

@ -22,7 +22,7 @@ namespace Bar
{
case Left: return Alignment::Left;
case Right: return Alignment::Right;
case Center: return Alignment::Fill;
case Center: return Alignment::Center;
}
return Alignment::Right;
}
@ -1076,7 +1076,7 @@ namespace Bar
void WidgetTime(Widget& parent, Side side)
{
auto time = Widget::Create<Text>();
Utils::SetTransform(*time, {-1, false, SideToAlignment(side)});
Utils::SetTransform(*time, {-1, side == Side::Center, SideToAlignment(side)});
time->SetAngle(Utils::GetAngle());
time->SetClass("widget");
time->AddClass("time-text");