Fix vote buttons being wrong on own saves

The buttons are disabled on such saves, and the disabled background colours weren't set.
This commit is contained in:
Tamás Bálint Misius 2023-01-02 16:33:15 +01:00
parent e3355c988d
commit 6e140b580c
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -806,11 +806,13 @@ void GameView::NotifySaveChanged(GameModel * sender)
{
upVoteButton->Appearance.BackgroundHover = (ui::Colour(20, 128, 30, 255));
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 108, 10, 255));
upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 108, 10, 255));
}
else
{
upVoteButton->Appearance.BackgroundHover = (ui::Colour(20, 20, 20));
upVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0));
upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
}
downVoteButton->Enabled = upVoteButton->Enabled;
@ -818,11 +820,13 @@ void GameView::NotifySaveChanged(GameModel * sender)
{
downVoteButton->Appearance.BackgroundHover = (ui::Colour(128, 20, 30, 255));
downVoteButton->Appearance.BackgroundInactive = (ui::Colour(108, 0, 10, 255));
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(108, 0, 10, 255));
}
else
{
downVoteButton->Appearance.BackgroundHover = (ui::Colour(20, 20, 20));
downVoteButton->Appearance.BackgroundInactive = (ui::Colour(0, 0, 0));
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
}
if (sender->GetUser().UserID)