Re: [Lazarus] Patch for improved window layout

2009-02-28 Thread Kostas Michalopoulos
> 2009/3/1 Kostas Michalopoulos :
>> 1. The component bar ("MainIDEBar")'s height is calculated to match the
>> contents and current window size.
> This is a good idea in general, however your patch IMHO has some flaws,
> which I'll list in order from least to most significant:
> 1) CalcMainIDEBarHeight function has inconsistent indenting and no
> try-finally block

I'll check it.

> 2) I am not sure how this code takes into account MainMenu height

It doesn't. It seems the menu is considered as a part of the frame so its 
added transparently when the SetBounds is called.

> 3) It certainly does not take into account possibility for more than a
> single row of components
>  on the tab (which, I presume, was the main reason for original large 
> height).

The original large height wasn't large enough to show two rows. But I don't 
have encountered a computer that even fills the component bar. Although by 
resizing it I saw that the components simply disappear, which I think isn't 
a good idea. I believe the best would be to scroll (like in Delphi - ideally 
they would fill the available horizontal/vertical space and scroll for the 
rest) or at least have a visual clue that there are more components.

> Perhaps a better suggestion would be to measure sizes of real components,
> instead of creating a fake ones.

Initially I thought this, but the problem is that the real components are 
aligned so their sizes mean nothing.

>
>> 2. Line up the windows so they don't appear inconsistent and they don't
>> overlap each other.
>> 3. Make the default new form size to cover a large area made up of the 
>> area
>> left by the object inspector, the main bar and the messages window.
>> 4. Resize the source editor window to be smaller than the default new 
>> form
>> size but similar in aspect.
>
> These are merely a tweaks for magic constants.
> I have nothing against it, but I think this is, at best, a workaround
> until docking code is finished.

They make Lazarus look better now at least :-).

Kostas
 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for improved window layout

2009-02-28 Thread Alexander Klenin
2009/3/1 Kostas Michalopoulos :
> 1. The component bar ("MainIDEBar")'s height is calculated to match the
> contents and current window size.
This is a good idea in general, however your patch IMHO has some flaws,
which I'll list in order from least to most significant:
1) CalcMainIDEBarHeight function has inconsistent indenting and no
try-finally block
2) I am not sure how this code takes into account MainMenu height
3) It certainly does not take into account possibility for more than a
single row of components
  on the tab (which, I presume, was the main reason for original large height).
Perhaps a better suggestion would be to measure sizes of real components,
instead of creating a fake ones.

> 2. Line up the windows so they don't appear inconsistent and they don't
> overlap each other.
> 3. Make the default new form size to cover a large area made up of the area
> left by the object inspector, the main bar and the messages window.
> 4. Resize the source editor window to be smaller than the default new form
> size but similar in aspect.

These are merely a tweaks for magic constants.
I have nothing against it, but I think this is, at best, a workaround
until docking code is finished.

-- 
Alexander S. Klenin
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for improved window layout

2009-02-28 Thread Kostas Michalopoulos
I updated the patch with some suggestions by fpcfan and martin_frb from 
#lazarus-ide:


1. Added some failsafe code to make sure there won't be negative results in 
dual mode screens

2. The form is brought to top only if a new project is made at startup

The attached patch replaces the previous one.

Kostas

--
From: "Kostas Michalopoulos" 
Sent: Saturday, February 28, 2009 10:01 PM
To: 
Subject: [Lazarus] Patch for improved window layout


I've attached a patch for ide\main.pp (rev 18847) which provides a more
coherent window layout. Its not exactly what I had in my mind (an
approximation of which can be seen when you open a default early Delphi
installation) mostly because there doesn't seem to be a method to obtain 
the
real window boundaries including the titlebar and frame (as a sidenote, 
this

is something that should be addressed since this functionality is required
for automatic alignment of multiwindow applications). So I did what I 
could

with the existing resources.

Some modifications I did has to do with the "first look" of the program. I
believe that 0.9.26 leaves much to be desired regarding the initial look. 
So

I modified the code in order to:

1. The component bar ("MainIDEBar")'s height is calculated to match the
contents and current window size.
2. Line up the windows so they don't appear inconsistent and they don't
overlap each other.
3. Make the default new form size to cover a large area made up of the 
area

