Skip to content

Commit baf54c8

Browse files
committed
Propagate the ViewMenu Tooltip from the E4 model to the UI
Currently all ViewMenus have the same tooltip "View Menu" even if there is a name or tooltip defined in the E4 Model. This is because the constant string is set once and never updated. This now properly reads the values from the model and falls back to the old one if nothing is specified.
1 parent 18accd1 commit baf54c8

File tree

1 file changed

+11
-2
lines changed
  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

1 file changed

+11
-2
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,12 +908,21 @@ public void adjustTopRight(final CTabFolder tabFolder) {
908908
// We need to modify the 'exclude' bit based on if the menuTB is
909909
// visible or not
910910
RowData rd = (RowData) menuTB.getLayoutData();
911+
ToolItem item = menuTB.getItem(0);
911912
if (needsMenu) {
912-
menuTB.getItem(0).setData(THE_PART_KEY, part);
913+
item.setData(THE_PART_KEY, part);
913914
rd.exclude = false;
915+
String tooltip = viewMenu.getTooltip();
916+
if (tooltip == null) {
917+
tooltip = viewMenu.getLabel();
918+
}
919+
if (tooltip == null) {
920+
tooltip = SWTRenderersMessages.viewMenu;
921+
}
922+
item.setToolTipText(tooltip);
914923
menuTB.setVisible(true);
915924
} else {
916-
menuTB.getItem(0).setData(THE_PART_KEY, null);
925+
item.setData(THE_PART_KEY, null);
917926
rd.exclude = true;
918927
menuTB.setVisible(false);
919928
}

0 commit comments

Comments
 (0)