some experimental and pretty evil code which reduces the font size in
2008-03-21 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdock.c (gimp_dock_style_set): some experimental and pretty evil code which reduces the font size in docks by 20%. svn path=/trunk/; revision=25150
This commit is contained in:
parent
deefaa0e49
commit
98eb3d2a2c
2 changed files with 34 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2008-03-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpdock.c (gimp_dock_style_set): some experimental
|
||||
and pretty evil code which reduces the font size in docks by 20%.
|
||||
|
||||
2008-03-21 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): make sure
|
||||
|
|
|
|||
|
|
@ -358,7 +358,12 @@ static void
|
|||
gimp_dock_style_set (GtkWidget *widget,
|
||||
GtkStyle *prev_style)
|
||||
{
|
||||
gint default_height;
|
||||
PangoContext *context;
|
||||
PangoFontDescription *font_desc;
|
||||
gint font_size;
|
||||
gint default_height;
|
||||
gchar *font_str;
|
||||
gchar *rc_string;
|
||||
|
||||
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
||||
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
||||
|
|
@ -366,6 +371,29 @@ gimp_dock_style_set (GtkWidget *widget,
|
|||
gtk_widget_style_get (widget, "default-height", &default_height, NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (widget), -1, default_height);
|
||||
|
||||
context = gtk_widget_get_pango_context (widget);
|
||||
font_desc = pango_context_get_font_description (context);
|
||||
font_desc = pango_font_description_copy (font_desc);
|
||||
|
||||
font_size = pango_font_description_get_size (font_desc);
|
||||
font_size = 0.8 * font_size;
|
||||
pango_font_description_set_size (font_desc, font_size);
|
||||
|
||||
font_str = pango_font_description_to_string (font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
|
||||
rc_string =
|
||||
g_strdup_printf ("style \"gimp-dock-style\""
|
||||
"{"
|
||||
" font_name = \"%s\""
|
||||
"}"
|
||||
"widget_class \"<GimpDock>.*\" style \"gimp-dock-style\"",
|
||||
font_str);
|
||||
g_free (font_str);
|
||||
|
||||
gtk_rc_parse_string (rc_string);
|
||||
g_free (rc_string);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue