Opened 16 years ago
Closed 16 years ago
#3735 closed enhancement (fixed)
Patch for using layouts in the preferences window of Mail
Reported by: | fcr | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Mail | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
With this patch, the Preferences window of Mail now uses Layouts instead of hardcoded positions.
Attachments (2)
Change History (5)
by , 16 years ago
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Thanks a lot for the patch! You've done everything right, only two coding style hints:
button_ok -> buttonOk. interfaceGrid->SetInsets(r.left+10, r.top+10, r.right+10, r.bottom+10); -> interfaceGrid->SetInsets(r.left + 10, r.top + 10, r.right + 10, r.bottom + 10);
Also, there is a way to make the two grid layouts use the same alignment. Unfortunately we duplicated work, as I've also made the Mail prefs window use layout some time ago, but I didn't commit this yet, since I wanted to ask Axel how he liked the menu fields that used the full available width... I have the patch at home. The only difference to your patch is that I kept Mail compiling for BeOS and that I reduced some code duplication by using a small helper function that adds a BMenuField to the grid and increments the row.
Again, thanks a lot! I will merge our patches and commit when I am back home on Tuesday.
comment:2 by , 16 years ago
While you're working on the E-Mal preferences...
The left list of email accounts is a bit too narrow for my taste. How about making it ~50 pixel wider. Also, now that the layout manager is used: let's have the window resizable, the left account-list growing proportionally.
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've had a closer look at our two patches. I've now commited my version of the patch in hrev30202. The main reason being that I kept it possible to build a BeOS R5 version of Mail.
Here are some small improvements possible with your patch (but you can see from the changeset that what we did is pretty similar):
- When creating the BBox objects, you should use the new constructor that doesn't take a BRect at all. You did this for the other controls. When using layout-management, it needs to be done for all controls in the hierarchy, or they won't have the correct flags (B_SUPPORTS_LAYOUT), and some initial setup may be different.
- This part of the patch is weird:
177 BRect r = interfaceBox->InnerFrame(); 178 interfaceGrid->SetInsets(r.left+10, r.top+10, r.right+10, r.bottom+10);
The inner frame of the box is in absolute (view relative) coordinates, but insets are given as distance to the outer frame. So this should not have worked at all, unless the inner frame happened to be very small.
- I've made a small helper function to avoid a lot of the code duplication when adding the BMenuFields.
- I wanted to keep the labels aligned across the two sections, and this is indeed possible:
interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL);
Again, thanks a lot for your work!
Screenshot of the form.