[Lazarus] Window sizing on gtk
Max Vlasov
max.vlasov at gmail.com
Fri Oct 28 10:54:10 CEST 2011
On Fri, Oct 28, 2011 at 11:57 AM, Max Vlasov <max.vlasov at gmail.com> wrote:
> I can fix the first problem just by little extra code that switches between
> the current size and Bounds(0, 0, Screen.Width, Screen.Height),....
>
While trying to implement this particular workaround, noticed also a
strange thing
The following "toggle maximize" code can't restore the borderless window
(BorderStyle = bsNone) to the previous state (at least on Ubuntu). So looks
like GTK detected that I maximize to full screen, so it hidden both
toolbars, but later for some reasons don't accept
BoundsRect:=fLastRestoreRect; , the window still stays in the full-screen
state. Only if I wrap the restore into Visible:=false/Visible:=true it
works.
procedure TForm1.Button1Click(Sender: TObject);
begin
if fIsMaximized then
begin
// Visible:=false;;
BoundsRect:=fLastRestoreRect;
fIsMaximized:=false;
// Visible:=true;
end
else
begin
fLastRestoreRect:=BoundsRect;
BoundsRect:=Screen.WorkAreaRect;
fIsMaximized:=true;
end;
end;
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111028/df1e1526/attachment-0003.html>
More information about the Lazarus
mailing list