add visual feedback when dragging tabs

This commit is contained in:
stefan schippers 2025-08-22 10:04:53 +02:00
parent 21677963cd
commit d6c8ab2efc
1 changed files with 14 additions and 0 deletions

View File

@ -8162,7 +8162,21 @@ proc swap_tabs {x y what} {
if {$what eq {press} } {
# puts "From: [winfo containing $x $y]"
set tctx::source_swap_tab [winfo containing $x $y]
puts $tctx::source_swap_tab
set cond1 [regexp {\.tabs\.x} $tctx::source_swap_tab]
if {$cond1} {
button .tabs.mm -padx 2 -pady 0 -anchor nw -takefocus 0 -text [$tctx::source_swap_tab cget -text]
bind . <B1-Motion> {
place .tabs.mm -x [expr {[getmousex .tabs]-[winfo width .tabs.mm]/2 }] -y 0
raise .tabs.mm
}
}
} else {
bind .tabs <B1-Motion> {}
place forget .tabs.mm
destroy .tabs.mm
# puts "To: [winfo containing $x $y]"
set tctx::dest_swap_tab [winfo containing $x $y]
if {[info exists tctx::source_swap_tab] && [info exists tctx::dest_swap_tab]} {