Skip to content

Commit

Permalink
init branches
Browse files Browse the repository at this point in the history
  • Loading branch information
Anivie committed Jul 21, 2022
1 parent 040a8ab commit beb504d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ JavaFX版本的ElementUi,您可以仅需一行代码而轻松美化您的JavaF

For Java:
```
Button button = new Button();
ElementButtonKt.theme(button, ElementButton.grayButton);
Scene scene = new Scene(root);
scene.getStylesheets().add(CssResources.globalCssFile);
scene.getStylesheets().add(CssResources.buttonCssFile);//可选,用于每个组件可单独调整主题
/*
or:
CssResourcesKt.themes(scene, (strings, cssResources) -> {
Expand All @@ -18,6 +22,7 @@ For Java:
return null;
});
*/
primaryStage.setScene(scene);
primaryStage.setTitle("ElementForJavaFX");
primaryStage.show();
Expand Down
20 changes: 10 additions & 10 deletions src/main/resources/cloud_css/ElementFX.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.button {
-fx-background-color: rgba(236, 245, 255, 1);
-fx-background-radius: 5px 5px 5px 5px;
-fx-border-color: rgba(179, 216, 255, 1) rgba(179, 216, 255, 1) rgba(179, 216, 255, 1) rgba(179, 216, 255, 1);
-fx-border-radius: 5px 5px 5px 5px;
-fx-text-fill: rgba(64, 158, 255, 1);
-fx-font-size: 15px;
-fx-padding: 5px 10px 5px 10px;
-fx-cursor: HAND;
}
-fx-background-color: rgba(236, 245, 255, 1);
-fx-background-radius: 5px 5px 5px 5px;
-fx-border-color: rgba(179, 216, 255, 1) rgba(179, 216, 255, 1) rgba(179, 216, 255, 1) rgba(179, 216, 255, 1);
-fx-border-radius: 5px 5px 5px 5px;
-fx-text-fill: rgba(64, 158, 255, 1);
-fx-font-size: 15px;
-fx-padding: 5px 10px 5px 10px;
-fx-cursor: HAND;
}
.button:hover {
-fx-background-color: rgba(64, 158, 255, 1);
-fx-border-color: rgba(64, 158, 255, 1) rgba(64, 158, 255, 1) rgba(64, 158, 255, 1) rgba(64, 158, 255, 1);
Expand Down Expand Up @@ -365,7 +365,7 @@
.date-picker .text-field {
-fx-border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
}
.date-picker:hover, .date-picker:focused {
.date-picker:focused {
-fx-border-color: rgba(64, 169, 255, 1) rgba(64, 169, 255, 1) rgba(64, 169, 255, 1) rgba(64, 169, 255, 1);
}
.table-view {
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/mains.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import ink.bluecloud.css.CssResources;
import ink.bluecloud.css.ElementButton;
import ink.bluecloud.css.ElementButtonKt;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

class mains extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Button button = new Button();
ElementButtonKt.theme(button, ElementButton.grayButton);
Scene scene = new Scene(new TextField());
scene.getStylesheets().add(CssResources.globalCssFile);


primaryStage.setScene(scene);
primaryStage.setTitle("ElementForJavaFX");
primaryStage.show();
Expand Down
3 changes: 1 addition & 2 deletions src/test/kotlin/devapp/CloudStyleGlobal.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package devapp

import javafx.scene.Cursor
import javafx.scene.Cursor.HAND
import javafx.scene.paint.Color
import javafx.scene.paint.Color.*
Expand Down Expand Up @@ -468,7 +467,7 @@ class CloudStyleGlobal:Stylesheet() {
borderColor += box(TRANSPARENT)
}

and(hover, focused) {
and(focused) {
borderColor += box(c(64,169,255))
}

Expand Down

0 comments on commit beb504d

Please sign in to comment.