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

[PATCH 2/2] gitk: keep author and date colums to a minimal width on resize

From
GMGeorg Müller <georgmueller@gmx.net>
Date
Jul 8, 2023, 10:55 UTC
Message-ID
<20230708105546.2945446-4-georgmueller@gmx.net>
In-Reply-To
<20230708105546.2945446-2-georgmueller@gmx.net>
Signed-off-by: Georg Müller <georgmueller@gmx.net>
---
 gitk-git/gitk | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 0f229aadd7..819e059599 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2973,7 +2973,7 @@ proc savestuff {w} {
 }

 proc resizeclistpanes {win w} {
-    global oldwidth oldsash use_ttk
+    global oldwidth oldsash use_ttk charspc
     if {[info exists oldwidth($win)]} {
         if {[info exists oldsash($win)]} {
             set s0 [lindex $oldsash($win) 0]
@@ -3007,7 +3007,16 @@ proc resizeclistpanes {win w} {
                     set sash0 [expr {$sash1 - 20}]
                 }
             }
+            if {$w > 150 * $charspc} {
+                if {$sash1 + (20 * $charspc) > $w} {
+                    set sash1 [expr {$w - (20 * $charspc)}]
+                }
+                if {$sash0 + (30 * $charspc) > $sash1} {
+                    set sash0 [expr {$sash1 - (30 * $charspc)}]
+                }
+            }
         }
+
         if {$use_ttk} {
             $win sashpos 0 $sash0
             $win sashpos 1 $sash1
@@ -3023,7 +3032,7 @@ proc resizeclistpanes {win w} {
 }

 proc resizecdetpanes {win w} {
-    global oldwidth oldsash use_ttk
+    global oldwidth oldsash use_ttk charspc
     if {[info exists oldwidth($win)]} {
         if {[info exists oldsash($win)]} {
             set s0 $oldsash($win)
@@ -3046,6 +3055,11 @@ proc resizecdetpanes {win w} {
             if {$sash0 > $w - 15} {
                 set sash0 [expr {$w - 15}]
             }
+            if {$w > 150 * $charspc} {
+                if {$sash0 + (30 * $charspc) > $w} {
+                    set sash0 [expr {$w - (30 * $charspc)}]
+                }
+            }
         }
         if {$use_ttk} {
             $win sashpos 0 $sash0
--
2.41.0
Previous: Georg MüllerNext: Johannes Sixt
Message 3 of 5 in “fix resize issues on large screens”
  1. 0/2 fix resize issues on large screensGeorg Müller, Jul 8, 2023
  2. 1/2 gitk: limit factor scaling on resize to widths below 1900pxGeorg Müller, Jul 8, 2023
  3. 2/2 gitk: keep author and date colums to a minimal width on resizeGeorg Müller, Jul 8, 2023
  4. Johannes SixtJul 10, 2023
  5. Georg MüllerJul 10, 2023

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.