[Monodevelop-patches-list] r1436 - in trunk/MonoDevelop/src/Main/Base: . Commands Gui/Workbench
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Apr 11 04:03:13 EDT 2004
Author: tberman
Date: 2004-04-11 04:03:12 -0400 (Sun, 11 Apr 2004)
New Revision: 1436
Modified:
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/WorkbenchMemento.cs
Log:
properly save/restore maximized state.
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-11 03:10:44 UTC (rev 1435)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-11 08:03:12 UTC (rev 1436)
@@ -1,3 +1,11 @@
+2004-04-11 Todd Berman <tberman at sevenl.net>
+
+ * Commands/AutostartCommands.cs: reorganize the SetMemento so it works
+ better.
+ * Gui/Workbench/WorkbenchMemento.cs: readd windowstate.
+ * Gui/Workbench/DefaultWorkbench.cs: now we restore from maximized
+ properly.
+
2004-04-10 Todd Berman <tberman at sevenl.net>
* Internal/Project/Project/AbstractProject.cs: fix potentiall nullref
Modified: trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-04-11 03:10:44 UTC (rev 1435)
+++ trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-04-11 08:03:12 UTC (rev 1436)
@@ -1,7 +1,7 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <owner name="Mike Kr�¼ger" email="mike at icsharpcode.net"/>
// <version value="$version"/>
// </file>
@@ -41,10 +41,10 @@
w.InitializeWorkspace();
PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
- w.SetMemento((IXmlConvertable)propertyService.GetProperty(workbenchMemento, new WorkbenchMemento()));
w.UpdateViews(null, null);
WorkbenchSingleton.CreateWorkspace();
((Gtk.Window)w).Visible = false;
+ w.SetMemento ((IXmlConvertable)propertyService.GetProperty (workbenchMemento, new WorkbenchMemento ()));
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-11 03:10:44 UTC (rev 1435)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-11 08:03:12 UTC (rev 1436)
@@ -396,14 +396,14 @@
public IXmlConvertable CreateMemento()
{
WorkbenchMemento memento = new WorkbenchMemento();
- int x, y, width, height;
- GdkWindow.GetSize (out width, out height);
- GdkWindow.GetRootOrigin (out x, out y);
- if (GdkWindow.State != Gdk.WindowState.Fullscreen && GdkWindow.State != Gdk.WindowState.Maximized) {
+ int x, y, width, height, depth;
+ GdkWindow.GetGeometry (out x, out y, out width, out height, out depth);
+ if (GdkWindow.State == 0) {
memento.Bounds = new Rectangle (x, y, width, height);
} else {
memento.Bounds = normalBounds;
}
+ memento.WindowState = GdkWindow.State;
memento.FullScreen = fullscreen;
return memento;
@@ -417,6 +417,11 @@
normalBounds = memento.Bounds;
Move (normalBounds.X, normalBounds.Y);
Resize (normalBounds.Width, normalBounds.Height);
+ if (memento.WindowState == Gdk.WindowState.Maximized) {
+ Maximize ();
+ } else if (memento.WindowState == Gdk.WindowState.Iconified) {
+ Iconify ();
+ }
FullScreen = memento.FullScreen;
}
Decorated = true;
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/WorkbenchMemento.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/WorkbenchMemento.cs 2004-04-11 03:10:44 UTC (rev 1435)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/WorkbenchMemento.cs 2004-04-11 08:03:12 UTC (rev 1436)
@@ -19,7 +19,7 @@
/// </summary>
public class WorkbenchMemento : IXmlConvertable
{
- //FormWindowState windowstate = FormWindowState.Normal;
+ Gdk.WindowState windowstate = 0;
//FormWindowState defaultwindowstate = FormWindowState.Normal;
Rectangle bounds = new Rectangle(0, 0, 640, 480);
bool fullscreen = false;
@@ -33,14 +33,14 @@
}
}*/
- /*public FormWindowState WindowState {
+ public Gdk.WindowState WindowState {
get {
return windowstate;
}
set {
windowstate = value;
}
- }*/
+ }
public Rectangle Bounds {
get {
@@ -76,9 +76,10 @@
bounds = new Rectangle(Int32.Parse(boundstr[0]), Int32.Parse(boundstr[1]),
Int32.Parse(boundstr[2]), Int32.Parse(boundstr[3]));
+ if (element.Attributes["formwindowstate"] != null) {
+ windowstate = (Gdk.WindowState)Enum.Parse(typeof(Gdk.WindowState), element.Attributes["formwindowstate"].InnerText);
+ }
- //windowstate = (FormWindowState)Enum.Parse(typeof(FormWindowState), element.Attributes["formwindowstate"].InnerText);
-
/*if (element.Attributes["defaultformwindowstate"] != null) {
defaultwindowstate = (FormWindowState)Enum.Parse(typeof(FormWindowState), element.Attributes["defaultformwindowstate"].InnerText);
}*/
@@ -100,11 +101,11 @@
attr.InnerText = bounds.X + "," + bounds.Y + "," + bounds.Width + "," + bounds.Height;
element.Attributes.Append(attr);
- /*attr = doc.CreateAttribute("formwindowstate");
+ attr = doc.CreateAttribute ("formwindowstate");
attr.InnerText = windowstate.ToString();
element.Attributes.Append(attr);
- attr = doc.CreateAttribute("defaultformwindowstate");
+ /*attr = doc.CreateAttribute("defaultformwindowstate");
attr.InnerText = defaultwindowstate.ToString();
element.Attributes.Append(attr);*/
More information about the Monodevelop-patches-list
mailing list