mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
#616606 - Get default report font from top level widget
Patch by Tao Wang git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19357 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d26b72f5f1
commit
5ac329c376
@ -17,7 +17,8 @@ libgncmod_report_system_la_LIBADD = \
|
||||
${top_builddir}/src/gnc-module/libgnc-module.la \
|
||||
${top_builddir}/src/app-utils/libgncmod-app-utils.la \
|
||||
${GUILE_LIBS} \
|
||||
${GLIB_LIBS}
|
||||
${GLIB_LIBS} \
|
||||
${GTK_LIBS}
|
||||
|
||||
if BUILDING_FROM_SVN
|
||||
swig-report-system.c: report-system.i ${top_srcdir}/src/base-typemaps.i
|
||||
@ -29,7 +30,9 @@ AM_CPPFLAGS = \
|
||||
-I${top_srcdir}/src \
|
||||
-I${top_srcdir}/src/gnc-module \
|
||||
-I${top_srcdir}/src/app-utils \
|
||||
${GLIB_CFLAGS} ${GUILE_INCS}
|
||||
${GLIB_CFLAGS} \
|
||||
${GTK_CFLAGS} \
|
||||
${GUILE_INCS}
|
||||
|
||||
gncscmdir = ${GNC_SHAREDIR}/scm
|
||||
gncscm_DATA = \
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <libguile.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -198,5 +199,18 @@ gnc_report_name( SCM report )
|
||||
gchar*
|
||||
gnc_get_default_report_font_family(void)
|
||||
{
|
||||
return g_strdup("Arial");
|
||||
GList* top_list;
|
||||
GtkWidget* top_widget;
|
||||
GtkStyle* top_widget_style;
|
||||
const gchar* default_font_family;
|
||||
|
||||
top_list = gtk_window_list_toplevels();
|
||||
top_widget = GTK_WIDGET(top_list->data);
|
||||
top_widget_style = gtk_rc_get_style(top_widget);
|
||||
default_font_family = pango_font_description_get_family(top_widget_style->font_desc);
|
||||
|
||||
if (default_font_family == NULL)
|
||||
return g_strdup("Arial");
|
||||
else
|
||||
return g_strdup(default_font_family);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user