Skip to content

Commit 7b8afb9

Browse files
committed
Added an about dialog
1 parent 8b2c7af commit 7b8afb9

File tree

10 files changed

+115
-26
lines changed

10 files changed

+115
-26
lines changed

.idea/workspace.xml

Lines changed: 17 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.idaesbasic.controllers
2+
3+
import javafx.event.ActionEvent
4+
import javafx.fxml.FXML
5+
import java.awt.Desktop
6+
import java.net.URI
7+
8+
class AboutDialogController {
9+
10+
@FXML
11+
fun linkClicked(event: ActionEvent) {
12+
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
13+
Desktop.getDesktop().browse(URI("http://github.com/BenHerbst/idaesbasic"))
14+
}
15+
}
16+
17+
}

src/main/java/org/idaesbasic/controllers/MainController.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.nio.file.Paths;
1010
import java.time.LocalDate;
1111
import java.time.LocalTime;
12+
import java.util.Objects;
1213
import java.util.Optional;
1314
import java.util.Timer;
1415
import java.util.TimerTask;
@@ -517,6 +518,14 @@ void openFile(String filename) throws IOException, ParserException {
517518
}
518519
}
519520

521+
@FXML
522+
void showAboutDialogAction(ActionEvent event) throws IOException {
523+
Dialog<ButtonType> aboutDialog = new Dialog<ButtonType>();
524+
aboutDialog.setDialogPane(FXMLLoader.load(Objects.requireNonNull(getClass().getResource("/fxml/dialogs/About.fxml"))));
525+
aboutDialog.setTitle("About Idaesbasic");
526+
aboutDialog.show();
527+
}
528+
520529
void addViewToCurrentTab(Node view) {
521530
get_current_tab().setContent(view);
522531
}

src/main/resources/fxml/MainView.fxml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<?import javafx.scene.text.Font?>
1616
<?import org.kordamp.ikonli.javafx.FontIcon?>
1717

18-
1918
<VBox prefHeight="742.0" prefWidth="1323.0" stylesheets="@../styles/main.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.idaesbasic.controllers.MainController">
2019
<children>
2120
<MenuBar>
@@ -151,7 +150,7 @@
151150
</Menu>
152151
<Menu mnemonicParsing="false" text="Help">
153152
<items>
154-
<MenuItem disable="true" mnemonicParsing="false" text="About">
153+
<MenuItem mnemonicParsing="false" onAction="#showAboutDialogAction" text="About">
155154
<graphic>
156155
<FontIcon iconColor="WHITE" iconLiteral="fa-question-circle" iconSize="16" />
157156
</graphic>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.control.ButtonType?>
5+
<?import javafx.scene.control.DialogPane?>
6+
<?import javafx.scene.control.Hyperlink?>
7+
<?import javafx.scene.image.Image?>
8+
<?import javafx.scene.image.ImageView?>
9+
<?import javafx.scene.layout.VBox?>
10+
<?import javafx.scene.text.Font?>
11+
<?import javafx.scene.text.Text?>
12+
<?import javafx.scene.text.TextFlow?>
13+
<?import org.kordamp.ikonli.javafx.FontIcon?>
14+
15+
16+
<DialogPane stylesheets="@../../styles/dialog.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.idaesbasic.controllers.AboutDialogController">
17+
<content>
18+
<VBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="413.0" prefWidth="600.0">
19+
<children>
20+
<ImageView fitHeight="105.0" fitWidth="112.0" pickOnBounds="true" preserveRatio="true">
21+
<VBox.margin>
22+
<Insets top="30.0" />
23+
</VBox.margin>
24+
<image>
25+
<Image url="@../../img/icon.png" />
26+
</image>
27+
</ImageView>
28+
<Text fill="#9a9a9a" strokeType="OUTSIDE" strokeWidth="0.0" text="Idaesbasic&#10;- Project managment redefined -&#10;by Ben Herbst and Contributors" textAlignment="CENTER">
29+
<font>
30+
<Font size="18.0" />
31+
</font>
32+
<VBox.margin>
33+
<Insets top="20.0" />
34+
</VBox.margin>
35+
</Text>
36+
<Hyperlink onAction="#linkClicked" text="https://github.com/BenHerbst/idaesbasic">
37+
<font>
38+
<Font size="16.0" />
39+
</font>
40+
<VBox.margin>
41+
<Insets top="20.0" />
42+
</VBox.margin>
43+
</Hyperlink>
44+
<TextFlow prefHeight="0.0" prefWidth="600.0" textAlignment="CENTER">
45+
<children>
46+
<Text fill="WHITE" strokeType="OUTSIDE" strokeWidth="0.0" text="Made ">
47+
<font>
48+
<Font size="31.0" />
49+
</font>
50+
</Text>
51+
<Text fill="#c3c3c3" layoutX="10.0" layoutY="10.0" strokeType="OUTSIDE" strokeWidth="0.0" text="with ">
52+
<font>
53+
<Font size="29.0" />
54+
</font>
55+
</Text>
56+
<FontIcon iconColor="RED" iconLiteral="fa-heart" iconSize="35" />
57+
</children>
58+
<VBox.margin>
59+
<Insets top="40.0" />
60+
</VBox.margin>
61+
</TextFlow>
62+
</children>
63+
</VBox>
64+
</content>
65+
<buttonTypes>
66+
<ButtonType fx:constant="CLOSE" />
67+
</buttonTypes>
68+
</DialogPane>

src/main/resources/fxml/views/kanban/KanbanView.fxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
<HBox fx:id="boardsContainer" prefHeight="0.0" prefWidth="0.0" spacing="20.0" />
1919
<HBox alignment="TOP_CENTER" maxWidth="-Infinity" minWidth="-Infinity" prefHeight="358.0" prefWidth="162.0">
2020
<children>
21-
<TextField fx:id="addRowTextField" onKeyPressed="#textFieldKeyPressed">
21+
<TextField fx:id="addRowTextField" onKeyPressed="#textFieldKeyPressed" prefHeight="25.0" prefWidth="192.0" style="-fx-background-radius: 50 0 0 50;">
2222
<HBox.margin>
23-
<Insets right="10.0" />
23+
<Insets />
2424
</HBox.margin></TextField>
25-
<Button mnemonicParsing="false" onAction="#addNewRowAction" prefHeight="26.0" prefWidth="0.0" textFill="WHITE">
25+
<Button mnemonicParsing="false" onAction="#addNewRowAction" prefHeight="19.0" prefWidth="26.0" style="-fx-background-radius: 0 50 50 0;" textFill="WHITE">
2626
<graphic>
2727
<FontIcon iconColor="#b5b5b5" iconLiteral="fa-plus" />
2828
</graphic>

src/main/resources/img/icon.png

6.62 KB
Loading

t.knbn

Whitespace-only changes.

test.ics

Lines changed: 0 additions & 12 deletions
This file was deleted.

test.knbn

Whitespace-only changes.

0 commit comments

Comments
 (0)