~keinr


#196 Is it possible to style (or at least hide) the search bar magnifier icon? 9 months ago

Comment by ~keinr on ~scoopta/wofi

I tried qazer's solution, and it looks like it is possible to make the looking glass disappear by doing: #input:first-child > :nth-child(1) { color: ; }

However this doesn't remove it. I did some hacking around the source and discovered, on line 2016 in wofi.c: entry = gtk_search_entry_new() According to GTK's docs: "[A search entry] will show an inactive symbolic “find” icon when the search entry is empty, and a symbolic “clear” icon when there is text. Clicking on the “clear” icon will empty the search entry." https://docs.gtk.org/gtk3/class.SearchEntry.html

I substituted entry = gtk_search_entry_new() for entry = gtk_entry_new(), compiled, and voila! No icon, and no "clear text" icon. Here's the patch:

--- wofi.c	2024-06-05 22:09:37.677488083 -0800
+++ wofi_mod.c	2024-06-05 22:08:50.919585606 -0800
@@ -2013,7 +2013,7 @@
 	outer_box = gtk_box_new(outer_orientation, 0);
 	gtk_widget_set_name(outer_box, "outer-box");
 	gtk_container_add(GTK_CONTAINER(window), outer_box);
-	entry = gtk_search_entry_new();
+	entry = gtk_entry_new();
 	g_signal_connect(entry, "size-allocate", G_CALLBACK(widget_allocate), NULL);

 	gtk_widget_set_name(entry, "input");