[gnome-mud] Tweak mud input CSS workaround better



commit d1a5630633d1e6714ea2ffa65739cb768d9be50a
Author: Mart Raudsepp <leio gentoo org>
Date:   Sun Jan 6 18:32:05 2019 +0200

    Tweak mud input CSS workaround better
    
    Don't set the CSS name on the stack in C code, as that might affect
    regular theme styling of stacks. Instead set a class on the
    GtkScrolledWindow in the UI file, have that class name be namespaced
    and apply the workaround based on that.

 data/style.css        | 2 +-
 src/mud-input-view.c  | 2 --
 src/mud-input-view.ui | 3 +++
 3 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/data/style.css b/data/style.css
index 1bc42b1..1a4f707 100644
--- a/data/style.css
+++ b/data/style.css
@@ -1,3 +1,3 @@
-mud-input-view scrollbar.vertical slider {
+scrolledwindow.org-gnome-MUD scrollbar.vertical slider {
   min-height: 10px;
 }
diff --git a/src/mud-input-view.c b/src/mud-input-view.c
index ca97ee2..4ab1b02 100644
--- a/src/mud-input-view.c
+++ b/src/mud-input-view.c
@@ -145,8 +145,6 @@ mud_input_view_class_init (MudInputViewClass *klass)
   gtk_widget_class_bind_template_child (widget_class, MudInputView, scrolled_text_view);
   gtk_widget_class_bind_template_child (widget_class, MudInputView, text_view);
   gtk_widget_class_bind_template_child (widget_class, MudInputView, password_entry);
-
-  gtk_widget_class_set_css_name (widget_class, "mud-input-view");
 }
 
 static void
diff --git a/src/mud-input-view.ui b/src/mud-input-view.ui
index d851ac8..8fb6f48 100644
--- a/src/mud-input-view.ui
+++ b/src/mud-input-view.ui
@@ -8,6 +8,9 @@
     <property name="interpolate-size">true</property>
     <child>
       <object class="GtkScrolledWindow" id="scrolled_text_view">
+        <style>
+          <class name="org-gnome-MUD"/>
+        </style>
         <property name="visible">true</property>
         <property name="max-content-height">200</property><!-- TODO: Make dynamic based on window size? -->
         <property name="propagate-natural-height">true</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]