diff options
author | Wolfgang Ulbrich <[email protected]> | 2016-01-13 15:15:35 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2016-01-13 15:15:35 +0100 |
commit | 3b7b4cfa969402c5cc9e45369f552729f2b65308 (patch) | |
tree | 610589db57c82fb63f5984d28b3009eb2c0cbb5a /src/caja-notebook.c | |
parent | 3c5a4ef68906a73850fa2ffe403cfcd37dc31ff9 (diff) | |
parent | 1befe8ddf08c12b5c926d269b31d270fb94b9c3e (diff) | |
download | caja-3b7b4cfa969402c5cc9e45369f552729f2b65308.tar.bz2 caja-3b7b4cfa969402c5cc9e45369f552729f2b65308.tar.xz |
Merge pull request #498 from mate-desktop/dev-GtkStyleContext
port to gtk_style_context and other fixes
Diffstat (limited to 'src/caja-notebook.c')
-rw-r--r-- | src/caja-notebook.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/caja-notebook.c b/src/caja-notebook.c index b5b6420e..035ef769 100644 --- a/src/caja-notebook.c +++ b/src/caja-notebook.c @@ -82,6 +82,7 @@ caja_notebook_class_init (CajaNotebookClass *klass) notebook_class->insert_page = caja_notebook_insert_page; +#if !GTK_CHECK_VERSION (3, 0, 0) gtk_rc_parse_string ("style \"caja-tab-close-button-style\"\n" "{\n" "GtkWidget::focus-padding = 0\n" @@ -90,6 +91,7 @@ caja_notebook_class_init (CajaNotebookClass *klass) "ythickness = 0\n" "}\n" "widget \"*.caja-tab-close-button\" style \"caja-tab-close-button-style\""); +#endif signals[TAB_CLOSE_REQUEST] = g_signal_new ("tab-close-request", @@ -239,6 +241,31 @@ button_press_cb (CajaNotebook *notebook, static void caja_notebook_init (CajaNotebook *notebook) { +#if GTK_CHECK_VERSION (3, 0, 0) + static const gchar css_custom[] = + "#caja-tab-close-button {" + " -GtkWidget-focus-padding : 0;" + " -GtkWidget-focus-line-width: 0;" + " xthickness: 0;" + " ythickness: 0;" + "}"; + + GError *error = NULL; + GtkCssProvider *provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, css_custom, -1, &error); + + if (error != NULL) { + g_warning ("Can't parse CajaNotebook's CSS custom description: %s\n", error->message); + g_error_free (error); + } else { + gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (notebook)), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + + g_object_unref (provider); +#endif + gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); |