EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

Highlight search results so they can be found on the screen #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. search for something in command output
2.
3.

What is the expected output? What do you see instead?

Searching does work, but without highlighting it is difficult to find the
result on the screen.

What version of the product are you using? On what operating system?

0.710, Ubuntu Gusty, KDE

Please provide any additional information below.

Perhaps this is specific to my own messed up install, but I don't see
anything in the code that highlights search results in command output.  The
attached patch fixes it for me.

I'm sure the attached patch also makes it clear that I'm not a gtk programmer.

Original issue reported on code.google.com by mason.ch...@gmail.com on 13 Feb 2008 at 7:34

Attachments:

GoogleCodeExporter commented 9 years ago
The search area works by selecting the matching text, so you should see the same
effect as if you click and drag to select an area.

Do you have a custom GTK+ theme that might not be working?

Original comment by cgwalt...@gmail.com on 13 Feb 2008 at 8:14

GoogleCodeExporter commented 9 years ago
Well, I'm running KDE so I haven't customized gtk at all.  But, the selected 
text
doesn't look right at all ;)

Text I select in gvim and firefox works fine.

Original comment by mason.ch...@gmail.com on 13 Feb 2008 at 8:32

GoogleCodeExporter commented 9 years ago
Hm, it seems possible though that your distribution has installed something like
gtk-qt (http://freedesktop.org/wiki/Software/gtk-qt) which would change the GTK+
theme based on your Qt theme.

Can you attach a screenshot?

I'm guessing that selecting text (just click and drag) in the Hotwire text view
doesn't work too?

Original comment by cgwalt...@gmail.com on 13 Feb 2008 at 8:45

GoogleCodeExporter commented 9 years ago
Can you try running the attached test program?

If clicking and dragging doesn't seem to work, then something is wrong with the 
GTK+
theme or installation.

Original comment by cgwalt...@gmail.com on 13 Feb 2008 at 8:50

Attachments:

GoogleCodeExporter commented 9 years ago
I ran the gnome control center, and the themes were just plain corrupted.  
After some
fiddling and reinstalling of packages, selecting text works properly.

I do like the yellow to grab your attention, strictly speaking this is fixed 
here.

Original comment by mason.ch...@gmail.com on 13 Feb 2008 at 9:24

GoogleCodeExporter commented 9 years ago
I took a quick look at some other apps:

GEdit: GTK+ theme selection color for current match, and yellow for other 
matches
Firefox: Non-theme color (Green) for current, and has a separate "Highlight all"
button.  The non-theme color makes sense since web pages don't match toolkit 
theme
Eclipse: GTK+ theme selection color for current, no highlightin of other matches

I think a combination of the GEdit and Eclipse styles would make sense probably 
-
theme selection for current, yellow for others, with a button to toggle on/off 
others.  

It'd probably be good to think about adding regexp/case options to the search 
too.

The gedit code is in gedit/gedit/gedit-document.c, we might be able to 
translate that
to Python.

Original comment by cgwalt...@gmail.com on 14 Feb 2008 at 5:18

GoogleCodeExporter commented 9 years ago
Ok, here is a respin:

* current match is selected (just like before)
* All matches are yellow
* Button to toggle highlight all

This isn't the most efficient implementation around.  Highlight all duplicates 
the
searching.  The firefox highlight all button changes colors to indicate the 
current
state.  Mine isn't quite that cool.

Original comment by mason.ch...@gmail.com on 14 Feb 2008 at 3:00

Attachments:

GoogleCodeExporter commented 9 years ago
Wow, sounds great!  It seems that the patch got corrupted somehow, it appears 
to be 0
bytes?  

You might name the file ending in .patch since I think that'll help the issue 
tracker
pick up the right MIME type.

Original comment by cgwalt...@gmail.com on 14 Feb 2008 at 5:02

GoogleCodeExporter commented 9 years ago
Whoops, sorry about that, lets try the attachment again

Original comment by mason.ch...@gmail.com on 14 Feb 2008 at 5:07

Attachments:

GoogleCodeExporter commented 9 years ago
I've added this to SVN:

Committed r1065
    M   hotwire_ui/inlinesearch.py
r1065 = 417c7b224ee3fcbe586fb44fb61da7dc88ef8793 (git-svn)

I tweaked it a bit with these changes:

* Add some infrastructure for hooking up to GTK+ style changes so we can change 
the
tag color (it looks like GEdit uses GtkSourceView's functionality for this, but
currently we don't have a hard dep on GtkSourceView.  Perhaps we should..)
* Highlight state is slaved to gtk.CheckButton rather than a separate member
variable, fixes state synchronization
* Add gettext call _ around button name

Thanks a lot for this patch!

Original comment by cgwalt...@gmail.com on 14 Feb 2008 at 11:47