discardDrafts method

void discardDrafts()

Revert all drafts back to the last saved state (discard changes).

Implementation

void discardDrafts() {
  draftFontSize.value = _savedFontSize;
  draftFontFamily.value = _savedFontFamily;
  draftAccentColor.value = _savedAccentColor;
  draftThemeMode.value = _savedThemeMode;
  draftPushNotifications.value = _savedPushNotifications;

  draftBorderRadius.value = _savedBorderRadius;
  draftLayoutDensity.value = _savedLayoutDensity;
  draftSidebarColor.value = _savedSidebarColor;
  draftSidebarWidth.value = _savedSidebarWidth;
  draftCardElevation.value = _savedCardElevation;
  draftAnimationsEnabled.value = _savedAnimationsEnabled;
  draftUiScale.value = _savedUiScale;
  draftGridSize.value = _savedGridSize;
  draftTableRowHeight.value = _savedTableRowHeight;
  draftInputStyle.value = _savedInputStyle;
  draftButtonStyle.value = _savedButtonStyle;
  draftNavigationStyle.value = _savedNavStyle;
  draftAppBarStyle.value = _savedAppBarStyle;
  draftContentWidth.value = _savedContentWidth;
  draftShadowsEnabled.value = _savedShadowsEnabled;
  draftUiStyle.value = _savedUiStyle;
  draftSidebarActiveColor.value = _savedSidebarActiveColor;
  draftSidebarHoverColor.value = _savedSidebarHoverColor;
  draftSidebarIconSize.value = _savedSidebarIconSize;
  draftSidebarTransparency.value = _savedSidebarTransparency;
  draftSidebarPosition.value = _savedSidebarPosition;

  draftCustomAccentColorHex.value = _savedCustomAccentColor;
  draftCustomSidebarColorHex.value = _savedCustomSidebarColor;
  draftCustomSidebarTextColorHex.value = _savedCustomSidebarTextColor;
  draftAppBarHeight.value = _savedAppBarHeight;
  draftAppBarShadow.value = _savedAppBarShadow;
  draftAppBarTitleAlignment.value = _savedAppBarTitleAlignment;
  draftDataGridTemplate.value = _savedDataGridTemplate;
  draftActionButtonShape.value = _savedActionButtonShape;
  draftActionButtonStyle.value = _savedActionButtonStyle;
  draftActionButtonColor.value = _savedActionButtonColor;
  draftPageTransition.value = _savedPageTransition;
  draftFontLetterSpacing.value = _savedFontLetterSpacing;
  draftFontLineHeight.value = _savedFontLineHeight;
  draftLoaderType.value = _savedLoaderType;
  draftLoaderColor.value = _savedLoaderColor;
  draftCustomLoaderColorHex.value = _savedCustomLoaderColor;
  draftToastStyle.value = _savedToastStyle;

  // Revert live preview to saved state
  fontSizeController.applyFontSizePreview(_savedFontSize);
  fontSizeController.applyFontFamilyPreview(_savedFontFamily);
  fontSizeController.applyAccentColorPreview(_savedAccentColor);
  fontSizeController.applyThemeModePreview(_savedThemeMode);
  fontSizeController.applyPushNotificationsPreview(_savedPushNotifications);
  fontSizeController.applyBorderRadiusPreview(_savedBorderRadius);
  fontSizeController.applyLayoutDensityPreview(_savedLayoutDensity);
  fontSizeController.applySidebarColorPreview(_savedSidebarColor);
  fontSizeController.applySidebarWidthPreview(_savedSidebarWidth);
  fontSizeController.applyCardElevationPreview(_savedCardElevation);
  fontSizeController.applyAnimationsEnabledPreview(_savedAnimationsEnabled);
  fontSizeController.applyUiScalePreview(_savedUiScale);
  fontSizeController.applyGridSizePreview(_savedGridSize);
  fontSizeController.applyTableRowHeightPreview(_savedTableRowHeight);
  fontSizeController.applyInputStylePreview(_savedInputStyle);
  fontSizeController.applyButtonStylePreview(_savedButtonStyle);
  fontSizeController.applyNavigationStylePreview(_savedNavStyle);
  fontSizeController.applyAppBarStylePreview(_savedAppBarStyle);
  fontSizeController.applyContentWidthPreview(_savedContentWidth);
  fontSizeController.applyShadowsEnabledPreview(_savedShadowsEnabled);
  fontSizeController.applyUiStylePreview(_savedUiStyle);
  fontSizeController.applySidebarActiveColorPreview(_savedSidebarActiveColor);
  fontSizeController.applySidebarHoverColorPreview(_savedSidebarHoverColor);
  fontSizeController.applySidebarIconSizePreview(_savedSidebarIconSize);
  fontSizeController.applySidebarTransparencyPreview(_savedSidebarTransparency);
  fontSizeController.applySidebarPositionPreview(_savedSidebarPosition);

  fontSizeController.applyCustomAccentColorPreview(_savedCustomAccentColor);
  fontSizeController.applyCustomSidebarColorPreview(_savedCustomSidebarColor);
  fontSizeController.applyCustomSidebarTextColorPreview(_savedCustomSidebarTextColor);
  fontSizeController.applyAppBarHeightPreview(_savedAppBarHeight);
  fontSizeController.applyAppBarShadowPreview(_savedAppBarShadow);
  fontSizeController.applyAppBarTitleAlignmentPreview(_savedAppBarTitleAlignment);
  fontSizeController.applyDataGridTemplatePreview(_savedDataGridTemplate);
  fontSizeController.applyActionButtonShapePreview(_savedActionButtonShape);
  fontSizeController.applyActionButtonStylePreview(_savedActionButtonStyle);
  fontSizeController.applyActionButtonColorPreview(_savedActionButtonColor);
  fontSizeController.applyPageTransitionPreview(_savedPageTransition);
  fontSizeController.applyFontLetterSpacingPreview(_savedFontLetterSpacing);
  fontSizeController.applyFontLineHeightPreview(_savedFontLineHeight);

  _applyThemeMode(_savedThemeMode);

  hasUnsavedChanges.value = false;
}