make the font scale factor configurable in gtkrc.
2008-10-04 Sven Neumann <sven@gimp.org> * libgimpwidgets/gimpruler.c: make the font scale factor configurable in gtkrc. * themes/Default/gtkrc * themes/Small/gtkrc: for documentation, add the default value here. svn path=/trunk/; revision=27121
This commit is contained in:

committed by
Sven Neumann

parent
9852ccc268
commit
c28b7653f5
@ -1,3 +1,11 @@
|
|||||||
|
2008-10-04 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpwidgets/gimpruler.c: make the font scale factor
|
||||||
|
configurable in gtkrc.
|
||||||
|
|
||||||
|
* themes/Default/gtkrc
|
||||||
|
* themes/Small/gtkrc: for documentation, add the default value here.
|
||||||
|
|
||||||
2008-10-03 Sven Neumann <sven@gimp.org>
|
2008-10-03 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/web-browser.c (browser_open_url): removed
|
* plug-ins/common/web-browser.c (browser_open_url): removed
|
||||||
|
@ -31,8 +31,9 @@
|
|||||||
#include "gimpruler.h"
|
#include "gimpruler.h"
|
||||||
|
|
||||||
|
|
||||||
#define RULER_WIDTH 13
|
#define DEFAULT_RULER_FONT_SCALE PANGO_SCALE_X_SMALL
|
||||||
#define MINIMUM_INCR 5
|
#define RULER_WIDTH 13
|
||||||
|
#define MINIMUM_INCR 5
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -61,6 +62,7 @@ typedef struct
|
|||||||
|
|
||||||
GdkPixmap *backing_store;
|
GdkPixmap *backing_store;
|
||||||
GdkGC *non_gr_exp_gc;
|
GdkGC *non_gr_exp_gc;
|
||||||
|
gdouble font_scale;
|
||||||
|
|
||||||
gint xsrc;
|
gint xsrc;
|
||||||
gint ysrc;
|
gint ysrc;
|
||||||
@ -69,8 +71,8 @@ typedef struct
|
|||||||
|
|
||||||
static const struct
|
static const struct
|
||||||
{
|
{
|
||||||
gdouble ruler_scale[16];
|
const gdouble ruler_scale[16];
|
||||||
gint subdivide[5];
|
const gint subdivide[5];
|
||||||
} ruler_metric =
|
} ruler_metric =
|
||||||
{
|
{
|
||||||
{ 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000 },
|
{ 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000 },
|
||||||
@ -91,6 +93,8 @@ static void gimp_ruler_realize (GtkWidget *widget);
|
|||||||
static void gimp_ruler_unrealize (GtkWidget *widget);
|
static void gimp_ruler_unrealize (GtkWidget *widget);
|
||||||
static void gimp_ruler_size_allocate (GtkWidget *widget,
|
static void gimp_ruler_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation);
|
GtkAllocation *allocation);
|
||||||
|
static void gimp_ruler_style_set (GtkWidget *widget,
|
||||||
|
GtkStyle *prev_style);
|
||||||
static gboolean gimp_ruler_motion_notify (GtkWidget *widget,
|
static gboolean gimp_ruler_motion_notify (GtkWidget *widget,
|
||||||
GdkEventMotion *event);
|
GdkEventMotion *event);
|
||||||
static gboolean gimp_ruler_expose (GtkWidget *widget,
|
static gboolean gimp_ruler_expose (GtkWidget *widget,
|
||||||
@ -121,6 +125,7 @@ gimp_ruler_class_init (GimpRulerClass *klass)
|
|||||||
widget_class->realize = gimp_ruler_realize;
|
widget_class->realize = gimp_ruler_realize;
|
||||||
widget_class->unrealize = gimp_ruler_unrealize;
|
widget_class->unrealize = gimp_ruler_unrealize;
|
||||||
widget_class->size_allocate = gimp_ruler_size_allocate;
|
widget_class->size_allocate = gimp_ruler_size_allocate;
|
||||||
|
widget_class->style_set = gimp_ruler_style_set;
|
||||||
widget_class->motion_notify_event = gimp_ruler_motion_notify;
|
widget_class->motion_notify_event = gimp_ruler_motion_notify;
|
||||||
widget_class->expose_event = gimp_ruler_expose;
|
widget_class->expose_event = gimp_ruler_expose;
|
||||||
|
|
||||||
@ -183,6 +188,14 @@ gimp_ruler_class_init (GimpRulerClass *klass)
|
|||||||
G_MAXDOUBLE,
|
G_MAXDOUBLE,
|
||||||
0.0,
|
0.0,
|
||||||
GIMP_PARAM_READWRITE));
|
GIMP_PARAM_READWRITE));
|
||||||
|
|
||||||
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
|
g_param_spec_double ("font-scale",
|
||||||
|
NULL, NULL,
|
||||||
|
0.0,
|
||||||
|
G_MAXDOUBLE,
|
||||||
|
DEFAULT_RULER_FONT_SCALE,
|
||||||
|
GIMP_PARAM_READABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -203,6 +216,7 @@ gimp_ruler_init (GimpRuler *ruler)
|
|||||||
priv->max_size = 0;
|
priv->max_size = 0;
|
||||||
priv->backing_store = NULL;
|
priv->backing_store = NULL;
|
||||||
priv->non_gr_exp_gc = NULL;
|
priv->non_gr_exp_gc = NULL;
|
||||||
|
priv->font_scale = DEFAULT_RULER_FONT_SCALE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -560,6 +574,19 @@ gimp_ruler_size_allocate (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_ruler_style_set (GtkWidget *widget,
|
||||||
|
GtkStyle *prev_style)
|
||||||
|
{
|
||||||
|
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
|
||||||
|
|
||||||
|
GTK_WIDGET_CLASS (gimp_ruler_parent_class)->style_set (widget, prev_style);
|
||||||
|
|
||||||
|
gtk_widget_style_get (widget,
|
||||||
|
"font-scale", &priv->font_scale,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_ruler_motion_notify (GtkWidget *widget,
|
gimp_ruler_motion_notify (GtkWidget *widget,
|
||||||
GdkEventMotion *event)
|
GdkEventMotion *event)
|
||||||
@ -961,15 +988,16 @@ static PangoLayout *
|
|||||||
gimp_ruler_create_layout (GtkWidget *widget,
|
gimp_ruler_create_layout (GtkWidget *widget,
|
||||||
const gchar *text)
|
const gchar *text)
|
||||||
{
|
{
|
||||||
PangoLayout *layout;
|
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (widget);
|
||||||
PangoAttrList *attrs;
|
PangoLayout *layout;
|
||||||
PangoAttribute *attr;
|
PangoAttrList *attrs;
|
||||||
|
PangoAttribute *attr;
|
||||||
|
|
||||||
layout = gtk_widget_create_pango_layout (widget, text);
|
layout = gtk_widget_create_pango_layout (widget, text);
|
||||||
|
|
||||||
attrs = pango_attr_list_new ();
|
attrs = pango_attr_list_new ();
|
||||||
|
|
||||||
attr = pango_attr_scale_new (PANGO_SCALE_X_SMALL);
|
attr = pango_attr_scale_new (priv->font_scale);
|
||||||
attr->start_index = 0;
|
attr->start_index = 0;
|
||||||
attr->end_index = -1;
|
attr->end_index = -1;
|
||||||
pango_attr_list_insert (attrs, attr);
|
pango_attr_list_insert (attrs, attr);
|
||||||
|
@ -91,6 +91,7 @@ widget "*GimpDockable.*" style "gimp-dockable-style"
|
|||||||
|
|
||||||
style "gimp-display-style" = "gimp-default-style"
|
style "gimp-display-style" = "gimp-default-style"
|
||||||
{
|
{
|
||||||
|
GimpRuler::font-scale = 0.6444
|
||||||
GimpUnitComboBox::label-scale = 0.8333
|
GimpUnitComboBox::label-scale = 0.8333
|
||||||
GimpScaleComboBox::label-scale = 0.8333
|
GimpScaleComboBox::label-scale = 0.8333
|
||||||
GtkComboBox::arrow-size = 8
|
GtkComboBox::arrow-size = 8
|
||||||
|
@ -98,6 +98,7 @@ widget "*GimpDockable.*" style "gimp-dockable-style"
|
|||||||
|
|
||||||
style "gimp-display-style" = "gimp-default-style"
|
style "gimp-display-style" = "gimp-default-style"
|
||||||
{
|
{
|
||||||
|
GimpRuler::font-scale = 0.6444
|
||||||
GimpUnitComboBox::label-scale = 0.8333
|
GimpUnitComboBox::label-scale = 0.8333
|
||||||
GimpScaleComboBox::label-scale = 0.8333
|
GimpScaleComboBox::label-scale = 0.8333
|
||||||
GtkComboBox::arrow-size = 8
|
GtkComboBox::arrow-size = 8
|
||||||
|
Reference in New Issue
Block a user