Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/LogWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
*/
package org.jackhuang.hmcl.ui;

import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXCheckBox;
import com.jfoenix.controls.JFXComboBox;
import com.jfoenix.controls.JFXListView;
import com.jfoenix.controls.*;
import javafx.application.Platform;
import javafx.beans.InvalidationListener;
import javafx.beans.binding.Bindings;
Expand All @@ -43,8 +40,12 @@
import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
import org.jackhuang.hmcl.ui.construct.NoneMultipleSelectionModel;
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
import org.jackhuang.hmcl.util.*;
import org.jackhuang.hmcl.util.platform.*;
import org.jackhuang.hmcl.util.CircularArrayList;
import org.jackhuang.hmcl.util.Lang;
import org.jackhuang.hmcl.util.Log4jLevel;
import org.jackhuang.hmcl.util.StringUtils;
import org.jackhuang.hmcl.util.platform.ManagedProcess;
import org.jackhuang.hmcl.util.platform.SystemUtils;

import java.io.IOException;
import java.nio.file.Files;
Expand Down Expand Up @@ -257,6 +258,7 @@ private static final class LogWindowSkin extends SkinBase<LogWindowImpl> {
private static final PseudoClass SELECTED = PseudoClass.getPseudoClass("selected");

private final Set<ListCell<Log>> selected = new HashSet<>();
private final JFXSnackbar snackbar = new JFXSnackbar();

LogWindowSkin(LogWindowImpl control) {
super(control);
Expand All @@ -265,7 +267,7 @@ private static final class LogWindowSkin extends SkinBase<LogWindowImpl> {
vbox.setPadding(new Insets(3, 0, 3, 0));
getSkinnable().stackPane.getChildren().setAll(vbox);
getChildren().setAll(getSkinnable().stackPane);

snackbar.registerSnackbarContainer(getSkinnable().stackPane);

{
BorderPane borderPane = new BorderPane();
Expand Down Expand Up @@ -381,7 +383,8 @@ protected void updateItem(Log item, boolean empty) {
}
}

FXUtils.copyText(stringBuilder.toString());
FXUtils.copyText(stringBuilder.toString(), null);
snackbar.fireEvent(new JFXSnackbar.SnackbarEvent(new JFXSnackbarLayout(i18n("message.copied"))));
}
});

Expand Down