Skip to content

Commit 92d911a

Browse files
committed
gitk: prefs dialog: refine Auto-select UI
Tl;DR: change Auto-select text, move the length input to a new line. The Auto-select preference auto-selects [part of] the commit ID text at the respective widget on startup, and when the current commit at the graph changes. Its real premise, however, is to populate the selection clipboard with the commit ID. Consider, for instance, how meaningless it is on platforms without a selection clipboard - like Windows or macOS (on Windows the selection is not even visible with the default Tk theme, because it's only visible in focused widgets - which the commit ID widget is not during normal application of this selection). So rename the Auto-select label to "Copy commit ID to X11 selection", to reflect better the ultimate outcome of its application Note that there exists other, non-X11 platforms with a selection clipboard, like Wayland, and if a native Tk client exists on such platforms, then the description will not be accurate, but hopefully it's not too misleading either. Additionally, move the length input widget to a new line, because: - This length applies to both Auto-select and "Copy commit reference" context menu item, so it's not exclusive to the selection length. - The next commit will add support for primary clipboard as well, where this length will also be used. Also, move the "Hide remotes" item above these selection prefs, to keep the selection prefs semi-grouped before the spacing of the following title "Diff display options". Signed-off-by: Avi Halachmi (:avih) <[email protected]>
1 parent 66496da commit 92d911a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gitk

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11594,14 +11594,17 @@ proc prefspage_general {notebook} {
1159411594
${NS}::checkbutton $page.showlocal -text [mc "Show local changes"] \
1159511595
-variable showlocalchanges
1159611596
grid x $page.showlocal -sticky w
11597-
${NS}::checkbutton $page.autoselect -text [mc "Auto-select commit ID (length)"] \
11598-
-variable autoselect
11599-
spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
11600-
grid x $page.autoselect $page.autosellen -sticky w
1160111597
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
1160211598
-variable hideremotes
1160311599
grid x $page.hideremotes -sticky w
1160411600

11601+
${NS}::checkbutton $page.autoselect -text [mc "Copy commit ID to X11 selection"] \
11602+
-variable autoselect
11603+
grid x $page.autoselect -sticky w
11604+
spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
11605+
${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
11606+
grid x $page.autosellenl $page.autosellen -sticky w
11607+
1160511608
${NS}::label $page.ddisp -text [mc "Diff display options"]
1160611609
grid $page.ddisp - -sticky w -pady 10
1160711610
${NS}::label $page.tabstopl -text [mc "Tab spacing"]

0 commit comments

Comments
 (0)