1
0
mirror of https://github.com/git/git.git synced 2024-10-01 06:01:27 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Philipp A. Hartmann
c382fdd795 git-gui: if a background colour is set, set foreground colour as well
In several places, only the background colour is set to an explicit
value, sometimes even "white".  This does not work well with dark
colour themes.

This patch tries to set the foreground colour to "black" in those
situations, where an explicit background colour is set without defining
any foreground colour.

Signed-off-by: Philipp A. Hartmann <ph@sorgh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-05 23:47:11 -05:00
Shawn O. Pearce
704396bc2a Merge branch 'maint'
* maint:
  git-gui: Disable native platform text selection in "lists"

Conflicts:

	lib/browser.tcl
2007-09-16 23:15:21 -04:00
Shawn O. Pearce
3849bfba84 git-gui: Disable native platform text selection in "lists"
Sometimes we use a Tk text widget as though it were a listbox.
This happens typically when we want to show an icon to the left
of the text label or just when a text widget is generally a better
choice then the native listbox widget.

In these cases if we want the user to have control over the selection
we implement our own "in_sel" tag that shows the selected region
and we perform our own selection management in the background
via keybindings and mouse bindings.  In such uses we don't want
the user to be able to activate the native platform selection by
dragging their mouse through the text widget.  Doing so creates a
very confusing display and the user is left wondering what it may
mean to have two different types of selection in the same widget.

Tk doesn't allow us to delete the "sel" tag that it uses internally
to manage the native selection but it will allow us to make it
invisible by setting the tag to have the same display properties
as unselected text.  So long as we don't actually use the "sel"
tag for anything in code its effectively invisible.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-16 23:12:19 -04:00
Shawn O. Pearce
bba060462c git-gui: Make the tree browser also use lightgray selection
In 9adccb05 Matthijs Melchior changed our selection colors in the
main index/working directory file lists to use a lightgray as the
background color as this made the UI easier to read on all platforms.

When we did that change we missed doing also doing in the file
browser UI.  Doing so just makes the entire thing UI consistent.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-13 20:52:47 -04:00
Christian Stimming
1ac17950e9 Mark strings for translation.
The procedure [mc ...] will translate the strings through msgcat.
Strings must be enclosed in quotes, not in braces, because otherwise
xgettext cannot extract them properly, although on the Tcl side both
delimiters would work fine.

[jes: I merged the later patches to that end.]

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-09-02 16:54:48 +01:00
Shawn O. Pearce
dac7089263 git-gui: Use more modern looking icons in the tree browser
This is a replacement of all of the icons in our tree browser
window, as the prior icons just looked too 1980s Tk-ish.  The
icons used here are actually from a KDE themed look, so they
might actually be familiar to some users of git-gui.

Aside from using more modern looking icons we now have a special
icon for executable blobs, to make them stand out from the normal
non-executable blobs.  We also denote symlinks now with a different
icon, so they stand out from the other types of objects in the tree.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-29 23:44:52 -04:00
Shawn O. Pearce
8e891facbe git-gui: Allow users to browse any branch, not just the current one
We now allow users to pick which commit they want to browse through
our revision picking mega-widget.  This opens up in a dialog first,
and then opens a tree browser for that selected commit.  It is a very
simple approach and requires minimal code changes.

I also clarified the language a bit in the Repository menu, to show
that these actions will access files.  Just in case a user is not
quite sure what specific action they are looking for, but they know
they want some sort of file thing.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-18 01:39:27 -04:00
Shawn O. Pearce
85d2d59760 git-gui: Allow browser subcommand to start in subdirectory
Like our blame subcommand the browser subcommand now accepts both
a revision and a path, just a revision or just a path.  This way
the user can start the subcommand on any branch, or on any subtree.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-18 00:53:14 -04:00
Shawn O. Pearce
0a84b3d94f Merge branch 'maint'
* maint:
  git-gui: Don't linewrap within console windows
  git-gui: Correct ls-tree buffering problem in browser
