From patchwork Mon Dec 9 18:08:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Sommer X-Patchwork-Id: 13900182 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E154D70819 for ; Mon, 9 Dec 2024 18:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733767743; cv=none; b=V2FXCtvLoovebRwy2frSK3CjGxE3k6Zgdw7m7bHUrWmnapNy8iiyP9vcaYEE8VCy4fd8aViYG6TYlvhIacTU7AgD2uoAfOqdwW7Ki+XlF5/QBKYyKeTMwvMutje8ivuBt99/wrJWSSoTUX6Lt8BFIhNK210ndeXBDClmTxiY2vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733767743; c=relaxed/simple; bh=3+juZQ019wtpi3SOcZTJ7osevloepnuDeeuhTiUl7qs=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=lecNxsIPCMZ4E81Zzuq7Fp4K/Iqj/Juima+0TH0ynKSB6qBHbWSl1IRmbb3HZG3omOS6D+4582570DH+tb/qrvzXSTelHx5vrjBJNCQuvnqnT94neauGTGaihuCJQE+es62QGIjjeM+3azkVxaGbJBDXq4ggR0q1/Eh4VHpFXbw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mmn348Lp; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mmn348Lp" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso3948350f8f.1 for ; Mon, 09 Dec 2024 10:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733767740; x=1734372540; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=aXRpARscPDVG+UIPeR1TSS+Nr+/W6X6AbKzSdHhOQdg=; b=mmn348Lp9pAQESBoY3A7Pn4gM1KACRO50SH46nty4uZjQizwDpl25NnmuzNlhnG6FZ nIdsw4VjxzjQgQuH8480LN+Y3VnmjZVQN8ZxkwkHSUzlk/CUIgU5bC3Tnso4HofHRexA usKTnXdunFEdWwhNCUw4dz4sZGW5c6U9WzRm5tFeDv5OQTvMdBA4bM6Q7QxRNdz5ITkD SGh8rJGwXjcfqoNvUtcdMXm/nn1x43yfcuZOW7SmFwaYKRoUgjYkric30njbhRCwjRaf J1JNJdiqwRJiCqsBa0YpUSOIxt7ZdaMS5qWJSMwGPuNTAlVecSjCXKTNvFzEz4FWlYPF aGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733767740; x=1734372540; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aXRpARscPDVG+UIPeR1TSS+Nr+/W6X6AbKzSdHhOQdg=; b=b9+cR9VHKpbfoVvIzSCHLXeWBNYM7B1dXQ6vxZY+VzNaErwtDT84J/8UoubPlqKyit swBi5MreDTjKjWTY2g5Q73RtH6m4u+goWMzQwPz273j1fM6kDzJUovTBHWwDDTSLQyDl eZ/gkDB4g0rfbYVQPOO+UN3teWqcfP5ilH0K/KBN8Ji6EDT1HrTOfcn9Ogk6N7zxYXbm bFiInA2wWBADJr1pPqGSXfE8esl6z7ap6A/Fp3ixuXZTexIE4JRm+Di9FdKeDXt0y5FY nYgsYxEhbH8WoAsFr0g/InIfwL1EW0cdr+2uxUkSiiIfEiwbCpwVKgIr+bYnwErtM9Kf buWg== X-Gm-Message-State: AOJu0YyILVVB6ZF/frF0jON4HkFEYC2md0nNWfNYNpuDI09EMTp4t4Vc EEU4u04oj9mtZvgSExMW16G2lJqWOm2Y974jh06J7E8pjge81/aq1tth6Q== X-Gm-Gg: ASbGncuPYliSifST/hlnqqcZlgY3MkpBUYJucTQ4sjwt9BbPUuYwmuNL0pDa6DOVJ2M AVCfrJIThwWcDRYmGEoit9u6DFo0xWkJJtDaLGufQ4AIgi+Fm9OhP7ZYci0+IjBSTMA2KkJqHfS Z2Af+klzCC7QX7VQu1FgeZSPAjp+5jsA9L44/GruA/MmwYHU9UoZ3JsdUj7ivDtyQ8343ouHuvz zN7RC+l4Ad60esCj++yEyRAq3LRDs/XtKKqIJCQCcejqY+iu14= X-Google-Smtp-Source: AGHT+IFh/jY30X0Hw1rCZLZ7krZMcmOrBpwoIIMY4f2Xdc1rFoXsBYvEBcZ7mhr6TW88RYD09dnkAg== X-Received: by 2002:a05:6000:2a83:b0:382:40ad:44b2 with SMTP id ffacd0b85a97d-386453e7472mr1275807f8f.34.1733767739547; Mon, 09 Dec 2024 10:08:59 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3861f4a85f2sm13613603f8f.29.2024.12.09.10.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 10:08:59 -0800 (PST) Message-Id: In-Reply-To: References: Date: Mon, 09 Dec 2024 18:08:56 +0000 Subject: [PATCH 1/2] gitk: make headings of preferences bold Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Christoph Sommer , Christoph Sommer From: Christoph Sommer From: Christoph Sommer Make preference groups like "Diff display options" stand out more. Signed-off-by: Christoph Sommer --- gitk-git/gitk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index 7a087f123d7..d024e58d016 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -11581,7 +11581,7 @@ proc prefspage_general {notebook} { set page [create_prefs_page $notebook.general] - ${NS}::label $page.ldisp -text [mc "Commit list display options"] + ${NS}::label $page.ldisp -text [mc "Commit list display options"] -font mainfontbold grid $page.ldisp - -sticky w -pady 10 ${NS}::label $page.spacer -text " " ${NS}::label $page.maxwidthl -text [mc "Maximum graph width (lines)"] @@ -11602,7 +11602,7 @@ proc prefspage_general {notebook} { -variable hideremotes grid x $page.hideremotes -sticky w - ${NS}::label $page.ddisp -text [mc "Diff display options"] + ${NS}::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold grid $page.ddisp - -sticky w -pady 10 ${NS}::label $page.tabstopl -text [mc "Tab spacing"] spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop @@ -11635,7 +11635,7 @@ proc prefspage_general {notebook} { pack configure $page.webbrowserf.l -padx 10 grid x $page.webbrowserf $page.webbrowser -sticky ew - ${NS}::label $page.lgen -text [mc "General options"] + ${NS}::label $page.lgen -text [mc "General options"] -font mainfontbold grid $page.lgen - -sticky w -pady 10 ${NS}::checkbutton $page.want_ttk -variable want_ttk \ -text [mc "Use themed widgets"] @@ -11654,7 +11654,7 @@ proc prefspage_colors {notebook} { set page [create_prefs_page $notebook.colors] - ${NS}::label $page.cdisp -text [mc "Colors: press to choose"] + ${NS}::label $page.cdisp -text [mc "Colors: press to choose"] -font mainfontbold grid $page.cdisp - -sticky w -pady 10 label $page.ui -padx 40 -relief sunk -background $uicolor ${NS}::button $page.uibut -text [mc "Interface"] \ @@ -11712,7 +11712,7 @@ proc prefspage_colors {notebook} { proc prefspage_fonts {notebook} { global NS set page [create_prefs_page $notebook.fonts] - ${NS}::label $page.cfont -text [mc "Fonts: press to choose"] + ${NS}::label $page.cfont -text [mc "Fonts: press to choose"] -font mainfontbold grid $page.cfont - -sticky w -pady 10 mkfontdisp mainfont $page [mc "Main font"] mkfontdisp textfont $page [mc "Diff display font"] From patchwork Mon Dec 9 18:08:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Sommer X-Patchwork-Id: 13900183 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B191C154BFC for ; Mon, 9 Dec 2024 18:09:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733767744; cv=none; b=NlPhlkDw1+XpIofj66gLFbJQLhYCP4jRqccu1rKbJrGraJYctXr9WeJCbJCfD6Om7eGRM/FjqUS7WV007RdfBmvkB0i6c/WsEQRmiFvCLqPde8OBCVBxjR0hqVS0WV7zyxENEafRnNbx9ldzQLApTF/DbtSXAdfoAtor7tmg3c8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733767744; c=relaxed/simple; bh=68UhBKWfYkdhDfiIGVpkAHpXf28ooG/X/Q85D9wc5vw=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=Wy6Iap9D018z/LYXuDecYObDxogxX8DXA9kjgwuajZUwzKu8xE3XPM0fdW94erGRlTEtlorsaqrZyIM4j+zBI/S2ydiiIzWhBnA1uTNJK5qLsC/cRAx8pAu37+C9yboOZTeNCC7AcNkaZt/MYhqo2OdQ3BWDSD62er1f20oDxLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ik8cO4q7; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ik8cO4q7" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-434fa6bf744so7381425e9.2 for ; Mon, 09 Dec 2024 10:09:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733767741; x=1734372541; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=pfpc/mrtQw4tK0pEUm668R0cgD1hr+KGRPoFkyMTCAY=; b=ik8cO4q7BsBamFGwlPBBz4eImUZQ1v7PylyqQeg14MdnlELVvWa+VY2Omym4BLW3HA PwobWopEsh+IiYJZE/HkR4MI4qD634gTOvSwsOnj0T2a2NVMTxV6HtlJnN5TC5bJdL9w FNqiAcLlHsfgIJDyUXOJdg7ZnQn/WOt1eZ+o0GwgqVXn+CnQMVWb2vxuRKx7EqSVAQJg cjpHCCsOn/aTpCBohjWw6eLAPOwK4Va3k1a8gs7p+7hG58CO4mCTvHoG1SCIOoHDEJYb YIUPLt6CMqxzXoJyxmyN26hq3w9R3w1uU+Stqt1Zueqjzz6qkiZ7cLoPA/Xnr4jBYWBC w8Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733767741; x=1734372541; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pfpc/mrtQw4tK0pEUm668R0cgD1hr+KGRPoFkyMTCAY=; b=viISAlc8+uak+bX4myoG/BdDivHD+4xT6PxHOmEENRBou6cDsjj60sqtshbFDSeKZa rgBTvRAA+vpRTXCnEqMsICkjYUJpTUZcUs4yv1XCG3G4u/UqmoGzQgdTKkLxvGgfLtS+ T4NLYVFCydIR65ZfoLaMuZ16srcViGqXpQcGJuj4+a/Hm3wqTJVC63KfZ8n8EnVE3fR4 ra05jN63XyAQ/IqyRse7LJFzZX5SKq3qqYO0Oim2fUOox1iSpafpSecfnCKGkvUpzP+u AaESz95y8eQnxTUwORkg6J9PW5hvhTVlZh6OgOuMhSK/xPJ4UrBNcGKQvvhL0IPDce5v KbXw== X-Gm-Message-State: AOJu0Yw1DZ9wtq/q7BVEhHcU5ezm4NslP1u3uQ9Ic6He5IriVnGZ5Chd pdPqUe2ViiMnqQ4SYx8QTYiYHKxbWATfyJkcCn3X6aP/5EZcCjQnbAMGCA== X-Gm-Gg: ASbGncvTsVudjc/44w7DfFwbwjCngOU+s4IzTXYmjAuy3HhxGDkTSohBhmosyQxm0vg TtyyeLIBQEkeZyZafEhDezk/gBNRYx68oNTOBA0Ml+MN9OVuwJrr3F2RR4QvRKNaC+IvXAw2xx4 7BHRh7CO9tM423IFomZLyxjYGbyJLUBPXmvA+j03rchZ+x/eAu6XoqZ/b8N5br7wjGV6eK2FWOn conRG8P5VphtGMd05WZ4POFw4zga5yhnKpFCWwo97PMhFZlJtw= X-Google-Smtp-Source: AGHT+IEgZpDq3VIsKx353ZgsoGMT1py4LNEU4B+x5o1ziyA70vdmNHeP8biyTYybC3R+Th9WQ39e9Q== X-Received: by 2002:a05:600c:3484:b0:434:fa24:b84a with SMTP id 5b1f17b1804b1-434fffd03d5mr13374775e9.25.1733767740383; Mon, 09 Dec 2024 10:09:00 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f0d2c321sm81799045e9.12.2024.12.09.10.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 10:08:59 -0800 (PST) Message-Id: In-Reply-To: References: Date: Mon, 09 Dec 2024 18:08:57 +0000 Subject: [PATCH 2/2] gitk: add text wrapping preferences Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Christoph Sommer , Christoph Sommer From: Christoph Sommer From: Christoph Sommer Add a new preference "wrapdefault" which allows enabling char/word wrap. Impacts all text in the ctext widget for which no other preference exists. Also make the (existing) preference "wrapcomment" configurable graphically. Its setting impacts only the "comment" part of the ctext widget. Signed-off-by: Christoph Sommer --- gitk-git/gitk | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index d024e58d016..3bf9bc2edea 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -2089,7 +2089,7 @@ proc makewindow {} { global diffcontextstring diffcontext global ignorespace global maincursor textcursor curtextcursor - global rowctxmenu fakerowmenu mergemax wrapcomment + global rowctxmenu fakerowmenu mergemax wrapcomment wrapdefault global highlight_files gdttype global searchstring sstring global bgcolor fgcolor bglist fglist diffcolors diffbgcolors selectbgcolor @@ -2431,7 +2431,7 @@ proc makewindow {} { set ctext .bleft.bottom.ctext text $ctext -background $bgcolor -foreground $fgcolor \ -state disabled -undo 0 -font textfont \ - -yscrollcommand scrolltext -wrap none \ + -yscrollcommand scrolltext -wrap $wrapdefault \ -xscrollcommand ".bleft.bottom.sbhorizontal set" if {$have_tk85} { $ctext conf -tabstyle wordprocessor @@ -11576,7 +11576,7 @@ proc create_prefs_page {w} { proc prefspage_general {notebook} { global NS maxwidth maxgraphpct showneartags showlocalchanges - global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs + global tabstop wrapcomment wrapdefault limitdiffs autoselect autosellen extdifftool perfile_attrs global hideremotes want_ttk have_ttk maxrefs web_browser set page [create_prefs_page $notebook.general] @@ -11607,6 +11607,17 @@ proc prefspage_general {notebook} { ${NS}::label $page.tabstopl -text [mc "Tab spacing"] spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop grid x $page.tabstopl $page.tabstop -sticky w + + ${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"] + ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \ + -textvariable wrapcomment + grid x $page.wrapcommentl $page.wrapcomment -sticky w + + ${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"] + ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \ + -textvariable wrapdefault + grid x $page.wrapdefaultl $page.wrapdefault -sticky w + ${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \ -variable showneartags grid x $page.ntag -sticky w @@ -11725,7 +11736,7 @@ proc doprefs {} { global oldprefs prefstop showneartags showlocalchanges global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs - global hideremotes want_ttk have_ttk + global hideremotes want_ttk have_ttk wrapcomment wrapdefault set top .gitkprefs set prefstop $top @@ -11734,7 +11745,7 @@ proc doprefs {} { return } foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} { set oldprefs($v) [set $v] } ttk_toplevel $top @@ -11860,7 +11871,7 @@ proc prefscan {} { global oldprefs prefstop foreach v {maxwidth maxgraphpct showneartags showlocalchanges \ - limitdiffs tabstop perfile_attrs hideremotes want_ttk} { + limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} { global $v set $v $oldprefs($v) } @@ -11874,7 +11885,8 @@ proc prefsok {} { global oldprefs prefstop showneartags showlocalchanges global fontpref mainfont textfont uifont global limitdiffs treediffs perfile_attrs - global hideremotes + global hideremotes wrapcomment wrapdefault + global ctext catch {destroy $prefstop} unset prefstop @@ -11923,6 +11935,12 @@ proc prefsok {} { if {$hideremotes != $oldprefs(hideremotes)} { rereadrefs } + if {$wrapcomment != $oldprefs(wrapcomment)} { + $ctext tag conf comment -wrap $wrapcomment + } + if {$wrapdefault != $oldprefs(wrapdefault)} { + $ctext configure -wrap $wrapdefault + } } proc formatdate {d} { @@ -12392,6 +12410,7 @@ set downarrowlen 5 set mingaplen 100 set cmitmode "patch" set wrapcomment "none" +set wrapdefault "none" set showneartags 1 set hideremotes 0 set maxrefs 20 @@ -12497,7 +12516,7 @@ config_check_tmp_exists 50 set config_variables { mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth - cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs + cmitmode wrapcomment wrapdefault autoselect autosellen showneartags maxrefs visiblerefs hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor