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

use "monospace 10" in non-gnome environment #458

Closed multiSnow closed 3 years ago

multiSnow commented 3 years ago

In Gio.Settings.new:

It is an error for the schema to not exist: schemas are an essential part of a program, as they provide type information. If schemas need to be dynamically loaded (for example, from an optional runtime dependency), Gio.SettingsSchemaSource.lookup() can be used to test for their existence before loading them.

This PR lookup 'org.gnome.desktop.interface' before load it, or use 'monospace 10' as system monospace font if 'org.gnome.desktop.interface' is not found (not in Gnome Desktop Environment).

MeanEYE commented 3 years ago

Thanks for submitting this. I'll take a look at it tomorrow as there are some things I'd like to be changed in this PR and am exhausted from today's work. 13h shifts are not making me eager to look at more code :).

MeanEYE commented 3 years ago

Sorry for the delay. Before I merge I'd like to ask few things in regard to this.

  1. Why create a separate file only for this use;
  2. Why use global variable/constant?
multiSnow commented 3 years ago

Using global variable so that the 'lookup' operation would done only once and the result, the name string of monospace font, could be used in VTE, file list, source viewer, and maybe other widget in the future.

I could not decide which file is better to place such a function. 'common.py' does not contain pygi module, and modules under 'tools' already as their own usage and has not relation with 'font'.

MeanEYE commented 3 years ago

I think I'd prefer this be under common.py if you don't mind moving it. Missing import is easily added.

MeanEYE commented 3 years ago

Thank you!