diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2010-11-16 13:27:37 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2010-12-15 22:28:47 +0800 |
commit | 43a776e85d1fd602ef28756da4a5cc6e4fed40f9 (patch) | |
tree | 29e6e426ac2f8cedef6177bb0b27b504125aba32 /src | |
parent | f6ffd608f887ede6e39d03aff38c6d43682fd231 (diff) | |
download | gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar.gz gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar.bz2 gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar.lz gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar.xz gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.tar.zst gsoc2013-epiphany-43a776e85d1fd602ef28756da4a5cc6e4fed40f9.zip |
Port to gtk+ master's GtkStyleContext
Updates all our uses of GtkStyle stuff to the newer GtkStyleContext API.
ephy-web-view porting done by Matthias Clasen <mclasen@redhat.com>
Bug #636501
Diffstat (limited to 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 3 | ||||
-rw-r--r-- | src/ephy-find-toolbar.c | 4 | ||||
-rw-r--r-- | src/ephy-notebook.c | 28 |
3 files changed, 20 insertions, 15 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index f6a432f93..ebe9ac320 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -269,8 +269,7 @@ ephy_bookmark_action_sync_icon (GtkAction *action, if (pixbuf == NULL && icon_location == NULL) { - pixbuf = gtk_widget_render_icon (proxy, EPHY_STOCK_BOOKMARK, - GTK_ICON_SIZE_MENU, NULL); + pixbuf = gtk_widget_render_icon_pixbuf (proxy, EPHY_STOCK_BOOKMARK, GTK_ICON_SIZE_MENU); } gtk_image_set_from_pixbuf (icon, pixbuf); diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index a3ebd9c40..14c6c9da9 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -127,7 +127,7 @@ set_status_notfound_cb (EphyFindToolbar *toolbar) priv = toolbar->priv; pango_desc = pango_font_description_new (); - gtk_widget_modify_font (priv->status_label, pango_desc); + gtk_widget_override_font (priv->status_label, pango_desc); pango_font_description_free (pango_desc); priv->source_id = 0; @@ -154,7 +154,7 @@ set_status (EphyFindToolbar *toolbar, pango_desc = pango_font_description_new (); pango_font_description_set_weight (pango_desc, PANGO_WEIGHT_BOLD); - gtk_widget_modify_font (priv->status_label, pango_desc); + gtk_widget_override_font (priv->status_label, pango_desc); pango_font_description_free (pango_desc); gtk_widget_error_bell (GTK_WIDGET (priv->window)); diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index b9a2e240c..e06bae075 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -160,15 +160,6 @@ ephy_notebook_class_init (EphyNotebookClass *klass) container_class->remove = ephy_notebook_remove; notebook_class->insert_page = ephy_notebook_insert_page; - - gtk_rc_parse_string ("style \"ephy-tab-close-button-style\"\n" - "{\n" - "GtkWidget::focus-padding = 0\n" - "GtkWidget::focus-line-width = 0\n" - "xthickness = 0\n" - "ythickness = 0\n" - "}\n" - "widget \"*.ephy-tab-close-button\" style \"ephy-tab-close-button-style\""); signals[TAB_CLOSE_REQUEST] = g_signal_new ("tab-close-request", @@ -564,14 +555,15 @@ tab_label_style_set_cb (GtkWidget *hbox, { PangoFontMetrics *metrics; PangoContext *context; + GtkStyleContext *style; GtkWidget *button; int char_width, h, w; context = gtk_widget_get_pango_context (hbox); + style = gtk_widget_get_style_context (hbox); metrics = pango_context_get_metrics (context, - gtk_widget_get_style (hbox)->font_desc, + gtk_style_context_get_font (style, GTK_STATE_FLAG_ACTIVE), pango_context_get_language (context)); - char_width = pango_font_metrics_get_approximate_digit_width (metrics); pango_font_metrics_unref (metrics); @@ -590,6 +582,7 @@ build_tab_label (EphyNotebook *nb, EphyEmbed *embed) { GtkWidget *hbox, *label, *close_button, *image, *spinner, *icon; EphyWebView *view; + GtkCssProvider *provider; /* set hbox spacing and label padding (see below) so that there's an * equal amount of space around the label */ @@ -623,6 +616,19 @@ build_tab_label (EphyNotebook *nb, EphyEmbed *embed) gtk_widget_set_name (close_button, "ephy-tab-close-button"); + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, + "#ephy-tab-close-button {" + " -GtkWidget-focus-padding: 0;" + " -GtkWidget-focus-line-width: 0;" + " margin: 0; }", + -1, NULL); + + gtk_style_context_add_provider (gtk_widget_get_style_context (close_button), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (provider); + image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); gtk_widget_set_tooltip_text (close_button, _("Close tab")); g_signal_connect (close_button, "clicked", |