The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: TurfIt on January 09, 2011, 08:17:08 PM

Title: [patch] gui window snap
Post by: TurfIt on January 09, 2011, 08:17:08 PM
Patch implements window edge snapping for moving and resizing. Snap distance configurable in Display Settings dialog. Setting to 0 disables this love it/hate it feature.
Title: Re: [patch] gui window snap
Post by: prissi on January 09, 2011, 09:53:03 PM
What is edge snapping in laymens terms? This would help user to comment on that ...
Title: Re: [patch] gui window snap
Post by: TurfIt on January 09, 2011, 10:09:32 PM
When moving a window's position around the screen, if it's border (edge) comes close to another window's border, the moving window will jump (snap) over to align the borders. When working with multiple open windows on the screen, this allows the user to quickly tile them without gaps/overlaps.
Title: Re: [patch] gui window snap
Post by: jamespetts on January 09, 2011, 11:27:57 PM
Seems like a good idea in principle :-)
Title: Re: [patch] gui window snap
Post by: jonasbb on January 11, 2011, 05:59:45 PM
@prissi: would you insert this into ST?
I think this is a great patch.
Title: Re: [patch] gui window snap
Post by: Dwachs on January 11, 2011, 07:43:40 PM
I did some minor changes (moving variable declaration a bit). I still have the feeling that those doubled snap-checks can be moved into one function to reduce code duplication. But otherwise the patch looks good.
Title: Re: [patch] gui window snap
Post by: TurfIt on January 14, 2011, 04:06:26 AM
I see this has gone in as of r4175. Here's a patch against 4175 to reduce code duplication as per Dwachs suggestion.
Title: Re: [patch] gui window snap
Post by: Dwachs on January 14, 2011, 07:04:48 AM
moved to 'considered' in order that this patch is not forgotten ;) thank you!

edit: anyway, the codechange is incorporated :)