IgnorantGuru / spacefm

SpaceFM File Manager
http://ignorantguru.github.com/spacefm/
GNU General Public License v3.0
489 stars 73 forks source link

Label on 2 lines is not centered #51

Closed jpfleury closed 12 years ago

jpfleury commented 12 years ago

Note: this is a copy of the ticket 17 on the SourceForge tracker.

Label that is displayed on 2 lines is not aligned with the icon and on the "blue selection box". See the attached screenshot.

spacefm-issue-51

jpfleury commented 12 years ago

Note: this is a copy of a comment from jpfleury.

Indeed, the problem doesn't always occur when the label is on 2 lines, but only when the label contains a "separator" in the text, for example a hyphen. See the attached screenshot of labels on 2 lines but centered.

spacefm-issue-51-2

jpfleury commented 12 years ago

Note: this is a copy of a comment from IgnorantGuru.

I looked at the code and the text renderer is xaligned to center. Beyond that it's just packed into a cell (all of this is original legacy pcmanfm code - I never touched it). I couldn't affect it with anything I changed. Maybe the renderer could be packed into an alignment, but I think that would be expensive in memory and would slow things down, and somehow I doubt that would work either. So this is not likely to be corrected - I think it's just how gtk does it.

jpfleury commented 12 years ago

Note: this is a copy of a comment from jpfleury.

Thanks for your explanation.

May an option to set alignment to the left be a workaround?

jpfleury commented 12 years ago

Note: this is a copy of a comment from jpfleury.

So this is not likely to be corrected - I think it's just how gtk does it.

I attach a screenshot. We see that this bug occurs with PCManFM-Mod 1.2.4, but not with PCManFM 0.9.9, so I suppose there may be some changes from PCManFM 0.5 to PCManFM 0.9 resolving this.

spacefm-issue-51-3

BwackNinja commented 12 years ago

Fixed (but perhaps a hack) with this: https://github.com/BwackNinja/spacefm/commit/ddf484f21cab45d1973a702e9a3500cfbf7aced4

IgnorantGuru commented 12 years ago

Thanks! That fixes it for me on gtk2 and gtk3 (gtk3 branch).

jpfleury commented 12 years ago

Thanks a lot.