public void Resize(int w, int h) { width = Math.Max(1, w); height = Math.Max(1, h); int toolBarHeight = DpiScaling.ScaleForMainWindow(40); int projectExplorerWidth = DpiScaling.ScaleForMainWindow(300); int sequencerHeight = pianoRoll.IsMaximized ? 1 : DpiScaling.ScaleForMainWindow(sequencer.ComputeDesiredSizeY()); toolbar.Move(0, 0, width, toolBarHeight); projectExplorer.Move(width - projectExplorerWidth, toolBarHeight, projectExplorerWidth, height - toolBarHeight); sequencer.Move(0, toolBarHeight, width - projectExplorerWidth, sequencerHeight); pianoRoll.Move(0, toolBarHeight + sequencerHeight, width - projectExplorerWidth, height - toolBarHeight - sequencerHeight); }
private void UpdateLayout(bool init) { if (init) { buttonYes.Width = DpiScaling.ScaleForDialog(buttonYes.Width); buttonYes.Height = DpiScaling.ScaleForDialog(buttonYes.Height); buttonNo.Width = DpiScaling.ScaleForDialog(buttonNo.Width); buttonNo.Height = DpiScaling.ScaleForDialog(buttonNo.Height); } Height = propertyPage.Height + buttonNo.Height + 7; buttonYes.Top = propertyPage.Bottom; buttonNo.Top = propertyPage.Bottom; if (buttonNo.Visible) { buttonYes.Left = propertyPage.Right - buttonYes.Width * 2 - 10; buttonNo.Left = propertyPage.Right - buttonNo.Width - 5; } else { buttonYes.Left = propertyPage.Right - buttonNo.Width - 5; } if (propertyPage.HasAdvancedProperties) { if (init) { buttonAdvanced.Width = DpiScaling.ScaleForMainWindow(buttonAdvanced.Width); buttonAdvanced.Height = DpiScaling.ScaleForMainWindow(buttonAdvanced.Height); } buttonAdvanced.Left = 5; buttonAdvanced.Top = propertyPage.Bottom + 0; buttonAdvanced.Visible = true; } }