Skip to content

Commit da53efe

Browse files
committed
foreground restyle if there's no need to effect node
1 parent 80b3895 commit da53efe

7 files changed

Lines changed: 100 additions & 17 deletions

File tree

PLAN.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,13 @@ SubProjects
1717
[ ] Responsive Grid
1818
[ ] Create an article about carousel and how to use it.
1919
[ ] Create an article about drawer and how to use it.
20-
[ ] Interactivity
21-
Flow, Wrapper, Behavior [dialog, alert, snack]
20+
21+
drawer()
22+
.header()
23+
.factory()
24+
.footer()
25+
.build();
26+
27+
drawer as vbox
28+
Module as TitledPane
29+
View as toggleButton

screenshots/img_3.png

5.51 KB
Loading

src/main/java/io/github/gleidsonmt/dashboardfx/drawer/Drawer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.github.gleidsonmt.dashboardfx.drawer;
22

33
import io.github.gleidsonmt.dashboardfx.dashboard.Dashboard;
4-
import io.github.gleidsonmt.dashboardfx.presentation.presentations.styled.CircularLoaders;
54
import io.github.gleidsonmt.dashboardfx.presentation.Scroll;
65
import io.github.gleidsonmt.dashboardfx.presentation.about.AboutPres;
76
import io.github.gleidsonmt.dashboardfx.presentation.core.CarouselPres;
@@ -12,12 +11,13 @@
1211
import io.github.gleidsonmt.dashboardfx.presentation.presentations.components.*;
1312
import io.github.gleidsonmt.dashboardfx.presentation.presentations.controls.*;
1413
import io.github.gleidsonmt.dashboardfx.presentation.presentations.layout.TabPanePres;
14+
import io.github.gleidsonmt.dashboardfx.presentation.presentations.styled.CircularLoaders;
1515
import io.github.gleidsonmt.dashboardfx.presentation.presentations.styled.ToggleGroupPres;
1616
import io.github.gleidsonmt.dashboardfx.presentation.shapes.TextPres;
1717
import io.github.gleidsonmt.dashboardfx.presentation.util.ColorsPres;
18-
import io.github.gleidsonmt.glad.base.Root;
1918
import io.github.gleidsonmt.glad.base.Module;
2019
import io.github.gleidsonmt.glad.base.ModuleView;
20+
import io.github.gleidsonmt.glad.base.Root;
2121
import io.github.gleidsonmt.glad.base.View;
2222
import io.github.gleidsonmt.glad.controls.icon.Icon;
2323
import io.github.gleidsonmt.glad.controls.icon.SVGIcon;

src/main/java/io/github/gleidsonmt/dashboardfx/drawer/DrawerHeader.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import javafx.scene.layout.Priority;
77
import javafx.scene.layout.RowConstraints;
88
import javafx.scene.paint.Color;
9+
import javafx.scene.shape.StrokeType;
910
import javafx.scene.text.Text;
1011
import javafx.scene.text.TextAlignment;
1112

