Skip to content

Welcome tab #13407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions jabgui/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,6 @@
requires org.antlr.antlr4.runtime;
requires org.libreoffice.uno;
requires com.dlsc.pdfviewfx;
requires org.jetbrains.annotations;
// endregion
}
294 changes: 0 additions & 294 deletions jabgui/src/main/java/org/jabref/gui/WelcomeTab.java

This file was deleted.

2 changes: 1 addition & 1 deletion jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.jabref.gui.LibraryTab;
import org.jabref.gui.LibraryTabContainer;
import org.jabref.gui.StateManager;
import org.jabref.gui.WelcomeTab;
import org.jabref.gui.actions.ActionFactory;
import org.jabref.gui.actions.ActionHelper;
import org.jabref.gui.actions.SimpleCommand;
Expand All @@ -53,6 +52,7 @@
import org.jabref.gui.undo.RedoAction;
import org.jabref.gui.undo.UndoAction;
import org.jabref.gui.util.BindingsHelper;
import org.jabref.gui.welcome.WelcomeTab;
import org.jabref.logic.UiCommand;
import org.jabref.logic.ai.AiService;
import org.jabref.logic.journals.JournalAbbreviationRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.jabref.gui.welcome;

import javafx.scene.control.Button;

import org.jabref.gui.icon.IconTheme;

import org.jspecify.annotations.Nullable;

public class QuickSettingsButton extends Button {
public QuickSettingsButton(String text, IconTheme.@Nullable JabRefIcons icon, Runnable action) {
super(text);
if (icon != null) {
setGraphic(icon.getGraphicNode());
}
getStyleClass().add("quick-settings-button");
setMaxWidth(Double.MAX_VALUE);
setOnAction(_ -> action.run());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.jabref.gui.welcome;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.fxml.FXML;
import javafx.scene.layout.VBox;

import com.airhacks.afterburner.views.ViewLoader;

public class ThemeWireFrameComponent extends VBox {

private final StringProperty themeType = new SimpleStringProperty();

public ThemeWireFrameComponent() {
ViewLoader.view(this)
.root(this)
.load();

themeType.addListener((_, _, newValue) -> {
if (newValue != null) {
updateTheme();
}
});
}

public ThemeWireFrameComponent(String themeType) {
this();
setThemeType(themeType);
}

public void setThemeType(String themeType) {
this.themeType.set(themeType);
}

@FXML
private void initialize() {
if (themeType.get() != null) {
updateTheme();
}
}

private void updateTheme() {
String theme = themeType.get();
if (theme == null) {
return;
}

getStyleClass().removeIf(styleClass ->
styleClass.startsWith("wireframe-light") ||
styleClass.startsWith("wireframe-dark") ||
styleClass.startsWith("wireframe-custom"));

getStyleClass().add("wireframe-" + theme);
}
}
Loading
Loading