git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: GitList <git@vger.kernel.org>
Cc: Self <philipoakley@iee.org>
Subject: [PATCH v3 4/4] git gui: allow for a long recentrepo list
Date: Sun, 22 Jan 2017 19:53:01 +0000	[thread overview]
Message-ID: <20170122195301.1784-5-philipoakley@iee.org> (raw)
In-Reply-To: <20170122195301.1784-1-philipoakley@iee.org>

The gui.recentrepo list may be longer than the maxrecent setting.
Allow extra space to show any extra entries.

In an ideal world, the git gui would limit the number of entries
to the maxrecent setting, however the recentrepo config list may
have been extended outwith the gui, or the maxrecent setting changed
to a reduced value. Further, when testing the gui's recentrepo
logic it is useful to show these extra, but valid, entries.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
 lib/choose_repository.tcl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl
index f39636f..80f5a59 100644
--- a/lib/choose_repository.tcl
+++ b/lib/choose_repository.tcl
@@ -142,6 +142,10 @@ constructor pick {} {
 				-label [mc "Recent Repositories"]
 		}
 
+	if {[set lenrecent [llength $sorted_recent]] < $maxrecent} {
+		set lenrecent $maxrecent
+	}
+
 		${NS}::label $w_body.space
 		${NS}::label $w_body.recentlabel \
 			-anchor w \
@@ -153,7 +157,7 @@ constructor pick {} {
 			-background [get_bg_color $w_body.recentlabel] \
 			-wrap none \
 			-width 50 \
-			-height $maxrecent
+			-height $lenrecent
 		$w_recentlist tag conf link \
 			-foreground blue \
 			-underline 1
-- 
2.9.0.windows.1.323.g0305acf


  parent reply	other threads:[~2017-01-22 19:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22 19:52 [PATCH v3 0/4] git gui: allow for a long recentrepo list Philip Oakley
2017-01-22 19:52 ` [PATCH v3 1/4] git-gui: remove duplicate entries from .gitconfig's gui.recentrepo Philip Oakley
2017-01-22 19:52 ` [PATCH v3 2/4] git gui: cope with duplicates in _get_recentrepo Philip Oakley
2017-01-22 19:53 ` [PATCH v3 3/4] git gui: de-dup selected repo from recentrepo history Philip Oakley
2017-01-22 19:53 ` Philip Oakley [this message]
2017-02-11 12:48 ` [PATCH v3 0/4] git gui: allow for a long recentrepo list Philip Oakley
  -- strict thread matches above, loose matches on Subject: below --
2015-12-17 22:11 [PATCH v2 4/4] " Philip Oakley
2015-12-17 22:40 ` [PATCH v3 " Philip Oakley
2015-12-17 23:29   ` Junio C Hamano
2015-12-18  0:26     ` Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170122195301.1784-5-philipoakley@iee.org \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).