[gedit] Remove hack to collapse the right border.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Remove hack to collapse the right border.
- Date: Fri, 23 Dec 2011 19:34:54 +0000 (UTC)
commit 8c7f5cf43b8d2caf46e37b377de26e867db54cf9
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Dec 23 20:36:08 2011 +0100
Remove hack to collapse the right border.
This is now managed in gnome-themes-standard.
gedit/gedit-multi-notebook.c | 36 ------------------------
gedit/gedit-multi-notebook.h | 3 --
gedit/gedit-notebook.c | 62 ------------------------------------------
gedit/gedit-notebook.h | 3 --
gedit/gedit-window.c | 17 +-----------
5 files changed, 1 insertions(+), 120 deletions(-)
---
diff --git a/gedit/gedit-multi-notebook.c b/gedit/gedit-multi-notebook.c
index af18848..55a172e 100644
--- a/gedit/gedit-multi-notebook.c
+++ b/gedit/gedit-multi-notebook.c
@@ -36,7 +36,6 @@ struct _GeditMultiNotebookPrivate
GeditTab *active_tab;
guint removing_notebook : 1;
- guint collapse : 1;
};
enum
@@ -452,7 +451,6 @@ add_notebook (GeditMultiNotebook *mnb,
GtkAllocation allocation;
GtkWidget *active_notebook = mnb->priv->active_notebook;
gint active_nb_pos;
- gboolean collapse_new_notebook = FALSE;
paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show (paned);
@@ -475,26 +473,11 @@ add_notebook (GeditMultiNotebook *mnb,
gtk_paned_set_position (GTK_PANED (paned),
allocation.width / 2);
- /* check if we need to uncollapse the active notebook */
- if (active_notebook == g_list_last (mnb->priv->notebooks)->data &&
- mnb->priv->collapse)
- {
- collapse_new_notebook = TRUE;
- gedit_notebook_collapse_border (GEDIT_NOTEBOOK (active_notebook),
- FALSE);
- }
-
active_nb_pos = g_list_index (mnb->priv->notebooks,
active_notebook);
mnb->priv->notebooks = g_list_insert (mnb->priv->notebooks,
notebook,
active_nb_pos + 1);
-
- if (collapse_new_notebook)
- {
- gedit_notebook_collapse_border (GEDIT_NOTEBOOK (notebook),
- TRUE);
- }
}
gtk_widget_show (notebook);
@@ -530,10 +513,6 @@ remove_notebook (GeditMultiNotebook *mnb,
else
{
new_notebook = GTK_WIDGET (mnb->priv->notebooks->data);
-
- /* we must check if we need to collapse the new last notebook */
- gedit_notebook_collapse_border (GEDIT_NOTEBOOK (current->prev->data),
- mnb->priv->collapse);
}
parent = gtk_widget_get_parent (notebook);
@@ -903,21 +882,6 @@ gedit_multi_notebook_next_notebook (GeditMultiNotebook *mnb)
}
void
-gedit_multi_notebook_collapse_notebook_border (GeditMultiNotebook *mnb,
- gboolean collapse)
-{
- GeditNotebook *notebook;
-
- g_return_if_fail (GEDIT_IS_MULTI_NOTEBOOK (mnb));
-
- mnb->priv->collapse = (collapse != FALSE);
-
- notebook = GEDIT_NOTEBOOK (g_list_last (mnb->priv->notebooks)->data);
-
- gedit_notebook_collapse_border (notebook, collapse);
-}
-
-void
gedit_multi_notebook_foreach_notebook (GeditMultiNotebook *mnb,
GtkCallback callback,
gpointer callback_data)
diff --git a/gedit/gedit-multi-notebook.h b/gedit/gedit-multi-notebook.h
index d954aad..be3c253 100644
--- a/gedit/gedit-multi-notebook.h
+++ b/gedit/gedit-multi-notebook.h
@@ -124,9 +124,6 @@ void gedit_multi_notebook_remove_active_notebook (GeditMultiNotebook *mnb);
void gedit_multi_notebook_previous_notebook (GeditMultiNotebook *mnb);
void gedit_multi_notebook_next_notebook (GeditMultiNotebook *mnb);
-void gedit_multi_notebook_collapse_notebook_border (GeditMultiNotebook *mnb,
- gboolean collapse);
-
void gedit_multi_notebook_foreach_notebook (GeditMultiNotebook *mnb,
GtkCallback callback,
gpointer callback_data);
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index 5e6b7db..92cf494 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -741,66 +741,4 @@ gedit_notebook_get_close_buttons_sensitive (GeditNotebook *nb)
return nb->priv->close_buttons_sensitive;
}
-static void
-remove_right_padding (GeditNotebook *nb)
-{
- GtkStyleContext *context;
- GtkBorder padding;
- gchar *modified_style;
- GError *error = NULL;
- const gchar style[] =
- ".notebook {\n"
- "padding: %d 0 %d %d;\n"
- "}";
-
- /* 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, padding.left);
-
- /* make it as small as possible */
- if (nb->priv->css == NULL)
- {
- nb->priv->css = gtk_css_provider_new ();
- }
-
- 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),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- }
- else
- {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
-
- g_free (modified_style);
-}
-
-void
-gedit_notebook_collapse_border (GeditNotebook *nb,
- gboolean collapse)
-{
- g_return_if_fail (GEDIT_IS_NOTEBOOK (nb));
-
- if (collapse)
- {
- remove_right_padding (nb);
- }
- /* if we made some modification put it back to the default state */
- else if (nb->priv->css != NULL)
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (nb));
- gtk_style_context_remove_provider (context,
- GTK_STYLE_PROVIDER (nb->priv->css));
- }
-}
-
/* ex:set ts=8 noet: */
diff --git a/gedit/gedit-notebook.h b/gedit/gedit-notebook.h
index e2765e7..7c81f83 100644
--- a/gedit/gedit-notebook.h
+++ b/gedit/gedit-notebook.h
@@ -120,9 +120,6 @@ void gedit_notebook_set_close_buttons_sensitive
gboolean gedit_notebook_get_close_buttons_sensitive
(GeditNotebook *nb);
-void gedit_notebook_collapse_border (GeditNotebook *nb,
- gboolean collapse);
-
G_END_DECLS
#endif /* GEDIT_NOTEBOOK_H */
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 5a2363d..854a63f 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -348,22 +348,7 @@ gedit_window_window_state_event (GtkWidget *widget,
g_settings_set_int (window->priv->window_settings, GEDIT_SETTINGS_WINDOW_STATE,
window->priv->window_state);
- if ((event->changed_mask &
- (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) != 0)
- {
- gboolean show;
-
- show = !(event->new_window_state &
- (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN));
-
- gedit_multi_notebook_collapse_notebook_border (window->priv->multi_notebook,
- !show);
- }
-
- if (GTK_WIDGET_CLASS (gedit_window_parent_class)->window_state_event)
- return GTK_WIDGET_CLASS (gedit_window_parent_class)->window_state_event (widget, event);
-
- return FALSE;
+ return GTK_WIDGET_CLASS (gedit_window_parent_class)->window_state_event (widget, event);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]