[gtk+/client-side-decorations] Add 'decoration-corner-radius' style property.
- From: Cody Russell <bratsche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/client-side-decorations] Add 'decoration-corner-radius' style property.
- Date: Thu, 20 May 2010 20:16:53 +0000 (UTC)
commit 74352ac6169257fcd5f11cc358b402bd100c9c7c
Author: Cody Russell <bratsche gnome org>
Date: Wed May 19 15:25:32 2010 -0500
Add 'decoration-corner-radius' style property.
gtk/gtkstyle.c | 10 +++++++---
gtk/gtkwindow.c | 7 +++++++
2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index b48cc36..58ce5cb 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -3745,9 +3745,9 @@ paint_decorated_window (GtkStyle *style,
{
cairo_pattern_t *gradient;
cairo_t *cr;
- const double hmargin = 2.5 + x;
- const double vmargin = 2.5 + y;
- const double radius = 5;
+ const double hmargin = x;
+ const double vmargin = y;
+ const double radius;
GdkColor *normal_color;
GdkColor *selected_color;
GdkWindowState state;
@@ -3759,6 +3759,10 @@ paint_decorated_window (GtkStyle *style,
state = gdk_window_get_state (window);
+ gtk_widget_style_get (widget,
+ "decoration-corner-radius", &radius,
+ NULL);
+
cr = gdk_cairo_create (window);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 645fe3d..d404cea 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -981,6 +981,13 @@ gtk_window_class_init (GtkWindowClass *klass)
0, G_MAXINT,
20, GTK_PARAM_READWRITE));
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_double ("decoration-corner-radius",
+ P_("Decoration corner radius"),
+ P_("Decoration corner radius"),
+ 0, G_MAXDOUBLE,
+ 5.0, GTK_PARAM_READWRITE));
+
/**
* GtkWindow:client-side-drop-shadows:
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]