From 77207904e0b0ca27996be899450ee4d73e02a9d4 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 28 Apr 2026 10:39:28 +0200 Subject: [PATCH] Use dialog font in editor drop-down and drop bold-when-hidden marker The editor chevron drop-down inherited the SWT system font, which on many platforms looks out of place compared to the rest of the IDE chrome. Switch the filter text and the table to JFaceResources getDialogFont() so the list matches the Quick Switch Editor (Ctrl+E) dialog and other workbench dialogs. Also remove the rule in BasicStackListLabelProvider that rendered an entry in bold when its CTabItem was not currently visible in the tab bar. That marker is not useful to users: - It is undiscoverable. There is no legend or tooltip explaining that bold means "tab scrolled off the visible tab bar". Bold conventionally signals importance, unread, or modified, none of which apply here. - It is redundant with why the drop-down is opened. Users open the chevron precisely because some tabs do not fit. Encoding which rows overflowed burns the strongest typographic emphasis on information the user did not ask for. - It crowds out more meaningful styling. PR #3938 introduces bold for matched filter substrings, which is a far more useful signal and conflicted visually with the previous all-bold rows. --- .../swt/AbstractTableInformationControl.java | 4 ++- .../renderers/swt/BasicPartList.java | 30 ------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java index f4333185d8f..9a6fd47a421 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/AbstractTableInformationControl.java @@ -134,6 +134,7 @@ public AbstractTableInformationControl(Shell parent, int shellStyle, fTableViewer = createTableViewer(fComposite, controlStyle); final Table table = fTableViewer.getTable(); + table.setFont(JFaceResources.getDialogFont()); table.addKeyListener(KeyListener.keyPressedAdapter(e -> { switch (e.keyCode) { case SWT.ESC: @@ -314,10 +315,11 @@ public TableViewer getTableViewer() { protected Text createFilterText(Composite parent) { fFilterText = new Text(parent, SWT.NONE); + fFilterText.setFont(JFaceResources.getDialogFont()); GridData data = new GridData(); GC gc = new GC(parent); - gc.setFont(parent.getFont()); + gc.setFont(fFilterText.getFont()); FontMetrics fontMetrics = gc.getFontMetrics(); gc.dispose(); diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java index 83df2a75389..c04d4f885f9 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java @@ -35,12 +35,9 @@ import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; @@ -48,28 +45,6 @@ public class BasicPartList extends AbstractTableInformationControl { private class BasicStackListLabelProvider extends ColumnLabelProvider { - private final Font boldFont; - - public BasicStackListLabelProvider() { - Font font = Display.getDefault().getSystemFont(); - FontData[] fontDatas = font.getFontData(); - for (FontData fontData : fontDatas) { - fontData.setStyle(fontData.getStyle() | SWT.BOLD); - } - boldFont = new Font(Display.getDefault(), fontDatas); - } - - @Override - public Font getFont(Object element) { - if (element instanceof MPart part) { - CTabItem item = renderer.findItemForPart(part); - if (item != null && !item.isShowing()) { - return boldFont; - } - } - return super.getFont(element); - } - @Override public String getText(Object element) { if (element instanceof MDirtyable @@ -97,11 +72,6 @@ public String getToolTipText(Object element) { public boolean useNativeToolTip(Object object) { return true; } - - @Override - public void dispose() { - boldFont.dispose(); - } } private MElementContainer input;