MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.
GNU General Public License v3.0
428 stars 42 forks source link

Sunflower is not using a system font in Mode and Date columns #440

Closed AlexDaniel closed 4 years ago

AlexDaniel commented 4 years ago

See this screenshot: image

The font is different in Mode and Date columns. I think sunflower is forcing a different font even though the default one is already fixed-width.

jtojnar commented 4 years ago

It will use the monospace font chosen by fontconfig:

https://github.com/MeanEYE/Sunflower/blob/841252d0f05c029ef89f52e7547d3630ff20091d/sunflower/plugins/file_list/file_list.py#L341

Perhaps we should make it use GNOME’s monospace font like Terminal plug-in does:

https://github.com/MeanEYE/Sunflower/blob/841252d0f05c029ef89f52e7547d3630ff20091d/sunflower/plugin_base/terminal.py#L124

MeanEYE commented 4 years ago

You are right. We are using just generic monospace family name which doesn't seem to produce good results in your case. However, we can use Gio.Settings to derive proper font and just modify size that way.

The approach @jtojnar is talking about is the correct one. However font family that is specified in cell_renderer has to be string. So our approach would most likely be something like this:

settings = Gio.Settings.new('org.gnome.desktop.interface')
font = settings.get_string('monospace-font-name')