Skip to content

Commit

Permalink
fix: unintentional change of background color
Browse files Browse the repository at this point in the history
- fixed regression
- initialization of the black scene caused unintentional
  switch to dark background during startup
  • Loading branch information
letsfindaway committed Sep 5, 2024
1 parent 7c8bba5 commit e1a7403
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/domain/UBGraphicsScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,12 @@ void UBGraphicsScene::setSceneBackground(bool pIsDark, const UBBackgroundRuling
updatePenCircleColor();
recolorAllItems();

UBSettings::settings()->setDarkBackground(mDarkBackground);
needRepaint = true;
}

if (mBackground != background)
{
mBackground = background;
UBSettings::settings()->setPageBackgroundUuid(mBackground ? mBackground->uuid() : QUuid{});
needRepaint = true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/UBBackgroundPalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void UBBackgroundPalette::defaultBackgroundGridSize()
void UBBackgroundPalette::toggleBackgroundColor(bool checked)
{
mIsDark = checked;
UBApplication::boardController->activeScene()->setSceneBackground(mIsDark, mBackground);
UBApplication::boardController->setBackground(mIsDark, mBackground);
backgroundChanged();
}

Expand All @@ -249,7 +249,7 @@ void UBBackgroundPalette::changeBackground(bool checked)
{
const auto uuid = action->property("uuid").toUuid();
mBackground = UBApplication::boardController->backgroundManager()->background(uuid);
UBApplication::boardController->activeScene()->setSceneBackground(mIsDark, mBackground);
UBApplication::boardController->setBackground(mIsDark, mBackground);
}
}
}
Expand Down

0 comments on commit e1a7403

Please sign in to comment.