Skip to content

Commit

Permalink
Double click middle mouse button to popout sidebar entry
Browse files Browse the repository at this point in the history
  • Loading branch information
parg committed Dec 19, 2024
1 parent a16d7a3 commit 3e693e0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
28 changes: 19 additions & 9 deletions uis/src/com/biglybt/ui/swt/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1084,15 +1084,25 @@ public static void disposeSWTObjects(Object... disposeList) {
if (disposeList == null) {
return;
}
for (int i = 0; i < disposeList.length; i++) {
try {
Object o = disposeList[i];
if (o instanceof Widget && !((Widget) o).isDisposed())
((Widget) o).dispose();
else if ((o instanceof Resource) && !((Resource) o).isDisposed()) {
((Resource) o).dispose();
}
} catch (Exception e) {
for ( Object o: disposeList ){
if ( o == null ){
continue;
}
try{
if (o instanceof Widget){
Widget w = (Widget)o;
if ( !w.isDisposed()){
w.dispose();
}
}else if ( o instanceof Resource){
Resource r = (Resource)o;
if ( !r.isDisposed()){
r.dispose();
}
}else{
Debug.out( "No dispose action for " + o.getClass());
}
}catch (Exception e) {
Debug.out("Warning: Disposal failed "
+ Debug.getCompressedStackTrace(e, 0, -1, true));
}
Expand Down
2 changes: 1 addition & 1 deletion uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ public void handleEvent(final Event event) {
SideBarEntrySWT entry = (SideBarEntrySWT) ((treeItem == null || treeItem.isDisposed())
? null : treeItem.getData("MdiEntry"));

if ( entry != null && event.button == 1 ){
if ( entry != null && ( event.button == 1 || event.button == 2 )){

// don't trigger popout if double click is in close area or
// item has child and user is clicking in the expandy area
Expand Down

0 comments on commit 3e693e0

Please sign in to comment.