Attempt fix of browser for gtk3 and mozilla

This commit is contained in:
openaudible 2018-06-04 13:47:00 -07:00
parent c3b9acf412
commit 2694734c5f
3 changed files with 10 additions and 1 deletions

View file

@ -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());

View file

@ -25,4 +25,7 @@ public enum Platform {
return getPlatform().equals(win); return getPlatform().equals(win);
} }
public static boolean isLinux() {
return getPlatform().equals(linux);
}
} }