[Xfce4-commits] [xfce/thunar] 02/02: move all .css to one place: thunar-application

noreply at xfce.org noreply at xfce.org
Sat Sep 23 22:07:37 CEST 2017


This is an automated email from the git hooks/post-receive script.

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/thunar.

commit ffaeb4833d7bdabded61b35caeb1a061e4f3487d
Author: Alexander Schwinn <acs82 at gmx.de>
Date:   Sat Sep 23 00:20:33 2017 +0200

    move all .css to one place: thunar-application
---
 thunar/thunar-application.c    |  9 ++++++---
 thunar/thunar-shortcuts-pane.c | 13 ++-----------
 thunar/thunar-standard-view.c  | 13 ++-----------
 3 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index c974713..94928e0 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -577,9 +577,12 @@ thunar_application_load_css (void)
 
   css_provider = gtk_css_provider_new ();
 
-  /* For the pathbar-buttons any margin looks ugly, so we overwrite "margin-right" of the used theme with 0.                                */
-  /* The method "gtk_widget_set_margin_right" cannot be used since style-margin is prioritized over default widget-margin by gtk3. */
-  gtk_css_provider_load_from_data (css_provider, " .path-bar-button { margin-right: 0; }", -1, NULL);
+                                                 /* For the pathbar-buttons any margin looks ugly*/
+  gtk_css_provider_load_from_data (css_provider, ".path-bar-button { margin-right: 0; }"
+
+                                                 /* remove extra border between side pane and view */
+                                                 ".shortcuts-pane { border-right-width: 0px; }"
+                                                 ".standard-view { border-left-width: 0px; }", -1, NULL);
   screen = gdk_screen_get_default ();
   gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
   g_object_unref (css_provider);
diff --git a/thunar/thunar-shortcuts-pane.c b/thunar/thunar-shortcuts-pane.c
index 93557bc..aad860e 100644
--- a/thunar/thunar-shortcuts-pane.c
+++ b/thunar/thunar-shortcuts-pane.c
@@ -163,8 +163,6 @@ thunar_shortcuts_pane_side_pane_init (ThunarSidePaneIface *iface)
 static void
 thunar_shortcuts_pane_init (ThunarShortcutsPane *shortcuts_pane)
 {
-  GtkCssProvider *provider;
-
   /* setup the action group for the shortcuts actions */
   shortcuts_pane->action_group = gtk_action_group_new ("ThunarShortcutsPane");
   gtk_action_group_set_translation_domain (shortcuts_pane->action_group, GETTEXT_PACKAGE);
@@ -181,15 +179,8 @@ thunar_shortcuts_pane_init (ThunarShortcutsPane *shortcuts_pane)
   gtk_container_add (GTK_CONTAINER (shortcuts_pane), shortcuts_pane->view);
   gtk_widget_show (shortcuts_pane->view);
 
-  /* remove extra border between side pane and view */
-  provider = gtk_css_provider_new ();
-
-  gtk_css_provider_load_from_data (provider, ".frame { border-right-width: 0px; }", -1, NULL);
-  gtk_style_context_add_provider (
-    GTK_STYLE_CONTEXT (gtk_widget_get_style_context (GTK_WIDGET (shortcuts_pane))),
-    GTK_STYLE_PROVIDER (provider),
-    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  g_object_unref (provider);
+  /* add widget to css class */
+  gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (shortcuts_pane)), "shortcuts-pane");
 
   /* connect the "shortcut-activated" signal */
   g_signal_connect_swapped (G_OBJECT (shortcuts_pane->view), "shortcut-activated", G_CALLBACK (thunar_navigator_change_directory), shortcuts_pane);
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 04e2a3d..3e8a5b0 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -635,8 +635,6 @@ thunar_standard_view_view_init (ThunarViewIface *iface)
 static void
 thunar_standard_view_init (ThunarStandardView *standard_view)
 {
-  GtkCssProvider *provider;
-
   standard_view->priv = THUNAR_STANDARD_VIEW_GET_PRIVATE (standard_view);
 
   /* allocate the scroll_to_files mapping (directory GFile -> first visible child GFile) */
@@ -737,15 +735,8 @@ thunar_standard_view_init (ThunarStandardView *standard_view)
   g_signal_connect_after (G_OBJECT (standard_view), "size-allocate",
                           G_CALLBACK (thunar_standard_view_size_allocate), NULL);
 
-  /* remove extra border between side pane and view */
-  provider = gtk_css_provider_new ();
-
-  gtk_css_provider_load_from_data (provider, ".frame { border-left-width: 0px; }", -1, NULL);
-  gtk_style_context_add_provider (
-    GTK_STYLE_CONTEXT (gtk_widget_get_style_context (GTK_WIDGET (standard_view))),
-    GTK_STYLE_PROVIDER (provider),
-    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-  g_object_unref (provider);
+  /* add widget to css class */
+  gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (standard_view)), "standard-view");
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list