Attached is a patch that restructures the find code to let me avoid
using a JLabel to retrieve the status and share your code for compiling
the regex, not repeating the same search etc. I think it's an
improvement to have the UI doing less. What do you think?
Matt.
i think our current dialog sucks ;-)
i think you might not find it a particularly hard sell to just get us to
use your Firefox-style search bar in Terminator as the only interface...
> Matt.
>
>
> [1] http://matt.hillsdon.net/pb/2009-06-03/findBar.png
--
Elliott Hughes, http://www.jessies.org/~enh/
It doesn't come for free unfortunately because I've implemented it in
SWT. I don't really want Swing widgets inside Eclipse, it just looks
weird [1]. The patch moving more code into the FindHighlighter should
make it easier to play with different UI though.
You do lose some terminal space when the find bar is active. I thought
that a worthwhile trade for it being really obvious when a find is
active and previous/next being more prominent.
Matt.
[1] More so than it should on Linux because the GTK LAF seems less than
stable.
that's a pity.
> You do lose some terminal space when the find bar is active. I thought
> that a worthwhile trade for it being really obvious when a find is active
> and previous/next being more prominent.
that (and the fact that a dialog is just a few oft-hammered out lines of
code) was the original thinking behind the dialog. in practice, the dialog
appears right on top of your terminal and often needs to be moved before
you can carry on working. Evergreen and Firefox both "steal" space, but i
think it works better in practice.
> Matt.
>
>
>
> [1] More so than it should on Linux because the GTK LAF seems less than
> stable.
--
Elliott Hughes, http://www.jessies.org/~enh/
Yes. I might get the time to look at doing something similar for
Terminator later, though my Swing is pretty rusty. What do you make of
the patch on my original mail?
Thanks,
Matt.
do you actually need "clear" as a separate operation? if i replaced JLabel
with EStatusBar (thus removing the " " hack, and making clearStatus
equivalent to setStatus("", false)), would that be sufficient?
--elliott
> Thanks,
>
>
> Matt.
I would be fine with the smaller interface FindStatusDisplay { void
setStatus(message, isError) }. My current implementation doesn't even
use isError yet, though it should.
EStatusBar looks like it might change the font (size?), not sure whether
that's a problem. Better to have the " " somewhere with a comment
though (as in EStatusBar), I only preserved that behavior by default,
not through understanding the reason for it. Perhaps it would be
obvious if I did more Swing...
Matt.
cool. i'll go with that then.
> EStatusBar looks like it might change the font (size?), not sure whether
> that's a problem.
yeah, i've broken it into ELabel (which is just a non-broken JLabel) and
EStatusBar (which chooses a font appropriate for a status bar, which isn't
the same as the regular label font on all platforms; generally smaller).
there are a few other places (in other projects) where i can now stop
manually messing about with " ", so that's a good thing all round.
> Better to have the " " somewhere with a comment though
> (as in EStatusBar), I only preserved that behavior by default,
> not through understanding the reason for it. Perhaps it would be obvious
> if I did more Swing...
the "" versus " " is a well-known Swing JLabel gotcha. (i assume you've
already read the comment.)
Matt.
d'oh. thanks, committed. hopefully Java 6 will be the default in Mac OS
10.6; i'm getting sick of this.