CSS margin does not work for GtkTextView
CSS margin does not seem to work for GtkTextView, even though padding does work. Margin also does work fine through C functions like gtk_widget_set_margin_top
Example:
GtkWidget *window = gtk_application_window_new(GTK_APPLICATION(app));
GtkCssProvider *cssProvider = gtk_css_provider_new();
gtk_css_provider_load_from_path(cssProvider, "test.css", NULL);
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
GTK_STYLE_PROVIDER(cssProvider),
GTK_STYLE_PROVIDER_PRIORITY_USER);
GtkWidget *test = gtk_text_view_new();
//gtk_widget_set_margin_top(test, 8);
gtk_container_add(GTK_CONTAINER(window), test);
gtk_widget_show_all(GTK_WIDGET(window));
test.css
textview {
background-color: #555;
margin-top: 8px;
padding: 8px;
}
textview text {
background-color: transparent;
}