private void PositionFloatingForms() { this.appWorkspace.ResetFloatingForms(); try { SnapManager.Load(Settings.CurrentUser); } catch { this.appWorkspace.ResetFloatingForms(); } foreach (FloatingToolForm ftf in floaters) { this.AddOwnedForm(ftf); } if (Settings.CurrentUser.GetBoolean(PdnSettings.ToolsFormVisible, true)) { this.appWorkspace.Widgets.ToolsForm.Show(); } if (Settings.CurrentUser.GetBoolean(PdnSettings.ColorsFormVisible, true)) { this.appWorkspace.Widgets.ColorsForm.Show(); } if (Settings.CurrentUser.GetBoolean(PdnSettings.HistoryFormVisible, true)) { this.appWorkspace.Widgets.HistoryForm.Show(); } if (Settings.CurrentUser.GetBoolean(PdnSettings.LayersFormVisible, true)) { this.appWorkspace.Widgets.LayerForm.Show(); } this.floaterOpacityTimer.Enabled = true; }
private void PositionFloatingForms() { this.appWorkspace.ResetFloatingForms(); try { SnapManager.Load(Settings.CurrentUser); } catch { this.appWorkspace.ResetFloatingForms(); } foreach (FloatingToolForm ftf in floaters) { this.AddOwnedForm(ftf); } if (Settings.CurrentUser.GetBoolean(SettingNames.ToolsFormVisible, true)) { this.appWorkspace.Widgets.ToolsForm.Show(); } if (Settings.CurrentUser.GetBoolean(SettingNames.ColorsFormVisible, true)) { this.appWorkspace.Widgets.ColorsForm.Show(); } if (Settings.CurrentUser.GetBoolean(SettingNames.HistoryFormVisible, true)) { this.appWorkspace.Widgets.HistoryForm.Show(); } if (Settings.CurrentUser.GetBoolean(SettingNames.LayersFormVisible, true)) { this.appWorkspace.Widgets.LayerForm.Show(); } // If the floating form is off screen somehow, reset it // We've been getting a lot of reports where people say their Colors window has disappeared Screen[] allScreens = Screen.AllScreens; foreach (FloatingToolForm ftf in this.floaters) { if (!ftf.Visible) { continue; } bool reset = false; try { bool foundAScreen = false; foreach (Screen screen in allScreens) { Rectangle intersect = Rectangle.Intersect(screen.Bounds, ftf.Bounds); if (intersect.Width > 0 && intersect.Height > 0) { foundAScreen = true; break; } } if (!foundAScreen) { reset = true; } } catch (Exception) { reset = true; } if (reset) { this.appWorkspace.ResetFloatingForm(ftf); } } this.floaterOpacityTimer.Enabled = true; }