2007-07-09 21:19:13 -04:00
Shawn O. Pearce
56e29f597c git-gui: Correct ls-tree buffering problem in browser
Our file browser was showing bad output as it did not properly buffer
a partial record when read from `ls-tree -z`.  This did not show up on
my Mac OS X system as most trees are small, the pipe buffers generally
big and `ls-tree -z` was generally fast enough that all data was ready
before Tcl started to read.  However on my Cygwin system one of my
production repositories had a large enough tree and packfile that it
took a couple of pipe buffers for `ls-tree -z` to complete its dump.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09 21:12:35 -04:00
Shawn O. Pearce
0b81261622 git-gui: Always use absolute path to all git executables
Rather than making the C library search for git every time we want
to execute it we now search for the main git wrapper at startup, do
symlink resolution, and then always use the absolute path that we
found to execute the binary later on.  This should save us some
cycles, especially on stat challenged systems like Cygwin/Win32.

While I was working on this change I also converted all of our
existing pipes ([open "| git ..."]) to use two new pipe wrapper
functions.  These functions take additional options like --nice
and --stderr which instructs Tcl to take special action, like
running the underlying git program through `nice` (if available)
or redirect stderr to stdout for capture in Tcl.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09 01:17:09 -04:00
Shawn O. Pearce
39fa2a983d git-gui: Save geometry before the window layout is damaged
Because Tk does not assure us the order that it will process
children in before it destroys the main toplevel we cannot safely
save our geometry data during a "bind . <Destroy>" event binding.
The geometry may have already changed as a result of a one or
more children being removed from the layout.  This was pointed
out in gitk by Mark Levedahl, and patched over there by commit
b6047c5a8166a71e01c6b63ebbb67c6894d95114.

So we now also use "wm protocol . WM_DELETE_WINDOW" to detect when
the window is closed by the user, and forward that close event to
our main do_quit routine.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-06-11 23:52:43 -04:00
Shawn O. Pearce
685caf9af6 git-gui: Convert blame to the "class" way of doing things
Our blame viewer code has historically been a mess simply
because the data for multiple viewers was all crammed into
a single pair of Tcl arrays.  This made the code hard to
read and even harder to maintain.

Now that we have a slightly better way of tracking the data
for our "meta-widgets" we can make use of it here in the
blame viewer to cleanup the code and make it easier to work
with long term.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-08 21:38:55 -04:00
Shawn O. Pearce
c74b6c66f0 git-gui: Convert browser, console to "class" format
Now that we have a slightly easier method of working with per-widget
data we should make use of that technique in our browser and console
meta-widgets, as both have a decent amount of information that they
store on a per-widget basis and our current approach of handling
it is difficult to follow.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-08 21:38:54 -04:00
Shawn O. Pearce
f522c9b5ed git-gui: Refactor into multiple files to save my sanity
I'm finding it difficult to work with a 6,000+ line Tcl script
and not go insane while looking for a particular block of code.
Since most of the program is organized into different units of
functionality and not all users will need all units immediately
on startup we can improve things by splitting procs out into
multiple files and let auto_load handle things for us.

This should help not only to better organize the source, but
it may also improve startup times for some users as the Tcl
parser does not need to read as much script before it can show
the UI.  In many cases the user can avoid reading at least half
of git-gui now.

Unfortunately we now need a library directory in our runtime
location.  This is currently assumed to be $(sharedir)/git-gui/lib
and its expected that the Makefile invoker will setup some sort of
reasonable sharedir value for us, or let us assume its going to be
$(gitexecdir)/../share.

We now also require a tclsh (in TCL_PATH) to just run the Makefile,
as we use tclsh to generate the tclIndex for our lib directory.  I'm
hoping this is not an unncessary burden on end-users who are building
from source.

I haven't really made any functionality changes here, this is just a
huge migration of code from one file to many smaller files.  All of
the new changes are to setup the library path and install the library
files.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-07 23:35:48 -04:00