[gtk: 1/3] emojichooser: Add .emoji-searchbar style class




commit 90355c0b279b0008e9008fcadf83058c343df194
Author: nana-4 <hnmaigo gmail com>
Date:   Sat Dec 12 16:32:27 2020 +0900

    emojichooser: Add .emoji-searchbar style class
    
    Similar to .emoji-toolbar, it would be nice to have this for styling.

 gtk/gtkemojichooser.c     |  4 ++++
 gtk/ui/gtkemojichooser.ui | 16 ++++++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index 11bf196e0a..6625599942 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -54,6 +54,8 @@
  * # CSS nodes
  * |[<!-- language="plain" -->
  * popover
+ * ├── box.emoji-searchbar
+ * │   ╰── entry.search
  * ╰── box.emoji-toolbar
  *     ├── button.image-button.emoji-section
  *     ├── ...
@@ -63,6 +65,8 @@
  * Every #GtkEmojiChooser consists of a main node called popover.
  * The contents of the popover are largely implementation defined
  * and supposed to inherit general styles.
+ * The top searchbar used to search emoji and gets the .emoji-searchbar
+ * style class itself.
  * The bottom toolbar used to switch between different emoji categories
  * consists of buttons with the .emoji-section style class and gets the
  * .emoji-toolbar style class itself.
diff --git a/gtk/ui/gtkemojichooser.ui b/gtk/ui/gtkemojichooser.ui
index cb8cb6fa1f..823fd026d5 100644
--- a/gtk/ui/gtkemojichooser.ui
+++ b/gtk/ui/gtkemojichooser.ui
@@ -8,9 +8,17 @@
       <object class="GtkBox" id="box">
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkSearchEntry" id="search_entry">
-            <signal name="search-changed" handler="search_changed"/>
-            <signal name="stop-search" handler="stop_search"/>
+          <object class="GtkBox">
+            <style>
+              <class name="emoji-searchbar"/>
+            </style>
+            <child>
+              <object class="GtkSearchEntry" id="search_entry">
+                <property name="hexpand">1</property>
+                <signal name="search-changed" handler="search_changed"/>
+                <signal name="stop-search" handler="stop_search"/>
+              </object>
+            </child>
           </object>
         </child>
         <child>
@@ -211,7 +219,7 @@
                     <child>
                       <object class="GtkBox">
                         <style>
-                          <class name="emoji-toolbar" />
+                          <class name="emoji-toolbar"/>
                         </style>
                         <child>
                           <object class="GtkButton" id="recent.button">


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