#5614: Layouting should have default spacing ---------------------------------+------------------------------------------ Reporter: axeld | Owner: yourpalal Type: enhancement | Status: closed Priority: normal | Milestone: R1 Component: Kits/Interface Kit | Version: R1/Development Resolution: fixed | Keywords: Blocked By: | Has a Patch: 0 Platform: All | Blocking: 5524 ---------------------------------+------------------------------------------ Comment (by yourpalal): Replying to [comment:7 axeld]: > Thanks for having implemented this! I don't see where the default spacing is still 0, 0, 0, 0 as you mention in the commit message of r38512. Welcome :) Although the spacing defaults to B_USE_DEFAULT_SPACING, the insets for layouts that support them (BTwoDimensionalLayout & BSplitLayout) still default to 0, 0, 0, 0. I think this is the most sane behaviour, since otherwise, nesting layouts would lead to very large spaces in the GUI. eg. {{{ ------------------------------------------| | insets |-----------------------| insets | | | insets -------- insets| | | | |usable space| | | ... etc ... ... }}} That example isn't very good, but hopefully you get the idea :P I did however make it possible to pass in B_USE_DEFAULT_SPACING to SetInsets, so it is still possible to make use of 'default' insets. > One thing I don't like as much is that the default spacing is "composed" in the constructor, as this means the spacing is not updated if you relayout after a global font size change (we don't yet broadcast those IIRC, though), or if you change the font size afterwards. Yes, this is something I flip-flopped a bit on, but decided to compose it at construction/setting time for now since currently the font size is used and BControlLook::DefaultItemSpacing is (currently) non-virtual, it was nearly equivalent. I also felt it kept the code a bit cleaner. That being said, it could be nice to have these values update on the fly, especially once DefaultItemSpacing is virtual (there is a TODO for it, but I'm not sure what is stopping it). The nice thing is that moving the composing to 'Get time' should not break anything. (Although it should be finalized before the API goes public, of course) > Also, I guess we can now go over the sources, and remove all the custom spacing setters? Yes, that would make a good "easy ticket", I think. -- Ticket URL: <http://dev.haiku-os.org/ticket/5614#comment:8> Haiku <http://dev.haiku-os.org> Haiku - the operating system.