summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-08-31 19:10:45 (GMT)
committerMatthias Clasen <mclasen@redhat.com>2012-08-31 19:12:05 (GMT)
commit41a79d6a35d18e9293fb6326cfac803d92b61f81 (patch)
treea1ce183d97af94cddd51b479b2c84433a7544096
parentcc6734e5c12f859330eb8a8f4b67cfb854cff8c4 (diff)
downloadgnome-control-center-41a79d6a35d18e9293fb6326cfac803d92b61f81.zip
gnome-control-center-41a79d6a35d18e9293fb6326cfac803d92b61f81.tar.xz
Fix big editable labels
The code we used to match the entry and label font size and weight broke down with the latest CSS improvements in GTK+. Use a new GtkEntry api for this instead. The GTK+ requirement has been bumped to 3.5.13.
-rw-r--r--configure.ac2
-rw-r--r--shell/cc-editable-entry.c36
2 files changed, 2 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index 4cc8619..ca4fa90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,7 @@ dnl Check that we meet the dependencies
dnl ==============================================
GLIB_REQUIRED_VERSION=2.31.0
-GTK_REQUIRED_VERSION=3.5.8
+GTK_REQUIRED_VERSION=3.5.13
PA_REQUIRED_VERSION=2.0
CANBERRA_REQUIRED_VERSION=0.13
GDKPIXBUF_REQUIRED_VERSION=2.23.0
diff --git a/shell/cc-editable-entry.c b/shell/cc-editable-entry.c
index 297d7eb..28317c0 100644
--- a/shell/cc-editable-entry.c
+++ b/shell/cc-editable-entry.c
@@ -147,38 +147,6 @@ cc_editable_entry_get_selectable (CcEditableEntry *e)
return e->priv->selectable;
}
-static void
-update_entry_font (GtkWidget *widget,
- CcEditableEntry *e)
-{
- CcEditableEntryPrivate *priv = e->priv;
- PangoFontDescription *desc;
- GtkStyleContext *style;
- gint size;
-
- if (!priv->weight_set && !priv->scale_set)
- return;
-
- g_signal_handlers_block_by_func (widget, update_entry_font, e);
-
- gtk_widget_override_font (widget, NULL);
-
- style = gtk_widget_get_style_context (widget);
- desc = pango_font_description_copy
- (gtk_style_context_get_font (style, gtk_widget_get_state_flags (widget)));
-
- if (priv->weight_set)
- pango_font_description_set_weight (desc, priv->weight);
- if (priv->scale_set) {
- size = pango_font_description_get_size (desc);
- pango_font_description_set_size (desc, priv->scale * size);
- }
- gtk_widget_override_font (widget, desc);
-
- pango_font_description_free (desc);
-
- g_signal_handlers_unblock_by_func (widget, update_entry_font, e);
-}
static void
update_fonts (CcEditableEntry *e)
@@ -203,10 +171,9 @@ update_fonts (CcEditableEntry *e)
label = gtk_bin_get_child (GTK_BIN (priv->button));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
+ gtk_entry_set_attributes (priv->entry, attrs);
pango_attr_list_unref (attrs);
-
- update_entry_font ((GtkWidget *)priv->entry, e);
}
void
@@ -526,7 +493,6 @@ cc_editable_entry_init (CcEditableEntry *e)
g_signal_connect (priv->entry, "activate", G_CALLBACK (entry_activated), e);
g_signal_connect (priv->entry, "focus-out-event", G_CALLBACK (entry_focus_out), e);
g_signal_connect (priv->entry, "key-press-event", G_CALLBACK (entry_key_press), e);
- g_signal_connect (priv->entry, "style-updated", G_CALLBACK (update_entry_font), e);
g_signal_connect (gtk_bin_get_child (GTK_BIN (priv->button)), "size-allocate", G_CALLBACK (update_button_padding), e);
gtk_container_add (GTK_CONTAINER (e), (GtkWidget*)priv->notebook);