From 5ac566918b55fbfaf541db9011135d31474beb6e Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 27 Mar 2012 01:16:00 +0000 Subject: [PATCH] Ajustes em windows --- src/gtk/actions.c | 2 -- src/gtk/common/config.c | 1 - src/gtk/print.c | 30 ++++++++++++------------------ src/gtk/pw3270-GTK.cbp | 77 +++++++++++++++++++++++++++++++++++++++-------------------------------------- 4 files changed, 51 insertions(+), 59 deletions(-) diff --git a/src/gtk/actions.c b/src/gtk/actions.c index c68a525..6b01747 100644 --- a/src/gtk/actions.c +++ b/src/gtk/actions.c @@ -427,9 +427,7 @@ GtkAction * ui_get_action(GtkWidget *widget, const gchar *name, GHashTable *hash callback = cbk; action_type = ACTION_TYPE_TABLE; - trace("%s",__FUNCTION__); id = get_attribute_id(name,"src",&nm,src,names,values,error); - trace("%s",__FUNCTION__); if(id < 0) return NULL; diff --git a/src/gtk/common/config.c b/src/gtk/common/config.c index 7ab55ff..e707256 100644 --- a/src/gtk/common/config.c +++ b/src/gtk/common/config.c @@ -26,7 +26,6 @@ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * licinio@bb.com.br (Licínio Luis Branco) * kraucer@bb.com.br (Kraucer Fernandes Mazuco) - * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) * */ diff --git a/src/gtk/print.c b/src/gtk/print.c index a5118b2..9a2218e 100644 --- a/src/gtk/print.c +++ b/src/gtk/print.c @@ -147,30 +147,23 @@ static void font_set(GtkFontButton *widget, PRINT_INFO *info) { - const gchar *name = gtk_font_button_get_font_name(widget); + const gchar * name = gtk_font_button_get_font_name(widget); + PangoFontDescription * descr = pango_font_description_from_string(name); + + if(!descr) + return; if(info->font) g_free(info->font); -#if GTK_CHECK_VERSION(3,2,0) - - info->font = g_strdup(name); - info->fontsize = gtk_font_chooser_get_font_size((GtkFontChooser *) widget); + info->font = g_strdup(pango_font_description_get_family(descr)); + info->fontsize = pango_font_description_get_size(descr); + info->fontweight = CAIRO_FONT_WEIGHT_NORMAL; -#else - { - PangoFontDescription *descr = pango_font_description_from_string(name); + if(pango_font_description_get_weight(descr) == PANGO_WEIGHT_BOLD) + info->fontweight = CAIRO_FONT_WEIGHT_BOLD; - info->font = g_strdup(pango_font_description_get_family(descr)); - info->fontsize = pango_font_description_get_size(descr); - info->fontweight = CAIRO_FONT_WEIGHT_NORMAL; - - if(pango_font_description_get_weight(descr) == PANGO_WEIGHT_BOLD) - info->fontweight = CAIRO_FONT_WEIGHT_BOLD; - - pango_font_description_free(descr); - } -#endif // GTK(3,2,0) + pango_font_description_free(descr); set_string_to_config("print","font",name); trace("Font set to \"%s\" with size %d",info->font,info->fontsize); @@ -256,6 +249,7 @@ // Font selection button widget = gtk_font_button_new(); + #if GTK_CHECK_VERSION(3,2,0) gtk_font_chooser_set_filter_func((GtkFontChooser *) widget,filter_monospaced,NULL,NULL); #endif // GTK(3,2,0) diff --git a/src/gtk/pw3270-GTK.cbp b/src/gtk/pw3270-GTK.cbp index a308a05..4c223f7 100644 --- a/src/gtk/pw3270-GTK.cbp +++ b/src/gtk/pw3270-GTK.cbp @@ -7,8 +7,8 @@