added a style property to control boldening of the frame title.

2004-05-04  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpframe.c: added a style property to control
	boldening of the frame title.

	* themes/Default/gtkrc
	* themes/Small/gtkrc: suppress the bold title for GimpFrames in
	GimpDockables,
This commit is contained in:
Sven Neumann 2004-05-04 20:05:10 +00:00 committed by Sven Neumann
parent ca18cc547f
commit a94e7291e8
4 changed files with 29 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2004-05-04 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpframe.c: added a style property to control
boldening of the frame title.
* themes/Default/gtkrc
* themes/Small/gtkrc: suppress the bold title for GimpFrames in
GimpDockables,
2004-05-04 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpframe.c (gimp_frame_size_allocate): allocate

View File

@ -32,6 +32,8 @@
#define DEFAULT_LABEL_SPACING 6
#define DEFAULT_LABEL_BOLD TRUE
#define GIMP_FRAME_INDENT_KEY "gimp-frame-indent"
#define GIMP_FRAME_IN_EXPANDER_KEY "gimp-frame-in-expander"
@ -103,6 +105,11 @@ gimp_frame_class_init (GimpFrameClass *klass)
frame_class->compute_child_allocation = gimp_frame_child_allocate;
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("label_bold",
NULL, NULL,
DEFAULT_LABEL_BOLD,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("label_spacing",
NULL, NULL,
@ -230,7 +237,12 @@ static void
gimp_frame_style_set (GtkWidget *widget,
GtkStyle *previous)
{
/* for "label_spacing" */
g_object_set_data (G_OBJECT (widget), GIMP_FRAME_INDENT_KEY, NULL);
gtk_widget_queue_resize (widget);
/* for "label_bold" */
gimp_frame_label_widget_notify (GTK_FRAME (widget));
}
static gboolean
@ -271,12 +283,15 @@ gimp_frame_label_widget_notify (GtkFrame *frame)
if (label)
{
PangoAttrList *attrs;
PangoAttrList *attrs = pango_attr_list_new ();
PangoAttribute *attr;
gboolean bold;
attrs = pango_attr_list_new ();
gtk_widget_style_get (GTK_WIDGET (frame), "label_bold", &bold, NULL);
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
attr = pango_attr_weight_new (bold ?
PANGO_WEIGHT_BOLD :
PANGO_WEIGHT_NORMAL);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);

View File

@ -77,6 +77,7 @@ widget "*GimpContainerGridView*GtkViewport*" style "gimp-grid-view-style"
style "gimp-dockable-style" = "gimp-default-style"
{
GimpFrame::label_bold = 0
GimpFrame::label_spacing = 2
GtkButton::focus_line_width = 0
GtkButton::focus_line_padding = 0

View File

@ -75,6 +75,7 @@ widget "*GimpContainerGridView*GtkViewport*" style "gimp-grid-view-style"
style "gimp-dockable-style" = "gimp-default-style"
{
GimpFrame::label_bold = 0
GimpFrame::label_spacing = 1
GtkButton::focus_line_width = 0
GtkButton::focus_line_padding = 0