[Tkabber-dev] r1757 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Mar 28 21:49:22 MSK 2009


Author: sergei
Date: 2009-03-28 21:49:22 +0300 (Sat, 28 Mar 2009)
New Revision: 1757

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/geometry.tcl
Log:
	* plugins/general/geometry.tcl: Store main window state and geometry
	  separately for tabbed and non-tabbed modes.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-28 18:06:43 UTC (rev 1756)
+++ trunk/tkabber/ChangeLog	2009-03-28 18:49:22 UTC (rev 1757)
@@ -9,6 +9,9 @@
 	* proxy.tcl: Removed proxy type 'none' to make sure that every proxy
 	  entry represent a real proxy, which is better to understand.
 
+	* plugins/general/geometry.tcl: Store main window state and geometry
+	  separately for tabbed and non-tabbed modes.
+
 2009-03-27  Sergei Golovan  <sgolovan at nes.ru>
 
 	* custom.tcl: Run commands associated with customizable variables on

Modified: trunk/tkabber/plugins/general/geometry.tcl
===================================================================
--- trunk/tkabber/plugins/general/geometry.tcl	2009-03-28 18:06:43 UTC (rev 1756)
+++ trunk/tkabber/plugins/general/geometry.tcl	2009-03-28 18:49:22 UTC (rev 1757)
@@ -6,10 +6,19 @@
 	[::msgcat::mc "Stored main window state (normal or zoomed)"] \
 	-type string -group Hidden
 
+    custom::defvar MainWindowStateUntabbed {} \
+	[::msgcat::mc "Stored main window state (normal or zoomed) in\
+		       non-tabbed mode"] \
+	-type string -group Hidden
+
     custom::defvar MainWindowGeometry {} \
 	[::msgcat::mc "Stored main window geometry"] \
 	-type string -group Hidden
 
+    custom::defvar MainWindowGeometryUntabbed {} \
+	[::msgcat::mc "Stored main window geometry in non-tabbed mode"] \
+	-type string -group Hidden
+
     hook::add finload_hook [namespace current]::setupBindings 101
     hook::add finload_hook [namespace current]::restoreMainWindowState 99.9
 }
@@ -20,15 +29,25 @@
 }
 
 proc geometry::saveMainWindowState {} {
+    global usetabbar
     variable MainWindowState
+    variable MainWindowStateUntabbed
 
     set screen [winfo screen .]
-    array set tmp $MainWindowState
+    if {$usetabbar} {
+	array set tmp $MainWindowState
+    } else {
+	array set tmp $MainWindowStateUntabbed
+    }
 
     set state [wm state .]
     if {![info exists tmp($screen)] || ![string equal $state $tmp($screen)]} {
 	set tmp($screen) $state
-	set MainWindowState [array get tmp]
+	if {$usetabbar} {
+	    set MainWindowState [array get tmp]
+	} else {
+	    set MainWindowStateUntabbed [array get tmp]
+	}
     }
 }
 
@@ -38,7 +57,9 @@
 }
 
 proc geometry::afterSaveMainWindowGeometry {} {
+    global usetabbar
     variable MainWindowGeometry
+    variable MainWindowGeometryUntabbed
 
     set state [wm state .]
     if {![string equal $state normal]} {
@@ -46,29 +67,48 @@
     }
 
     set screen [winfo screen .]
-    array set tmp $MainWindowGeometry
+    if {$usetabbar} {
+	array set tmp $MainWindowGeometry
+    } else {
+	array set tmp $MainWindowGeometryUntabbed
+    }
 
     set geometry [wm geometry .]
     if {![info exists tmp($screen)] || ![string equal $geometry $tmp($screen)]} {
 	set tmp($screen) $geometry
-	set MainWindowGeometry [array get tmp]
+	if {$usetabbar} {
+	    set MainWindowGeometry [array get tmp]
+	} else {
+	    set MainWindowGeometryUntabbed [array get tmp]
+	}
     }
 }
 
 proc geometry::restoreMainWindowState {} {
     global tcl_platform
+    global usetabbar
     variable MainWindowState
+    variable MainWindowStateUntabbed
     variable MainWindowGeometry
+    variable MainWindowGeometryUntabbed
 
     set screen [winfo screen .]
 
-    array set tmp1 $MainWindowGeometry
+    if {$usetabbar} {
+	array set tmp1 $MainWindowGeometry
+    } else {
+	array set tmp1 $MainWindowGeometryUntabbed
+    }
     if {[info exists tmp1($screen)]} {
 	wm geometry . $tmp1($screen)
     }
 
     if {[string equal $tcl_platform(platform) windows]} {
-	array set tmp2 $MainWindowState
+	if {$usetabbar} {
+	    array set tmp2 $MainWindowState
+	} else {
+	    array set tmp2 $MainWindowStateUntabbed
+	}
 	if {[info exists tmp2($screen)] && [string equal $tmp2($screen) zoomed]} {
 	    wm state . zoomed
 	}



More information about the Tkabber-dev mailing list