git/list[1] front-page[2] threads[3] people[4] search[5] about
 

gitk: Fix restoring of column widths in the commit tree

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Feb 11, 2007, 16:58 UTC
Message-ID
<11712131153045-git-send-email-vsu@altlinux.ru>
In-Reply-To
<117121311393-git-send-email-vsu@altlinux.ru>

On Linux with Tk 8.4.13 after each gitk restart the column dividers were shifting more and more to the right. Apparently the value from [winfo width $canv] is larger than the value of the -width option specified when creating the widget due to non-zero -highlightthickness used by default. But gitk never shows the focus highlight on canvases used for the commit tree, so we can just set "-highlightthickness 0", which fixes the width mismatch.

(The code before commit 3468e71f452701b3eff6a2aeb826bbe0cdad8270 subtracted 2 from widths of canvases when saving them - apparently to account for that hidden highlightthickness; I suppose that Cygwin behaves differently - hope that "-highlightthickness 0" will give proper results everywhere.)

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
---
 gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 7e6ee56..ea3d68a 100755
--- a/gitk
+++ b/gitk
@@ -459,14 +459,17 @@ proc makewindow {} {
     set canv .tf.histframe.pwclist.canv
     canvas $canv -width $geometry(canv) \
 	-background $bgcolor -bd 0 \
+	-highlightthickness 0 \
 	-yscrollincr $linespc -yscrollcommand "scrollcanv $cscroll"
     .tf.histframe.pwclist add $canv
     set canv2 .tf.histframe.pwclist.canv2
     canvas $canv2 -width $geometry(canv2) \
+	-highlightthickness 0 \
 	-background $bgcolor -bd 0 -yscrollincr $linespc
     .tf.histframe.pwclist add $canv2
     set canv3 .tf.histframe.pwclist.canv3
     canvas $canv3 -width $geometry(canv3) \
+	-highlightthickness 0 \
 	-background $bgcolor -bd 0 -yscrollincr $linespc
     .tf.histframe.pwclist add $canv3
 
-- 
1.5.0.rc4.50.g403de
Previous: Sergey VlasovNext: Mark Levedahl
Message 6 of 8 in “Make gitk save and restore the user set window position.”
  1. Make gitk save and restore the user set window position.Mark Levedahl, Feb 11, 2007
  2. Make gitk save and restore the user set window position.Mark Levedahl, Feb 11, 2007
  3. Clean up geometry save code in gitk.Mark Levedahl, Feb 11, 2007
  4. Sergey VlasovFeb 11, 2007
  5. gitk: Fix restoring of pane sizesSergey Vlasov, Feb 11, 2007
  6. gitk: Fix restoring of column widths in the commit treeSergey Vlasov, Feb 11, 2007
  7. Mark LevedahlFeb 11, 2007
  8. Junio C HamanoFeb 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.