예제 #1
0
        private void SwitchSettings(NSView newSettings)
        {
            UnfocusElement(); // update bindings

            bool firstTime = __CurrentSettingsView == null;

            if (__CurrentSettingsView != null)
            {
                __CurrentSettingsView.RemoveFromSuperview();
            }

            CGRect newFrame = new CGRect(
                newSettings.Frame.X,
                SettingsView.Frame.Height - newSettings.Frame.Height,
                newSettings.Frame.Width,
                newSettings.Frame.Height);

            newSettings.Frame = newFrame;

            SettingsView.AddSubview(newSettings);

            __CurrentSettingsView = newSettings;

            // Set new window height
            var newHeight = newSettings.Frame.Height + (Window.Frame.Height - SettingsView.Frame.Bottom);

            CGRect newRect = UIUtils.UpdateHeight(Window.Frame, (float)newHeight);

            Window.SetFrame(newRect, true, !firstTime);
        }