left by the object inspector, the main bar and the messages window.
4. Resize the source editor window to be smaller than the default new form
size but similar in aspect.
5. When a new project is made (or the IDE starts), the form is brought on
top instead of the source editor.
6. Try to not mess it up with other themes :-)

I did #1 and #2 to make Lazarus look less chaotic and more consistent. I
really believe it looks better now.
I did #3, #4 and #5 to focus on the visual side of Lazarus. Lazarus's
strength is the RAD, which means the user doesn't have to type code. By
showing the form (#5) instead of the code this is highlighted, especially
since the form is not a tiny little form (#3). I made the source window a
little smaller to enhance even more this aspect of the IDE: the design 
part
is more important than the code part so the code editor is hidden behind 
the

form (#4).
Lastly I did #6, or at least I tried to, for practical reasons.

This is how Lazarus looks with my patch after an initial launch (I just
launched the program):

Aero: http://gimme.badsectoracula.com/winlazarus_aero.png
Basic: http://gimme.badsectoracula.com/winlazarus_vistabasic.png
Classic: http://gimme.badsectoracula.com/winlazarus_classic.png

I would like to make Classic look more tight, but the frame width of Aero
and Basic makes the windows to overlap. Here is where I wanted to be able 
to
use the real window bounds instead of the client areas. I compromised a 
bit

and I gave more weight to the Aero/Basic themes since this is what most
people will use in the near future. Also from my experience from Linux, 
many

window managers look more like Aero/Basic than Classic.

So here it is, I hope this patch will be added (after maybe tested in 
other

platforms - I only have Windows Vista available at the moment). I really
believe it makes Lazarus look more "professional" and coherent.

Kostas







___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


lazarus-mainide-winlayout2.patch
Description: Binary data
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Patch for improved window layout

2009-02-28 Thread Kostas Michalopoulos
I've attached a patch for ide\main.pp (rev 18847) which provides a more 
coherent window layout. Its not exactly what I had in my mind (an 
approximation of which can be seen when you open a default early Delphi 
installation) mostly because there doesn't seem to be a method to obtain the 
real window boundaries including the titlebar and frame (as a sidenote, this 
is something that should be addressed since this functionality is required 
for automatic alignment of multiwindow applications). So I did what I could 
with the existing resources.


Some modifications I did has to do with the "first look" of the program. I 
believe that 0.9.26 leaves much to be desired regarding the initial look. So 
I modified the code in order to:


1. The component bar ("MainIDEBar")'s height is calculated to match the 
contents and current window size.
2. Line up the windows so they don't appear inconsistent and they don't 
overlap each other.
3. Make the default new form size to cover a large area made up of the area 
left by the object inspector, the main bar and the messages window.
4. Resize the source editor window to be smaller than the default new form 
size but similar in aspect.
5. When a new project is made (or the IDE starts), the form is brought on 
top instead of the source editor.

6. Try to not mess it up with other themes :-)

I did #1 and #2 to make Lazarus look less chaotic and more consistent. I 
really believe it looks better now.
I did #3, #4 and #5 to focus on the visual side of Lazarus. Lazarus's 
strength is the RAD, which means the user doesn't have to type code. By 
showing the form (#5) instead of the code this is highlighted, especially 
since the form is not a tiny little form (#3). I made the source window a 
little smaller to enhance even more this aspect of the IDE: the design part 
is more important than the code part so the code editor is hidden behind the 
form (#4).

Lastly I did #6, or at least I tried to, for practical reasons.

This is how Lazarus looks with my patch after an initial launch (I just 
launched the program):


Aero: http://gimme.badsectoracula.com/winlazarus_aero.png
Basic: http://gimme.badsectoracula.com/winlazarus_vistabasic.png
Classic: http://gimme.badsectoracula.com/winlazarus_classic.png

I would like to make Classic look more tight, but the frame width of Aero 
and Basic makes the windows to overlap. Here is where I wanted to be able to 
use the real window bounds instead of the client areas. I compromised a bit 
and I gave more weight to the Aero/Basic themes since this is what most 
people will use in the near future. Also from my experience from Linux, many 
window managers look more like Aero/Basic than Classic.


So here it is, I hope this patch will be added (after maybe tested in other 
platforms - I only have Windows Vista available at the moment). I really 
believe it makes Lazarus look more "professional" and coherent.


Kostas



lazarus-mainide-winlayout.patch
Description: Binary data
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus