public void ApplyChanges() { Settings.Default.Theme = Theme; Settings.Default.MainWindowOpacity = (double)Opacity / 100.0f; Settings.Default.FontFamily = FontFamily; Settings.Default.FontStretch = FontStretch.ToString(); Settings.Default.FontWeight = FontWeight.ToString(); Settings.Default.ScratchpadNumberOfLines = ScratchpadNumberOfLines; Settings.Default.ToastNotificationVerticalFillPercentage = ToastNotificationVerticalFillPercentage; Settings.Default.ToastNotificationHorizontalFillPercentage = ToastNotificationHorizontalFillPercentage; Settings.Default.ToastNotificationSecondsPerCharacter = ToastNotificationSecondsPerCharacter; Settings.Default.CursorWidthInPixels = CursorWidthInPixels; Settings.Default.CursorHeightInPixels = CursorHeightInPixels; Settings.Default.GazeIndicatorStyle = (GazeIndicatorStyles)Enum.Parse(typeof(GazeIndicatorStyles), GazeIndicatorStyle); Settings.Default.GazeIndicatorSize = GazeIndicatorSize; Settings.Default.MagnifierCenterOnScreen = MagnifierCenterOnScreen; Settings.Default.MagnifySourcePercentageOfScreen = MagnifySourcePercentageOfScreen; Settings.Default.MagnifyDestinationPercentageOfScreen = MagnifyDestinationPercentageOfScreen; Settings.Default.ConversationOnlyMode = ConversationOnlyMode; Settings.Default.ConversationConfirmEnable = ConversationConfirmEnable; Settings.Default.ConversationConfirmOnlyMode = ConversationConfirmOnlyMode; Settings.Default.StartupKeyboard = StartupKeyboard; Settings.Default.MainWindowMinimisedPosition = MinimisedPosition; Settings.Default.KeyCase = KeyCase; Settings.Default.MainWindowCollapsedDockThicknessAsPercentageOfFullDockThickness = MainWindowCollapsedDockThicknessAsPercentageOfFullDockThickness; Settings.Default.ConversationBorderThickness = ConversationBorderThickness; Settings.Default.DynamicKeyboardsLocation = DynamicKeyboardsLocation; Settings.Default.StartupKeyboardFile = StartupKeyboardFile; // We don't apply changes to window/size position if Optikey's state has changed to one in which re-positioning isn't supported bool allowReposition = windowManipulationService.GetPersistedState() && Settings.Default.MainWindowState != WindowStates.Maximised && Settings.Default.MainWindowState != WindowStates.Minimised && Settings.Default.MainWindowState != WindowStates.Hidden && Settings.Default.MainWindowDockSize != DockSizes.Collapsed; if (allowReposition) { // Changes to window state, these methods will save the new values also if (Settings.Default.MainWindowState != MainWindowState || Settings.Default.MainWindowDockPosition != DockPosition || !Settings.Default.MainWindowFullDockThicknessAsPercentageOfScreen.IsCloseTo( MainWindowFullDockThicknessAsPercentageOfScreen) || !Settings.Default.MainWindowFloatingSizeAndPosition.IsCloseTo(FloatingSizeAndPosition)) { Settings.Default.MainWindowFullDockThicknessAsPercentageOfScreen = MainWindowFullDockThicknessAsPercentageOfScreen; Settings.Default.MainWindowFloatingSizeAndPosition = FloatingSizeAndPosition; // this also saves the changes windowManipulationService.ChangeState(MainWindowState, DockPosition); } } windowManipulationService.SetOpacity(Settings.Default.MainWindowOpacity); Settings.Default.EnableResizeWithMouse = EnableResizeWithMouse; windowManipulationService.SetResizeState(); }