Mercurial > hg
comparison contrib/hgk @ 20764:d9378bfa0af0
hgk: enable selected patch text on Windows
Port a patch from gitk. Original description:
On windows, mouse input follows the keyboard focus, so to allow selecting
text from the patch canvas we must not shift focus back to the top level.
This change has no negative impact on X, so we don't explicitly test
for Win32 on this change. This provides similar selection capability
as already available using X-Windows.
Signed-off-by: Mark Levedahl <mdl123@verizon.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
author | Andrew Shadura <andrew@shadura.me> |
---|---|
date | Sat, 15 Mar 2014 15:44:51 +0100 |
parents | 0132cbe30c41 |
children | 777daa412e56 |
comparison
equal
deleted
inserted
replaced
20763:0132cbe30c41 | 20764:d9378bfa0af0 |
---|---|
793 } | 793 } |
794 | 794 |
795 # set the focus back to the toplevel for any click outside | 795 # set the focus back to the toplevel for any click outside |
796 # the entry widgets | 796 # the entry widgets |
797 proc click {w} { | 797 proc click {w} { |
798 global entries | 798 global ctext entries |
799 foreach e $entries { | 799 foreach e [concat $entries $ctext] { |
800 if {$w == $e} return | 800 if {$w == $e} return |
801 } | 801 } |
802 focus . | 802 focus . |
803 } | 803 } |
804 | 804 |
2544 } | 2544 } |
2545 } | 2545 } |
2546 | 2546 |
2547 proc selnextline {dir} { | 2547 proc selnextline {dir} { |
2548 global selectedline | 2548 global selectedline |
2549 focus . | |
2549 if {![info exists selectedline]} return | 2550 if {![info exists selectedline]} return |
2550 set l [expr $selectedline + $dir] | 2551 set l [expr $selectedline + $dir] |
2551 unmarkmatches | 2552 unmarkmatches |
2552 selectline $l 1 | 2553 selectline $l 1 |
2553 } | 2554 } |
2581 .ctop.top.bar.rightbut conf -state disabled | 2582 .ctop.top.bar.rightbut conf -state disabled |
2582 } | 2583 } |
2583 | 2584 |
2584 proc goback {} { | 2585 proc goback {} { |
2585 global history historyindex | 2586 global history historyindex |
2587 focus . | |
2586 | 2588 |
2587 if {$historyindex > 1} { | 2589 if {$historyindex > 1} { |
2588 incr historyindex -1 | 2590 incr historyindex -1 |
2589 set cmd [lindex $history [expr {$historyindex - 1}]] | 2591 set cmd [lindex $history [expr {$historyindex - 1}]] |
2590 eval $cmd | 2592 eval $cmd |
2595 } | 2597 } |
2596 } | 2598 } |
2597 | 2599 |
2598 proc goforw {} { | 2600 proc goforw {} { |
2599 global history historyindex | 2601 global history historyindex |
2602 focus . | |
2600 | 2603 |
2601 if {$historyindex < [llength $history]} { | 2604 if {$historyindex < [llength $history]} { |
2602 set cmd [lindex $history $historyindex] | 2605 set cmd [lindex $history $historyindex] |
2603 incr historyindex | 2606 incr historyindex |
2604 eval $cmd | 2607 eval $cmd |