Attempt fix of browser for gtk3 and mozilla
This commit is contained in:
parent
c3b9acf412
commit
2694734c5f
3 changed files with 10 additions and 1 deletions
|
@ -47,7 +47,12 @@ public class AudibleBrowser {
|
||||||
try {
|
try {
|
||||||
if (Platform.isWindows())
|
if (Platform.isWindows())
|
||||||
silenceWindowsExplorer();
|
silenceWindowsExplorer();
|
||||||
browser = new Browser(parent, SWT.BORDER);
|
int style = 0;
|
||||||
|
if (Platform.isLinux())
|
||||||
|
style = SWT.WEBKIT;
|
||||||
|
else
|
||||||
|
style = SWT.MOZILLA;
|
||||||
|
browser = new Browser(parent, style);
|
||||||
browser.addTitleListener(event -> getShell().setText(event.title));
|
browser.addTitleListener(event -> getShell().setText(event.title));
|
||||||
Object t = browser.getWebBrowser();
|
Object t = browser.getWebBrowser();
|
||||||
|
|
||||||
|
@ -56,6 +61,7 @@ public class AudibleBrowser {
|
||||||
|
|
||||||
|
|
||||||
} catch (SWTError e) {
|
} catch (SWTError e) {
|
||||||
|
logger.error("error creating browser", e);
|
||||||
error = e;
|
error = e;
|
||||||
/* Browser widget could not be instantiated */
|
/* Browser widget could not be instantiated */
|
||||||
parent.setLayout(new FillLayout());
|
parent.setLayout(new FillLayout());
|
||||||
|
|
|
@ -25,4 +25,7 @@ public enum Platform {
|
||||||
return getPlatform().equals(win);
|
return getPlatform().equals(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isLinux() {
|
||||||
|
return getPlatform().equals(linux);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue