~scoopta/wofi#196: 
Is it possible to style (or at least hide) the search bar magnifier icon?

I'm on HiDPI and it shows super tiny. I've managed to style everything else except for this and I don't find anything on the manuals.

What's the css identifyer for it? Thank you.

Status
RESOLVED IMPLEMENTED
Submitter
~zeioth
Assigned to
No-one
Submitted
2 years ago
Updated
6 months ago
Labels
No labels applied.

~qazer2687 10 months ago

+1, I'd like to remove this icon.

~qazer2687 10 months ago

I've found from another ticket that you can use the CSS below to style it:

#input:first-child > :nth-child(1) {

}

~zeioth 10 months ago

yes, this cannot be fixed unless GTK implement proper HiDPI support, which seems they don't have any intention to do atm.

Workaround for this issue here: https://todo.sr.ht/~scoopta/wofi/179

~keinr 8 months ago*

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");

~scoopta 6 months ago

Hmmmmm, that might be worth adding as an option. I don't LOVE the idea of changing it for everyone but I do like the idea of having an option for it.

~scoopta REPORTED IMPLEMENTED 6 months ago*

Added the config option use_search_box which defaults to true in 96bb7a18c2b0. If you set it to false in your config or with -Duse_search_box=false it will use a regular entry.

Register here or Log in to comment, or comment via email.