Changed the default file name length in the title bar from 30 to 80.
Fulfills: Enhancement Request - File Name in Title Bar Too Short #2334 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2335
-- Commit Summary --
* Changed default title length from 30 to 80.
-- File Changes --
M src/ui_utils.c (2)
-- Patch Links --
https://github.com/geany/geany/pull/2335.patch https://github.com/geany/geany/pull/2335.diff
LGTM
There may be lots of complicated things that could be done here, but hey if a fixed 30 has worked for most people to date then a fixed 80 is no worse.
As 80 characters is as arbitary as 30, this change would break the behaviour which was requested in https://sourceforge.net/p/geany/bugs/298/. I think if at all, we should make it configurable (and maybe enlarge the default a it).
@eht16 if I read it right 298 is for tabs, this is title bar.
298 is about tab, dialogs and title bar (at least according to my comment in the issue :D). I think my point would be valid even if not. Just let's add a (probably hidden) preference for this. The OP prefers 80 characters, the original requestor needed less, the next will need some value in between.
God, please don't add prefs for stuff like this.
@elextr:
There may be lots of complicated things that could be done here, but hey if a fixed 30 has worked for most people to date then a fixed 80 is no worse.
@elextr Thanks, my sentiments exactly.
Eventually the hardcoded value could/should probably be moved to a defined constant. Maybe a refactoring beautification PR?
FYI: this value is hardcoded twice, it's also in document.c: ``` 419 if (length < 0) 420 length = 30;
``` I left it 30 since a filename length less than zero probably doesn't need 80.
IMO, we should just remove the ellipsizing from the window title altogether. It used to be an arbitrary 30 chars, now an arbitrary 80, and there's still the directory path and project name which could be really long, it's totally dependent on window size and user's font size, and sane window managers already handle this. Moreover, the original issue on SF was an extreme edge case where the user's filename somehow had embedded in it all of the query string parameters which shouldn't even be part of a filename.
@codebrainz If removing the ellipsizing works reliably I'm fine with it, but if that needs more extensive testing maybe we can put that into a new PR? This will improve it quick and safe for the time being.
github-comments@lists.geany.org