Files
gitx/Images/rewindImage.pdf
Nathan Kinsinger 4fad6b60a3 Improve search UI
Previously searching would filter the commits in the commit tableview to only show the commits that matched the search. However the context of where those commits exist in the history is lost.

With this patch all the commits are shown but the commits that match the search are highlighted with a light blue background. In addition there is a forward/back button to step through the matches.

A new search controller:
    - keeps track of the matching results
    - finds the next or previous result
    - displays the number of matches found or "Not found"
    - shows/hides the # of matches text and the next/last stepper button
    - shows a small bezel style window with a rewind icon indicating that the selection has cycled (pressing next when at the last match or previous when at the first)
    - sets up the search predicate which covers Subject, Author and SHA (previously this was three different searches)
    - stores search results in an NSIndexSet to make finding if a row is in the set faster (needed at drawing time)

Highlighting of search result rows is done in PBCommitList -drawRow:clipRect:

PBGitTextFieldCell is a subclass of NSTextFieldCell that disables the cell's selection highlighting.

Supporting Find Next and Find Previous (cmd-g and cmd-shift-g) menu commands required changing the action method of the menu items because NSTextFields (seem to) actively disable items in the Find menu.

rewindImage.pdf created by Nathan Kinsinger
2010-09-12 19:32:36 -06:00

7.6 KiB