Skip to content
Snippets Groups Projects
Commit 70fc9675 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Store and restore the maximized state of windows.

[GB.SETTINGS]
* NEW: Store and restore the maximized state of windows.
parent 012436e8
No related branches found
No related tags found
No related merge requests found
Pipeline #528312403 passed
[Component]
Key=gb.settings
Version=3.16.90
Version=3.17.90
Authors=Benoît Minisini
# Gambas Project File 3.0
Title=Gambas settings management
Startup=Main
Version=3.16.90
Version=3.17.90
VersionFile=1
Authors="Benoît Minisini"
TabSize=2
......
......@@ -357,41 +357,25 @@ Private Sub ReadWindow(hWindow As Window, sKey As String)
aPos = Me[sKey &/ "Geometry"]
If Not aPos Or If aPos.Count < 2 Then
Return
Else
X = aPos[0]
Y = aPos[1]
If aPos.Count > 2 Then
W = aPos[2]
H = aPos[3]
If aPos.Count > 4 Then
S = aPos[4]
If S >= Screens.Count Then S = 0
Endif
Else
W = hWindow.W
H = hWindow.H
If Not aPos Or If aPos.Count < 2 Then Return
X = aPos[0]
Y = aPos[1]
If aPos.Count > 2 Then
W = aPos[2]
H = aPos[3]
If aPos.Count > 4 Then
S = aPos[4]
If S >= Screens.Count Then S = 0
Endif
Else
W = hWindow.W
H = hWindow.H
Endif
X += Screens[S].AvailableX
Y += Screens[S].AvailableY
' If Not hWindow.Parent And If Component.IsLoaded("gb.desktop") Then
' D = -1
' Try D = aPos[5]
' If D >= 0 Then
' hObserver = New Observer(hWindow, True) As "Window"
' hObserver.Tag = D
' $cObserver[hWindow.Id] = hObserver
' Endif
' Endif
' If Object.Type(hWindow) = "FHelpBrowser" Then
' Print "ReadWindow: "; X;; Y; " / "; S;; Screens[S].AvailableX;; Screens[S].AvailableY
' Endif
If hWindow.Resizable Then
W = Max(32, W)
H = Max(32, H)
......@@ -404,6 +388,8 @@ Private Sub ReadWindow(hWindow As Window, sKey As String)
Else
If Not hWindow.Modal Then hWindow.Move(X, Y)
Endif
If aPos.Count > 5 And If aPos[5] Then hWindow.Maximized = True
End
......@@ -431,7 +417,7 @@ Private Sub WriteWindow(hWindow As Window, sKey As String)
Endif
aVal = [X, Y, W, H, S]
aVal = [X, Y, W, H, S, If(hWindow.Maximized, 1, 0)]
' If Not hWindow.Parent And If Component.IsLoaded("gb.desktop") Then
' hDesktopWin = New DesktopWindow(hWindow.Id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment