ref: f3cc4b69e3eebe0268262dea413d6e7c9cd50116
parent: 2e6cf1acf48e95d9408a6063074666af586bf35e
author: phil9 <telephil9@gmail.com>
date: Sat Feb 5 00:33:44 EST 2022
make message actions menu available with right-click in pager
--- a/a.h
+++ b/a.h
@@ -95,4 +95,5 @@
void pagerkey(Rune);
void pagershow(Message*);
+void mesgmenuhit(int, Mouse);
--- a/index.c
+++ b/index.c
@@ -309,13 +309,12 @@
close(fd);
}
-static
void
-menu2hit(Mouse m)
+mesgmenuhit(int but, Mouse m)
{
int n;
- n = menuhit(2, mctl, &menu, nil);
+ n = menuhit(but, mctl, &menu, nil);
switch(n){
case Mplumb:
select(indexat(m.xy), selc);
@@ -339,7 +338,7 @@
if(m.buttons & 1){
select(indexat(m.xy), selc);
}else if(m.buttons & 2){
- menu2hit(m);
+ mesgmenuhit(2, m);
}else if(m.buttons & 4){
n = indexat(m.xy);
if(n != sel)
--- a/pager.c
+++ b/pager.c
@@ -237,8 +237,12 @@
return;
if(nparts > 0 && ptinrect(m.xy, partsr) && m.buttons == 4)
partclick(m.xy);
- else if(ptinrect(m.xy, textr))
- textmouse(&text, mc);
+ else if(ptinrect(m.xy, textr)){
+ if(m.buttons == 4)
+ mesgmenuhit(3, m);
+ else
+ textmouse(&text, mc);
+ }
}
void