Skip to content

Commit

Permalink
Make Edge browser available in ControlExample
Browse files Browse the repository at this point in the history
The SWT ControlExample does currently not provide a configuration option
to use Edge browser on Windows (i.e., to activate the SWT.EDGE flag,
like is provided for SWT.WEBKIT) already.
This change adds an according configuration option.
  • Loading branch information
HeikoKlare committed Sep 10, 2024
1 parent d04cf18 commit 2592408
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class BrowserTab extends Tab {

/* Style widgets added to the "Style" group */
Button webKitButton;
Button edgeButton;

String errorMessage, lastText, lastUrl;

Expand Down Expand Up @@ -92,6 +93,7 @@ void createExampleWidgets () {
int style = getDefaultStyle();
if (borderButton.getSelection ()) style |= SWT.BORDER;
if (webKitButton.getSelection ()) style |= SWT.WEBKIT;
if (edgeButton.getSelection ()) style |= SWT.EDGE;

/* Create the example widgets */
try {
Expand Down Expand Up @@ -162,8 +164,10 @@ void createStyleGroup () {
super.createStyleGroup ();

/* Create the extra widgets */
webKitButton = new Button (styleGroup, SWT.CHECK);
webKitButton = new Button (styleGroup, SWT.RADIO);
webKitButton.setText ("SWT.WEBKIT");
edgeButton = new Button (styleGroup, SWT.RADIO);
edgeButton.setText ("SWT.EDGE");
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
Expand Down Expand Up @@ -340,6 +344,7 @@ boolean rtlSupport() {
void setExampleWidgetState () {
super.setExampleWidgetState ();
webKitButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.WEBKIT) != 0);
edgeButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.EDGE) != 0);
borderButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.BORDER) != 0);
}
}

0 comments on commit 2592408

Please sign in to comment.