[metacity/wip/gtk-theme: 2/52] theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widget
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/wip/gtk-theme: 2/52] theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widget
- Date: Wed, 7 Jan 2015 12:34:34 +0000 (UTC)
commit f480ce345ac8667dfe9067e9add93f881e7ce353
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Dec 16 17:31:00 2012 -0500
theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widget
The style context of the widget is rarely what we want. We won't
fix this to be a MetaFrames style context yet; this just changes
the internal API.
https://bugzilla.gnome.org/show_bug.cgi?id=690317
src/ui/frames.c | 24 ++++++++++++----------
src/ui/preview-widget.c | 2 +-
src/ui/theme-viewer.c | 2 +-
src/ui/theme.c | 49 ++++++++++++----------------------------------
src/ui/theme.h | 16 +--------------
5 files changed, 29 insertions(+), 64 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index bfe468e..4fdf7ee 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -2531,17 +2531,19 @@ meta_frames_paint (MetaFrames *frames,
meta_prefs_get_button_layout (&button_layout);
- meta_theme_draw_frame_with_style (meta_theme_get_current (),
- frame->style,
- cr,
- type,
- flags,
- w, h,
- frame->layout,
- frame->text_height,
- &button_layout,
- button_states,
- mini_icon, icon);
+ meta_theme_draw_frame (meta_theme_get_current (),
+ frame->style,
+ cr,
+ type,
+ flags,
+ w,
+ h,
+ frame->layout,
+ frame->text_height,
+ &button_layout,
+ button_states,
+ mini_icon,
+ icon);
}
static void
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index 85f489a..39505e7 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -217,7 +217,7 @@ meta_preview_draw (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
meta_theme_draw_frame (preview->theme,
- widget,
+ gtk_widget_get_style_context (widget),
cr,
preview->type,
preview->flags,
diff --git a/src/ui/theme-viewer.c b/src/ui/theme-viewer.c
index e3922d4..351362c 100644
--- a/src/ui/theme-viewer.c
+++ b/src/ui/theme-viewer.c
@@ -1082,7 +1082,7 @@ run_theme_benchmark (void)
cr = cairo_create (pixmap);
meta_theme_draw_frame (global_theme,
- widget,
+ gtk_widget_get_style_context (widget),
cr,
META_FRAME_TYPE_NORMAL,
get_flags (widget),
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 61dee8d..c4e1abf 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5439,19 +5439,19 @@ meta_theme_get_title_scale (MetaTheme *theme,
}
void
-meta_theme_draw_frame_with_style (MetaTheme *theme,
- GtkStyleContext *style_gtk,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon)
+meta_theme_draw_frame (MetaTheme *theme,
+ GtkStyleContext *style_gtk,
+ cairo_t *cr,
+ MetaFrameType type,
+ MetaFrameFlags flags,
+ int client_width,
+ int client_height,
+ PangoLayout *title_layout,
+ int text_height,
+ const MetaButtonLayout *button_layout,
+ MetaButtonState button_states[META_BUTTON_TYPE_LAST],
+ GdkPixbuf *mini_icon,
+ GdkPixbuf *icon)
{
MetaFrameGeometry fgeom;
MetaFrameStyle *style;
@@ -5484,29 +5484,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
}
void
-meta_theme_draw_frame (MetaTheme *theme,
- GtkWidget *widget,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon)
-{
- meta_theme_draw_frame_with_style (theme, gtk_widget_get_style_context (widget),
- cr, type, flags,
- client_width, client_height,
- title_layout, text_height,
- button_layout, button_states,
- mini_icon, icon);
-}
-
-void
meta_theme_get_frame_borders (MetaTheme *theme,
MetaFrameType type,
int text_height,
diff --git a/src/ui/theme.h b/src/ui/theme.h
index 68adf12..6b08fea 100644
--- a/src/ui/theme.h
+++ b/src/ui/theme.h
@@ -1038,7 +1038,7 @@ double meta_theme_get_title_scale (MetaTheme *theme,
MetaFrameFlags flags);
void meta_theme_draw_frame (MetaTheme *theme,
- GtkWidget *widget,
+ GtkStyleContext *style_gtk,
cairo_t *cr,
MetaFrameType type,
MetaFrameFlags flags,
@@ -1051,20 +1051,6 @@ void meta_theme_draw_frame (MetaTheme *theme,
GdkPixbuf *mini_icon,
GdkPixbuf *icon);
-void meta_theme_draw_frame_with_style (MetaTheme *theme,
- GtkStyleContext *style_gtk,
- cairo_t *cr,
- MetaFrameType type,
- MetaFrameFlags flags,
- int client_width,
- int client_height,
- PangoLayout *title_layout,
- int text_height,
- const MetaButtonLayout *button_layout,
- MetaButtonState button_states[META_BUTTON_TYPE_LAST],
- GdkPixbuf *mini_icon,
- GdkPixbuf *icon);
-
void meta_theme_get_frame_borders (MetaTheme *theme,
MetaFrameType type,
int text_height,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]