Fix font size from FontButton, behave differently from Gtk3.18 vs. 3.20
Gtk3.18 use px unit, Gtk3.20 use pt unit. Font selection does not necessarily select the correct font where variant exists, expect strange result. Nothing will be done to fix that.
This commit is contained in:
@@ -338,7 +338,13 @@ int main(int argc, char **argv)
|
||||
if (options.fontFamily != "default") {
|
||||
try {
|
||||
cssForced = Gtk::CssProvider::create();
|
||||
//GTK318
|
||||
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
|
||||
cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2px }", options.fontFamily, options.fontSize));
|
||||
#else
|
||||
cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2pt }", options.fontFamily, options.fontSize));
|
||||
#endif
|
||||
//GTK318
|
||||
Gtk::StyleContext::add_provider_for_screen(screen, cssForced, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
} catch (Glib::Error &err) {
|
||||
printf("Error: \"%s\"\n", err.what().c_str());
|
||||
|
Reference in New Issue
Block a user