Skip to content

Commit

Permalink
WebView added and set programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
mulla028 committed Dec 6, 2024
1 parent ad38825 commit 71e1f22
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TextArea;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.scene.web.WebView;
Expand All @@ -20,9 +21,10 @@
public class SummaryShowingComponent extends VBox {
@FXML private TextArea summaryTextArea;
@FXML private Text summaryInfoText;
@FXML private WebView markdownWebView;
@FXML private CheckBox markdownCheckbox;

private WebView markdownWebView;

private final Summary summary;
private final Runnable regenerateCallback;
private final MarkdownFormatter markdownFormatter;
Expand All @@ -39,10 +41,17 @@ public SummaryShowingComponent(Summary summary, Runnable regenerateCallback) {

@FXML
private void initialize() {
summaryTextArea.setText(summary.content());
markdownWebView = new WebView();
markdownWebView.setVisible(false);
markdownWebView.setManaged(false);

VBox.setVgrow(markdownWebView, Priority.ALWAYS);

int indexOfTextArea = getChildren().indexOf(summaryTextArea);
getChildren().add(indexOfTextArea + 1, markdownWebView);

summaryTextArea.setText(summary.content());

String newInfo = summaryInfoText
.getText()
.replaceAll("%0", formatTimestamp(summary.timestamp()))
Expand Down

0 comments on commit 71e1f22

Please sign in to comment.