Few small but cute UI enhancements, add contributors list to 'About' section, update readme, let application version visible in application to be taken directly from POM
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dmitry Isaenko 2022-09-20 00:38:33 +03:00
parent 45572d1db1
commit 0effa74477
12 changed files with 172 additions and 34 deletions

View file

@ -42,20 +42,20 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="046D", ATTRS{idProduct}=="c33c", GROUP="plug
root # udevadm control --reload-rules && udevadm trigger root # udevadm control --reload-rules && udevadm trigger
``` ```
### Building ### Build
`$ mvn package` `$ mvn package`
#### Thanks
* [DDinghoya](https://github.com/DDinghoya), who translated this application to Korean!
## Support this app ## Support this app
If you like this app, just give a star. If you like this app, just give a star.
Want to support development? Make a donation* (see below): Want to support development? Make a donation* (see below):
<a href="https://liberapay.com/developersu/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
<a href="https://paypal.me/developersu" title="PayPal"><img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" border="0" alt="PayPal Logo" /></a>
[ЮMoney](https://yoomoney.ru/to/410014301951665) [ЮMoney](https://yoomoney.ru/to/410014301951665)
*Please note: this is non-commercial application. *Please note: this is non-commercial application.
@ -63,6 +63,5 @@ Want to support development? Make a donation* (see below):
#### TODO #### TODO
* [ ] Tray support: tray icon size checks * [ ] Tray support: tray icon size checks
* [ ] Autoload option in settings
* [ ] Headless mode (CLI) * [ ] Headless mode (CLI)
* [x] Add opened file name to info pane * [x] Add opened file name to info pane

18
pom.xml
View file

@ -6,7 +6,7 @@
<groupId>loper</groupId> <groupId>loper</groupId>
<artifactId>LogiLedus</artifactId> <artifactId>LogiLedus</artifactId>
<version>1.4-SNAPSHOT</version> <version>1.5-SNAPSHOT</version>
<!-- <url></url> --> <!-- <url></url> -->
<description> <description>
@ -148,21 +148,21 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.10.0</version> <version>2.13.4</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.10.0</version> <version>2.13.4</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.12.6.1</version> <version>2.13.4</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@ -177,6 +177,16 @@
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName> <finalName>${project.artifactId}-${project.version}-${maven.build.timestamp}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources-filtered</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View file

@ -9,6 +9,7 @@ import logiledus.Mediator;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class AboutWindow { public class AboutWindow {
@ -31,10 +32,10 @@ public class AboutWindow {
stageAbout.setTitle(resourceBundle.getString("menu_item_about")); stageAbout.setTitle(resourceBundle.getString("menu_item_about"));
stageAbout.getIcons().addAll( stageAbout.getIcons().addAll(
new Image(getClass().getResourceAsStream("/ico/appIcon_32.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_32.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_48.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_48.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_64.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_64.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_128.png")) new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_128.png")))
); );
Scene scene = new Scene(parentAbout, 500, 500); Scene scene = new Scene(parentAbout, 500, 500);
scene.getStylesheets().add(Mediator.getInstance().getPreferences().getTheme()); scene.getStylesheets().add(Mediator.getInstance().getPreferences().getTheme());

View file

@ -17,6 +17,7 @@ import logiledus.USB.KeyLedThread;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.nio.file.Files;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -113,7 +114,7 @@ public class MainController implements Initializable {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
SettingsFileFormat setup; SettingsFileFormat setup;
try{ try{
setup = mapper.readerFor(SettingsFileFormat.class).readValue(new FileInputStream(configFile)); setup = mapper.readerFor(SettingsFileFormat.class).readValue(Files.newInputStream(configFile.toPath()));
KeysLedsController.setConfig(setup.getKeyLedRule()); KeysLedsController.setConfig(setup.getKeyLedRule());
EffectsController.setConfig(setup.getEffectHumanReadable()); EffectsController.setConfig(setup.getEffectHumanReadable());

View file

@ -14,10 +14,11 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class MainFx extends Application { public class MainFx extends Application {
public static final String appVersion = "v1.4"; public static final String appVersion = ResourceBundle.getBundle("app").getString("_version");;
private static boolean traySupport = true; private static boolean traySupport = true;
@ -29,12 +30,9 @@ public class MainFx extends Application {
@Override @Override
public void start(Stage primaryStage) throws Exception{ public void start(Stage primaryStage) throws Exception{
//if (! getParameters().getUnnamed().isEmpty())
// System.out.println(getParameters().getUnnamed().get(0));
AppPreferences appPreferences = new AppPreferences(); AppPreferences appPreferences = new AppPreferences();
if (traySupport) // By default it's enabled, but in case it disabled from CLI, don't touch. if (traySupport) // By default, it's enabled, but in case it disabled from CLI, don't touch.
traySupport = appPreferences.getUseTray(); // Otherwise, check against preferences traySupport = appPreferences.getUseTray(); // Otherwise, check against preferences
//-----------------------Tray support--------------------- //-----------------------Tray support---------------------
this.stage = primaryStage; this.stage = primaryStage;
if (traySupport){ if (traySupport){
@ -54,10 +52,10 @@ public class MainFx extends Application {
Parent root = loader.load(); Parent root = loader.load();
primaryStage.getIcons().addAll( primaryStage.getIcons().addAll(
new Image(getClass().getResourceAsStream("/ico/appIcon_32.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_32.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_48.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_48.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_64.png")), new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_64.png"))),
new Image(getClass().getResourceAsStream("/ico/appIcon_128.png")) new Image(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_128.png")))
); );
// NOTE: tray leftovers // NOTE: tray leftovers
if (traySupport) { if (traySupport) {
@ -106,7 +104,7 @@ public class MainFx extends Application {
tray = SystemTray.getSystemTray(); tray = SystemTray.getSystemTray();
trayIcon = new TrayIcon(ImageIO.read(getClass().getResourceAsStream("/ico/appIcon_24.png"))); trayIcon = new TrayIcon(ImageIO.read(Objects.requireNonNull(getClass().getResourceAsStream("/ico/appIcon_24.png"))));
trayIcon.addActionListener(ActionEvent -> Platform.runLater(this::showStage)); trayIcon.addActionListener(ActionEvent -> Platform.runLater(this::showStage));

View file

@ -0,0 +1 @@
_version=v${project.version}

File diff suppressed because one or more lines are too long

View file

@ -15,7 +15,7 @@
<?import javafx.scene.shape.SVGPath?> <?import javafx.scene.shape.SVGPath?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<BorderPane xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="logiledus.Controllers.KeysLedsController"> <BorderPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="logiledus.Controllers.KeysLedsController">
<top> <top>
<ToolBar BorderPane.alignment="CENTER"> <ToolBar BorderPane.alignment="CENTER">
<items> <items>

View file

@ -132,7 +132,7 @@
.text-area{ .text-area{
-fx-background-color: transparent; -fx-background-color: transparent;
-fx-control-inner-background: #3c3f41; -fx-control-inner-background: #3c3f41;
-fx-border-color: #06b9bb; -fx-border-color: transparent;
-fx-border-radius: 3; -fx-border-radius: 3;
-fx-border-width: 1; -fx-border-width: 1;
-fx-text-fill: #ebebeb; -fx-text-fill: #ebebeb;
@ -362,3 +362,122 @@
.check-box:selected .mark, .check-box:selected:hover .mark{ .check-box:selected .mark, .check-box:selected:hover .mark{
-fx-background-color: #4f4f4f; -fx-background-color: #4f4f4f;
} }
.titled-pane
{
-fx-text-fill: white;
}
.titled-pane:focused
{
-fx-text-fill: white;
}
.titled-pane > .title
{
-fx-background-color: #54585b;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 2 2 2 2;
-fx-padding: 3 11 5 11;
-fx-border-width: 1;
-fx-border-radius: 2 2 2 2;
-fx-border-color: #8c6400;
}
.titled-pane > .content
{
-fx-border-width: 1;
-fx-border-radius: 2 2 2 2;
-fx-border-color: #8c6400;
}
.titled-pane:focused > .title
{
-fx-background-color: #3c3f41;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 2 2 2 2;
-fx-padding: 3 11 5 11;
-fx-border-width: 1;
-fx-border-radius: 2 2 2 2;
-fx-border-color: #8c6400;
}
.titled-pane > .title > .arrow-button
{
-fx-background-color: transparent;
-fx-background-insets: 0;
-fx-background-radius: 0;
-fx-padding: 0 3 0 0;
}
.titled-pane > .title > .arrow-button .arrow
{
-fx-background-color: #575757, #575757;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 3 3.75 3 3.75;
-fx-shape: "M 0 0 h 7 l -3.5 4 z";
}
.titled-pane:collapsed > .title > .arrow-button .arrow
{
-fx-rotate: -90;
}
.titled-pane:focused > .title > .arrow-button .arrow
{
-fx-background-color: white, white;
}
.scroll-bar:horizontal .track,
.scroll-bar:vertical .track{
-fx-background-color :transparent;
-fx-border-color :transparent;
-fx-background-radius : 0.0em;
-fx-border-radius :2.0em;
}
.scroll-bar .increment-arrow,
.scroll-bar .decrement-arrow {
-fx-background-color: #71e016;
}
.scroll-pane > .viewport {
-fx-background-color: transparent;
}
.scroll-pane{
-fx-background-color: #2d2d2d;
}
.scroll-pane > .corner,
.scroll-bar:horizontal,
.scroll-bar:vertical {
-fx-background-color: #2d2d2d;
}
.scroll-bar:horizontal .track,
.scroll-bar:vertical .track,
.scroll-bar:horizontal .decrement-button,
.scroll-bar:vertical .decrement-button,
.scroll-bar:horizontal .increment-button,
.scroll-bar:vertical .increment-button {
-fx-background-color: transparent;
}
.scroll-bar:horizontal .thumb{
-fx-background-color: #06bdc3;
-fx-background-insets: 4 0 4 0;
-fx-background-radius : 5;
}
.scroll-bar:horizontal .thumb:hover{
-fx-background-color: #08f3ff;
-fx-background-insets: 4 0 4 0;
-fx-background-radius : 5;
}
.scroll-bar:vertical .thumb {
-fx-background-color: #06bdc3;
-fx-background-insets: 0 4 0 4;
-fx-background-radius : 5;
}
.scroll-bar:vertical .thumb:hover {
-fx-background-color: #08f3ff;
-fx-background-insets: 0 4 0 4;
-fx-background-radius : 5;
}

View file

@ -707,3 +707,5 @@ setting_cancel=Cancel
open=Open open=Open
setting_use_dark_theme=Use dark theme setting_use_dark_theme=Use dark theme
setting_open_recent_on_start=Open recent configuration file on application start setting_open_recent_on_start=Open recent configuration file on application start
about_ContributorsLbl=Contributors
about_ContributorsContent=Korean translation by DDinghoya: https://github.com/DDinghoya

View file

@ -33,3 +33,4 @@ setting_cancel=\uCDE8\uC18C
open=\uC5F4\uAE30 open=\uC5F4\uAE30
setting_use_dark_theme=\uC5B4\uB450\uC6B4 \uD14C\uB9C8 \uC0AC\uC6A9 setting_use_dark_theme=\uC5B4\uB450\uC6B4 \uD14C\uB9C8 \uC0AC\uC6A9
setting_open_recent_on_start=\uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC2DC\uC791 \uC2DC \uCD5C\uADFC \uAD6C\uC131 \uD30C\uC77C \uC5F4\uAE30 setting_open_recent_on_start=\uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC2DC\uC791 \uC2DC \uCD5C\uADFC \uAD6C\uC131 \uD30C\uC77C \uC5F4\uAE30
about_ContributorsLbl=\uAE30\uC5EC\uC790

View file

@ -33,3 +33,6 @@ setting_save_and_close=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u
open=\u041E\u0442\u043A\u0440\u044B\u0442\u044C open=\u041E\u0442\u043A\u0440\u044B\u0442\u044C
setting_use_dark_theme=\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u0451\u043C\u043D\u0443\u044E \u0442\u0435\u043C\u0443 setting_use_dark_theme=\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u0451\u043C\u043D\u0443\u044E \u0442\u0435\u043C\u0443
setting_open_recent_on_start=\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u043F\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F setting_open_recent_on_start=\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u043F\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F
about_ContributorsContent=\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u043D\u0430 \u043A\u043E\u0440\u0435\u0439\u0441\u043A\u0438\u0439 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D DDinghoya - https://github.com/DDinghoya
about_ContributorsLbl=\u0423\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0438