protected bool ShowModalWindow(IPanel panel, IPanel parent) { var dialog = panel as Gtk.Dialog; if (dialog != null) { dialog.TransientFor = ((Bin)parent).Toplevel as Window; dialog.Response += HandleModalWindowResponse; dialog.Center(); panel.OnLoad(); } else { ExternalWindow modalWindow = new ExternalWindow(); modalWindow.Resizable = false; modalWindow.DefaultWidth = (panel as Gtk.Bin).WidthRequest; modalWindow.DefaultHeight = (panel as Gtk.Bin).HeightRequest; modalWindow.Title = panel.Title; modalWindow.Modal = true; modalWindow.TransientFor = ((Bin)parent).Toplevel as Window; modalWindow.DeleteEvent += HandleModalWindowDeleteEvent; Widget widget = panel as Gtk.Widget; modalWindow.Add(widget); modalWindow.SetPosition(WindowPosition.CenterOnParent); modalWindow.ShowAll(); panel.OnLoad(); } return(true); }
/// <summary> /// Sets the panel. When panel is null, welcome panel is shown. Depending on current panel and new panel stacking may happen /// </summary> /// <param name="panel">Panel.</param> public bool SetPanel(IPanel panel) { if (panel == null) { return(App.Current.StateController.MoveToHome().Result); } if (currentPanel != null) { ((IPanel)currentPanel).OnUnload(); centralbox.Remove(currentPanel); } Title = panel.Title; panel.OnLoad(); currentPanel = (Widget)panel; centralbox.PackStart(currentPanel, true, true, 0); currentPanel.Show(); // FIXME: Remove this once everything uses the ITool implementation correctly if (panel is WelcomePanel) { ResetGUI(); } return(true); }
/// <summary> /// Sets the panel. When panel is null, welcome panel is shown. Depending on current panel and new panel stacking may happen /// </summary> /// <param name="panel">Panel.</param> public bool SetPanel (IPanel panel) { if (panel == null) { return App.Current.StateController.MoveToHome ().Result; } if (currentPanel != null) { ((IPanel)currentPanel).OnUnload (); centralbox.Remove (currentPanel); } Title = panel.Title; panel.OnLoad (); currentPanel = (Widget)panel; centralbox.PackStart (currentPanel, true, true, 0); currentPanel.Show (); // FIXME: Remove this once everything uses the ITool implementation correctly if (panel is WelcomePanel) { ResetGUI (); } return true; }