refactor(ui): remove theme toggle button and sun/moon icons
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
||||||
<path d="M 12 3 A 9 9 0 1 0 21 12 A 7.5 7.5 0 0 1 12 3 Z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 251 B |
@@ -1,11 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
||||||
<circle cx="12" cy="12" r="4.5" fill="none" stroke="currentColor" stroke-width="2"/>
|
|
||||||
<line x1="12" y1="2" x2="12" y2="4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="12" y1="19.5" x2="12" y2="22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="2" y1="12" x2="4.5" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="19.5" y1="12" x2="22" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="4.9" y1="4.9" x2="6.7" y2="6.7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="17.3" y1="17.3" x2="19.1" y2="19.1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="4.9" y1="19.1" x2="6.7" y2="17.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="17.3" y1="6.7" x2="19.1" y2="4.9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -119,12 +119,6 @@ public final class Icons {
|
|||||||
public static Node refresh() { return refresh(SIZE_16); }
|
public static Node refresh() { return refresh(SIZE_16); }
|
||||||
public static Node refresh(int size) { return of("refresh", size); }
|
public static Node refresh(int size) { return of("refresh", size); }
|
||||||
|
|
||||||
public static Node sun() { return sun(SIZE_16); }
|
|
||||||
public static Node sun(int size) { return of("sun", size); }
|
|
||||||
|
|
||||||
public static Node moon() { return moon(SIZE_16); }
|
|
||||||
public static Node moon(int size) { return of("moon", size); }
|
|
||||||
|
|
||||||
public static Node arrowRight() { return arrowRight(SIZE_16); }
|
public static Node arrowRight() { return arrowRight(SIZE_16); }
|
||||||
public static Node arrowRight(int size) { return of("arrow-right", size); }
|
public static Node arrowRight(int size) { return of("arrow-right", size); }
|
||||||
|
|
||||||
|
|||||||
-57
@@ -577,63 +577,6 @@ public final class SvgIcons {
|
|||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ícone de Sol (Light Mode).
|
|
||||||
*/
|
|
||||||
public static Node sunIcon(double size) {
|
|
||||||
return AssetManager.getIconOrDefault("sun", size, () -> buildSunIcon(size));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Node buildSunIcon(double size) {
|
|
||||||
StackPane box = new StackPane();
|
|
||||||
box.setPrefSize(size, size);
|
|
||||||
box.setMaxSize(size, size);
|
|
||||||
|
|
||||||
Circle sunCore = new Circle(size * 0.5, size * 0.5, size * 0.24);
|
|
||||||
sunCore.setFill(new LinearGradient(
|
|
||||||
0, 0, 1, 1, true, CycleMethod.NO_CYCLE,
|
|
||||||
new Stop(0, Color.web("#f59e0b")),
|
|
||||||
new Stop(1, Color.web("#d97706"))
|
|
||||||
));
|
|
||||||
|
|
||||||
SVGPath rays = new SVGPath();
|
|
||||||
rays.setContent("M 12 2 L 12 5 M 12 19 L 12 22 M 2 12 L 5 12 M 19 12 L 22 12 " +
|
|
||||||
"M 4.93 4.93 L 7.05 7.05 M 16.95 16.95 L 19.07 19.07 " +
|
|
||||||
"M 4.93 19.07 L 7.05 16.95 M 16.95 7.05 L 19.07 4.93");
|
|
||||||
rays.setStroke(Color.web("#f59e0b"));
|
|
||||||
rays.setStrokeWidth(2.0);
|
|
||||||
rays.setScaleX(size / 24.0);
|
|
||||||
rays.setScaleY(size / 24.0);
|
|
||||||
|
|
||||||
box.getChildren().addAll(rays, sunCore);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ícone de Lua (Dark Mode).
|
|
||||||
*/
|
|
||||||
public static Node moonIcon(double size) {
|
|
||||||
return AssetManager.getIconOrDefault("moon", size, () -> buildMoonIcon(size));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Node buildMoonIcon(double size) {
|
|
||||||
StackPane box = new StackPane();
|
|
||||||
box.setPrefSize(size, size);
|
|
||||||
box.setMaxSize(size, size);
|
|
||||||
|
|
||||||
SVGPath moon = new SVGPath();
|
|
||||||
moon.setContent("M 21 12.79 A 9 9 0 1 1 11.21 3 A 7 7 0 0 0 21 12.79 Z");
|
|
||||||
moon.setFill(new LinearGradient(
|
|
||||||
0, 0, 1, 1, true, CycleMethod.NO_CYCLE,
|
|
||||||
new Stop(0, Color.web("#38bdf8")),
|
|
||||||
new Stop(1, Color.web("#818cf8"))
|
|
||||||
));
|
|
||||||
moon.setScaleX(size / 24.0);
|
|
||||||
moon.setScaleY(size / 24.0);
|
|
||||||
|
|
||||||
box.getChildren().add(moon);
|
|
||||||
return box;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logotipo vetorial CyberShield.
|
* Logotipo vetorial CyberShield.
|
||||||
|
|||||||
+2
-34
@@ -35,7 +35,6 @@ public final class MainAppView {
|
|||||||
|
|
||||||
private final Stage stage;
|
private final Stage stage;
|
||||||
private final VBox root = new VBox(16);
|
private final VBox root = new VBox(16);
|
||||||
private final Button themeToggleBtn = new Button();
|
|
||||||
|
|
||||||
private Runnable onSignPdf;
|
private Runnable onSignPdf;
|
||||||
private Runnable onSignXml;
|
private Runnable onSignXml;
|
||||||
@@ -148,11 +147,8 @@ public final class MainAppView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuração e inicialização do Tema
|
// Configuração e inicialização da folha de estilos global
|
||||||
ThemeManager.applyTheme(scene);
|
ThemeManager.applyTheme(scene);
|
||||||
updateThemeToggleButton();
|
|
||||||
|
|
||||||
ThemeManager.addListener(theme -> updateThemeToggleButton());
|
|
||||||
|
|
||||||
stage.setTitle(CyberCoreUiConstants.APP_NAME);
|
stage.setTitle(CyberCoreUiConstants.APP_NAME);
|
||||||
stage.getIcons().addAll(br.com.cybercore.signer.ui.assets.AssetManager.getApplicationIcons());
|
stage.getIcons().addAll(br.com.cybercore.signer.ui.assets.AssetManager.getApplicationIcons());
|
||||||
@@ -207,38 +203,10 @@ public final class MainAppView {
|
|||||||
Label statusBadge = new Label("● Agente Ativo • 127.0.0.1:21325");
|
Label statusBadge = new Label("● Agente Ativo • 127.0.0.1:21325");
|
||||||
statusBadge.getStyleClass().add("cyber-status-badge");
|
statusBadge.getStyleClass().add("cyber-status-badge");
|
||||||
|
|
||||||
// Botão Alternador de Tema (Claro / Escuro)
|
headerBar.getChildren().addAll(brandLogo, titleBox, leftSpacer, statusBadge);
|
||||||
themeToggleBtn.getStyleClass().add("theme-toggle-btn");
|
|
||||||
themeToggleBtn.setOnAction(e -> {
|
|
||||||
ThemeManager.toggleTheme();
|
|
||||||
if (stage.getScene() != null) {
|
|
||||||
ThemeManager.applyTheme(stage.getScene());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
headerBar.getChildren().addAll(brandLogo, titleBox, leftSpacer, statusBadge, themeToggleBtn);
|
|
||||||
return headerBar;
|
return headerBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateThemeToggleButton() {
|
|
||||||
boolean dark = ThemeManager.isDark();
|
|
||||||
HBox content = new HBox(8);
|
|
||||||
content.setAlignment(Pos.CENTER);
|
|
||||||
|
|
||||||
Node icon = dark ? Icons.sun(16) : Icons.moon(16);
|
|
||||||
StackPane iconBox = new StackPane(icon);
|
|
||||||
iconBox.setPrefSize(18, 18);
|
|
||||||
iconBox.setMinSize(18, 18);
|
|
||||||
iconBox.setMaxSize(18, 18);
|
|
||||||
iconBox.setAlignment(Pos.CENTER);
|
|
||||||
|
|
||||||
Label label = new Label(dark ? "Modo Claro" : "Modo Escuro");
|
|
||||||
label.getStyleClass().add("text-bold");
|
|
||||||
|
|
||||||
content.getChildren().addAll(iconBox, label);
|
|
||||||
themeToggleBtn.setGraphic(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Button createActionButton(Node icon, String text, Runnable onAction) {
|
private Button createActionButton(Node icon, String text, Runnable onAction) {
|
||||||
Button btn = new Button();
|
Button btn = new Button();
|
||||||
btn.getStyleClass().add("cyber-action-card");
|
btn.getStyleClass().add("cyber-action-card");
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
||||||
<path d="M 12 3 A 9 9 0 1 0 21 12 A 7.5 7.5 0 0 1 12 3 Z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 251 B |
@@ -1,11 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
|
||||||
<circle cx="12" cy="12" r="4.5" fill="none" stroke="currentColor" stroke-width="2"/>
|
|
||||||
<line x1="12" y1="2" x2="12" y2="4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="12" y1="19.5" x2="12" y2="22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="2" y1="12" x2="4.5" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="19.5" y1="12" x2="22" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="4.9" y1="4.9" x2="6.7" y2="6.7" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="17.3" y1="17.3" x2="19.1" y2="19.1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="4.9" y1="19.1" x2="6.7" y2="17.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
<line x1="17.3" y1="6.7" x2="19.1" y2="4.9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user