From a13a57322818b040f990970d545d288b5784eaae Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Sat, 9 Dec 2017 01:06:28 -0800 Subject: [PATCH] xed-searchbar: Fix the size of the searchbar close button The theming for this changed in gtk3.20+. Get it back to the proper size and theme it in xed-style.css instead of hard coding it. --- xed/resources/css/xed-style.css | 6 ++++++ xed/xed-searchbar.c | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xed/resources/css/xed-style.css b/xed/resources/css/xed-style.css index a910576..1807e87 100644 --- a/xed/resources/css/xed-style.css +++ b/xed/resources/css/xed-style.css @@ -5,3 +5,9 @@ .xed-map-frame:dir(rtl) border { border-width: 0 1px 0 0; } + +.xed-searchbar .close-button { + padding: 0; + min-height: 0; + min-width: 0; +} diff --git a/xed/xed-searchbar.c b/xed/xed-searchbar.c index 94b33c2..9d705a6 100755 --- a/xed/xed-searchbar.c +++ b/xed/xed-searchbar.c @@ -659,11 +659,8 @@ xed_searchbar_init (XedSearchbar *searchbar) { GtkWidget *content; GtkSizeGroup *size_group; - GtkStyleContext *context; - GtkCssProvider *provider; GtkBuilder *builder; gchar *root_objects[] = { "searchbar_content", NULL }; - const gchar *data = ".button {padding: 0;}"; searchbar->priv = XED_SEARCHBAR_GET_PRIVATE (searchbar); @@ -709,10 +706,7 @@ xed_searchbar_init (XedSearchbar *searchbar) gtk_label_set_mnemonic_widget (GTK_LABEL (searchbar->priv->search_label), searchbar->priv->search_entry); gtk_label_set_mnemonic_widget (GTK_LABEL (searchbar->priv->replace_label), searchbar->priv->replace_entry); - provider = gtk_css_provider_new (); - context = gtk_widget_get_style_context (searchbar->priv->close_button); - gtk_css_provider_load_from_data (provider, data, -1, NULL); - gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_class (gtk_widget_get_style_context (searchbar->priv->close_button), "close-button"); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); gtk_size_group_add_widget (size_group, GTK_WIDGET (searchbar->priv->find_button));