[gedit] Fix the notebook style to remove border when the window is maximized.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Fix the notebook style to remove border when the window is maximized.
- Date: Fri, 21 Jan 2011 16:57:45 +0000 (UTC)
commit 4178b0efef121967c1aa47c254030a767342b95e
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Jan 21 17:57:37 2011 +0100
Fix the notebook style to remove border when the window is maximized.
gedit/gedit-notebook.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index 88ca5c6..2e196f7 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -662,15 +662,22 @@ gedit_notebook_collapse_border (GeditNotebook *nb,
{
GtkStyleContext *context;
GError *error = NULL;
+ GtkBorder padding;
+ gchar *modified_style;
const gchar style[] =
- "* {\n"
- " padding-left: 0;\n"
- " padding-right: 0;\n"
+ ".notebook {\n"
+ " padding: %d 0 %d 0;\n"
"}";
g_return_if_fail (GEDIT_IS_NOTEBOOK (nb));
+ /* FIXME: find out a css like way to do this, right now padding-right/left
+ doesn't work */
context = gtk_widget_get_style_context (GTK_WIDGET (nb));
+ gtk_style_context_get_padding (context, gtk_style_context_get_state (context),
+ &padding);
+
+ modified_style = g_strdup_printf (style, padding.top, padding.bottom);
if (collapse)
{
@@ -680,7 +687,7 @@ gedit_notebook_collapse_border (GeditNotebook *nb,
nb->priv->css = gtk_css_provider_new ();
}
- if (gtk_css_provider_load_from_data (nb->priv->css, style, -1, &error))
+ if (gtk_css_provider_load_from_data (nb->priv->css, modified_style, -1, &error))
{
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (nb->priv->css),
@@ -697,6 +704,8 @@ gedit_notebook_collapse_border (GeditNotebook *nb,
gtk_style_context_remove_provider (context,
GTK_STYLE_PROVIDER (nb->priv->css));
}
+
+ g_free (modified_style);
}
/* ex:set ts=8 noet: */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]