@@ -17,32 +18,26 @@ public class DrawerHeader extends GridPane {
1718

1819
public DrawerHeader() {
1920

20-
setPrefSize(200, 100);
21+
setPrefSize(200, 60);
2122
this.setPadding(new Insets(10));
22-
// this.setGridLinesVisible(true);
2323
this.setHgap(10);
2424

25-
// ImageView logoTest = new ImageView();
26-
// logoTest.setFitWidth(50);
27-
// logoTest.setFitHeight(50);
28-
// logoTest.setImage(new Image(Objects.requireNonNull(AppOld.class.getResource("img/logo_128.png")).toExternalForm()));
29-
3025
Text title = new Text("Blue Galaxy");
31-
// Font.loadFont(Objects.requireNonNull(AppOld.class.getResource("fonts/Instagram-Sans-Bold.ttf")).toExternalForm(), 16);
32-
// title.setFont(Font.loadFont(AppOld.class.getResource("fonts/Instagram-Sans.ttf").toExternalForm(), 16));
33-
title.setStyle("-fx-font-family: \"Instagram Sans\"; -fx-font-size: 28px; -fx-fill: -fx-accent; -fx-font-weight: bold;");
26+
title.setStyle(" -fx-font-size: 18px; -fx-fill: -fx-accent; -fx-font-weight: bold;");
27+
title.getStyleClass().addAll("depth-1", "font-instagram-headline");
3428

3529
Text legend = new Text("Gleidson, Inc. v0.7.223");
3630
legend.setStyle("-fx-text-weight: 14pt");
3731

3832
Text logoTest = new Text("G");
3933
logoTest.setStroke(Color.WHITE);
4034
logoTest.setRotate(180);
41-
logoTest.setStyle("-fx-fill: -fx-accent; -fx-font-size: 62px; -fx-font-family: \"JetBrains Mono\"; -fx-font-weight: bold;");
35+
logoTest.setStyle("-fx-fill: -fx-accent; -fx-font-size: 38px; -fx-font-family: \"JetBrains Mono\"; ");
36+
logoTest.setStrokeType(StrokeType.OUTSIDE);
4237
logoTest.getStyleClass().addAll("depth-1", "font-instagram");
4338
logoTest.setStrokeWidth(1);
4439
logoTest.setUnderline(true);
45-
logoTest.setWrappingWidth(50);
40+
logoTest.setWrappingWidth(20);
4641
logoTest.setTextAlignment(TextAlignment.CENTER);
4742

4843

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.gleidsonmt.dashboardfx.drawer;
2+
3+
import io.github.gleidsonmt.glad.drawer.DrawerItem;
4+
import javafx.collections.FXCollections;
5+
import javafx.collections.ObservableList;
6+
import javafx.scene.Node;
7+
8+
/**
9+
* @author Gleidson Neves da Silveira | gleidisonmt@gmail.com
10+
* Create on 08/09/2025
11+
*/
12+
public interface DrawerI {
13+
14+
DrawerI header(Node node);
15+
16+
DrawerI footer(Node node);
17+
18+
DrawerI modules(ObservableList<DrawerItem> modules);
19+
20+
DrawerI modules(DrawerItem... modules);
21+
22+
void build();
23+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package io.github.gleidsonmt.dashboardfx.drawer;
2+
3+
import io.github.gleidsonmt.glad.drawer.DrawerItem;
4+
import javafx.collections.FXCollections;
5+
import javafx.collections.ObservableList;
6+
import javafx.scene.Node;
7+
import javafx.scene.control.ListView;
8+
import javafx.scene.layout.VBox;
9+
10+
/**
11+
* @author Gleidson Neves da Silveira | gleidisonmt@gmail.com
12+
* Create on 08/09/2025
13+
*/
14+
public class DrawerImpl implements DrawerI {
15+
16+
private Node header;
17+
private Node footer;
18+
private ObservableList<DrawerItem> modules;
19+
private VBox body;
20+
private ListView<DrawerItem> drawerItems;
21+
22+
public DrawerImpl() {
23+
24+
}
25+
26+
@Override
27+
public DrawerI header(Node node) {
28+
this.header = node;
29+
return this;
30+
}
31+
32+
@Override
33+
public DrawerI footer(Node node) {
34+
this.footer = node;
35+
return this;
36+
}
37+
38+
@Override
39+
public DrawerI modules(ObservableList<DrawerItem> modules) {
40+
this.modules = modules;
41+
return this;
42+
}
43+
44+
@Override
45+
public DrawerI modules(DrawerItem... modules) {
46+
this.modules = FXCollections.observableArrayList(modules);
47+
return this;
48+
}
49+
50+
@Override
51+
public void build() {
52+
body = new VBox();
53+
body.getChildren().setAll(header, drawerItems, footer);
54+
}
55+
56+
57+
}

0 commit comments

Comments
 (0)