From 50089a3db29057e65a803dddac9b7b9784bb5b51 Mon Sep 17 00:00:00 2001 From: parg Date: Wed, 18 Dec 2024 13:12:26 +0000 Subject: [PATCH] fix --- .../ui/swt/views/skin/sidebar/SideBar.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java index b6d8ffc362f..ba2a47919cc 100644 --- a/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java +++ b/uis/src/com/biglybt/ui/swt/views/skin/sidebar/SideBar.java @@ -1671,8 +1671,14 @@ protected void defaultDrop(DropTargetEvent event) { * * @since 3.1.1.1 */ - protected void fillDropDownMenu(Menu menuDropDown, TreeItem[] items, - int indent) { + protected boolean + fillDropDownMenu( + Menu menuDropDown, + TreeItem[] items, + int indent) + { + boolean hit = false; + String s = ""; for (int i = 0; i < indent; i++) { s += " "; @@ -1698,11 +1704,16 @@ protected void fillDropDownMenu(Menu menuDropDown, TreeItem[] items, //ind = "\t" + o; } } - menuItem.setText(s + entry.getTitle() + ind); + String title = s + entry.getTitle() + ind; + + menuItem.setText( title ); menuItem.addSelectionListener(dropDownSelectionListener); MdiEntry currentEntry = getSelectedEntry(); + if (currentEntry != null && currentEntry.getViewID().equals(id)) { menuItem.setSelection(true); + + hit = true; } TreeItem[] subItems = treeItem.getItems(); @@ -1714,9 +1725,19 @@ protected void fillDropDownMenu(Menu menuDropDown, TreeItem[] items, } - fillDropDownMenu(parent, subItems, indent + 1); + if ( fillDropDownMenu(parent, subItems, indent + 1)){ + + hit = true; + + if ( !entry.isSelectable()){ + + menuItem.setText( title + " (*)"); + } + }; } } + + return( hit ); } /**