mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 15:55:54 -04:00
Fix webview height
This commit is contained in:
parent
d879b703b2
commit
d1d963052f
@ -51,15 +51,22 @@ public class WebViewPopup extends Popup {
|
||||
Utilities.setupWebViewPopupHandler(webView.getEngine());
|
||||
|
||||
webView.getEngine().documentProperty().addListener((observable, oldValue, newValue) -> {
|
||||
// TODO At linux the heightInPx is screwed up.... need to find a better solution that that ugly html hack
|
||||
String heightInPx = webView.getEngine()
|
||||
.executeScript("window.getComputedStyle(document.body, null).getPropertyValue('height')").toString();
|
||||
double height = Math.min(Double.valueOf(heightInPx.replace("px", "")) * 1.2, BitsquareApp.getPrimaryStage().getHeight());
|
||||
webView.setPrefHeight(height);
|
||||
stage.setMinHeight(height + gridPane.getHeight());
|
||||
double webViewHeight = Math.min(Double.valueOf(heightInPx.replace("px", "")) * 1.2,
|
||||
BitsquareApp.getPrimaryStage().getHeight() - 200);
|
||||
double stageHeight = Math.min(webViewHeight + gridPane.getHeight(),
|
||||
BitsquareApp.getPrimaryStage().getHeight());
|
||||
webView.setPrefHeight(webViewHeight);
|
||||
stage.setMinHeight(stageHeight);
|
||||
stage.setMaxHeight(stageHeight);
|
||||
centerPopup();
|
||||
gridPane.setVisible(true);
|
||||
});
|
||||
|
||||
createGridPane();
|
||||
gridPane.setVisible(false);
|
||||
addHtmlContent();
|
||||
createPopup();
|
||||
return this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user