Skip to content

Commit

Permalink
Add warning in preferences dialog
Browse files Browse the repository at this point in the history
Add a warning about flickering effects caused by the Edge browser under
Preferences > General > Appearance.
  • Loading branch information
fedejeanne committed Nov 15, 2024
1 parent 69f6e45 commit 50c8966
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public class WorkbenchMessages extends NLS {

public static String StatusUtil_errorOccurred;

public static String EdgeBrowserDisclaimer;

// ==============================================================================
// Workbench Actions
// ==============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@
package org.eclipse.ui.internal.dialogs;

import static org.eclipse.jface.viewers.LabelProvider.createTextProvider;
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_COLOR_AND_FONT_ID;
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_OS_VERSION;
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ASSOCIATION;
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ID;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.Collator;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -77,6 +82,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.IWorkbenchPreferencePage;
Expand Down Expand Up @@ -213,16 +219,27 @@ private void createHiDPISettingsGroup(Composite parent) {
group.setFont(parent.getFont());
GridLayout layout = new GridLayout(1, false);
group.setLayout(layout);
Label infoLabel = new Label(group, SWT.WRAP);
infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer);
Link infoLabel = new Link(group, SWT.WRAP);
infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer + System.lineSeparator() + System.lineSeparator()
+ WorkbenchMessages.EdgeBrowserDisclaimer);
infoLabel.setLayoutData(GridDataFactory.defaultsFor(infoLabel).create());
infoLabel.addSelectionListener(widgetSelectedAdapter(c -> openURL(c.text)));

createLabel(group, ""); //$NON-NLS-1$

boolean initialStateRescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
rescaleAtRuntime = createCheckButton(group, WorkbenchMessages.RescaleAtRuntimeEnabled, initialStateRescaleAtRuntime);
}

private void openURL(String url) {
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException | URISyntaxException e) {
WorkbenchPlugin.log(e);
}
}

private void createThemeIndependentComposits(Composite comp) {
createUseRoundTabs(comp);
createColoredLabelsPref(comp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ RescaleAtRuntimeSettingChangeWarningText = Restart for the DPI setting changes t
HiDpiSettingsGroupTitle = HiDPI settings
RescaleAtRuntimeEnabled = Monitor-specific UI &scaling
RescaleAtRuntimeDisclaimer = EXPERIMENTAL! Activating this option will dynamically scale all windows according to the monitor they are currently in. It will also set the default browser to Edge in order to provide the appropriate scaling of content displayed in a browser. This feature is still in development and therefore considered experimental.
EdgeBrowserDisclaimer = Note that the usage of Edge may currently lead to flickering when resizing a browser window it and may cause seizures (see <a href="https://github.com/eclipse-platform/eclipse.platform.swt/issues/1122">this issue</a> for more details).

# --- Workbench -----
WorkbenchPreference_openMode=Open mode
WorkbenchPreference_doubleClick=D&ouble click
Expand Down

0 comments on commit 50c8966

Please sign in to comment.