Skip to content

Commit c74344e

Browse files
ddamkeddamke
authored andcommitted
add scroll pane and some css changes
1 parent deb61f2 commit c74344e

File tree

3 files changed

+109
-94
lines changed

3 files changed

+109
-94
lines changed

src/main/java/de/doubleslash/keeptime/viewpopup/GlobalScreenListener.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.logging.Level;
2525
import java.util.logging.Logger;
2626

27+
import de.doubleslash.keeptime.common.OS;
2728
import org.jnativehook.GlobalScreen;
2829
import org.jnativehook.NativeHookException;
2930
import org.jnativehook.keyboard.NativeKeyEvent;
@@ -65,11 +66,12 @@ public class GlobalScreenListener implements NativeKeyListener, NativeMouseMotio
6566
private Point mouseLocation = new Point(0, 0);
6667

6768
public GlobalScreenListener() {
69+
if (!OS.isLinux()) {
70+
disableJNativeHookLogger();
6871

69-
disableJNativeHookLogger();
70-
71-
GlobalScreen.addNativeKeyListener(this);
72-
GlobalScreen.addNativeMouseMotionListener(this);
72+
GlobalScreen.addNativeKeyListener(this);
73+
GlobalScreen.addNativeMouseMotionListener(this);
74+
}
7375
}
7476

7577
public void register(final boolean register) {

src/main/resources/css/settingsv2.css

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
-fx-border-color: lightgrey;
44
-fx-border-style: hidden hidden solid hidden;
55
-fx-spacing: 5px;
6-
-fx-padding: 0 0 5 0;
7-
6+
-fx-padding: 0 0 5 0;
87

98
}
9+
1010
.saveCancelHboxBorder{
1111

1212
-fx-border-color: lightgrey;
@@ -16,6 +16,7 @@
1616

1717
}
1818

19+
1920
.tab-pane .tab-header-area .tab-header-background {
2021
-fx-opacity: 0;
2122
-fx-background-color: white;
@@ -30,6 +31,15 @@
3031
-fx-pref-height: 100;
3132
-fx-pref-width: 70;
3233
}
34+
.anchorPane{
35+
-fx-background-color: white;
36+
}
37+
.scroll-pane{
38+
-fx-background-color: white;
39+
}
40+
.scroll-bar:vertical{
41+
-fx-background-color:white;
42+
}
3343

3444
.tab-pane .tab .HBox{
3545
-fx-spacing: 5;
@@ -41,6 +51,12 @@
4151
-fx-border-color: none;
4252
}
4353
.tab-pane .tab:selected
54+
{
55+
-fx-border-width: 2;
56+
-fx-border-color: blue;
57+
-fx-border-style: solid hidden hidden hidden;
58+
}
59+
.tab-pane .tab:hover
4460
{
4561
-fx-background-color: lightgrey;
4662
}

src/main/resources/layouts/settings.fxml

Lines changed: 85 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<?import javafx.scene.control.ColorPicker?>
2525
<?import javafx.scene.control.Hyperlink?>
2626
<?import javafx.scene.control.Label?>
27+
<?import javafx.scene.control.ScrollPane?>
2728
<?import javafx.scene.control.Tab?>
2829
<?import javafx.scene.control.TabPane?>
2930
<?import javafx.scene.control.TableView?>
@@ -37,13 +38,13 @@
3738
<?import javafx.scene.text.Font?>
3839
<?import javafx.scene.text.Text?>
3940

40-
<AnchorPane fx:id="settingsRoot" focusTraversable="true" prefHeight="551.0" prefWidth="606.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.SettingsController">
41+
<AnchorPane fx:id="settingsRoot" focusTraversable="true" prefHeight="448.0" prefWidth="606.0" style="-fx-background-color: white;" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.SettingsController">
4142
<children>
42-
<TabPane prefHeight="516.0" prefWidth="606.0" side="LEFT" stylesheets="@../css/settingsv2.css" tabClosingPolicy="UNAVAILABLE" tabMinHeight="100.0" tabMinWidth="40.0">
43+
<TabPane layoutY="6.0" prefHeight="393.0" prefWidth="606.0" side="LEFT" stylesheets="@../css/settingsv2.css" tabClosingPolicy="UNAVAILABLE" tabMinHeight="100.0" tabMinWidth="40.0">
4344
<tabs>
4445
<Tab closable="false">
4546
<content>
46-
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="436.0">
47+
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="475.0" prefWidth="501.0">
4748
<children>
4849
<VBox layoutX="20.0" layoutY="20.0" prefHeight="393.0" prefWidth="486.0" spacing="5.0" styleClass="menuBorder">
4950
<children>
@@ -58,11 +59,7 @@
5859
</Label>
5960
<HBox spacing="10.0">
6061
<children>
61-
<Label alignment="TOP_LEFT" contentDisplay="TOP" prefWidth="100.0" text="Background">
62-
<font>
63-
<Font name="Open Sans Regular" size="12.0" />
64-
</font>
65-
</Label>
62+
<Label alignment="TOP_LEFT" contentDisplay="TOP" prefWidth="100.0" text="Background" />
6663
<ColorPicker fx:id="defaultBackgroundColor" />
6764
<Button fx:id="resetDefaultBackgroundButton" mnemonicParsing="false" text="Reset">
6865
<font>
@@ -73,11 +70,7 @@
7370
</HBox>
7471
<HBox spacing="10.0">
7572
<children>
76-
<Label alignment="TOP_LEFT" contentDisplay="TOP" prefWidth="100.0" text="Font">
77-
<font>
78-
<Font name="Open Sans Regular" size="12.0" />
79-
</font>
80-
</Label>
73+
<Label alignment="TOP_LEFT" contentDisplay="TOP" prefWidth="100.0" text="Font" />
8174
<ColorPicker fx:id="defaultFontColor" />
8275
<Button fx:id="resetDefaultFontButton" mnemonicParsing="false" text="Reset">
8376
<font>
@@ -388,81 +381,6 @@
388381
</HBox>
389382
</graphic>
390383
</Tab>
391-
<Tab>
392-
<content>
393-
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
394-
<children>
395-
<Pane fx:id="mainContainer" layoutX="-20.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="492.0" prefWidth="478.0">
396-
<children>
397-
<Label fx:id="keepTimeLabel" layoutX="197.0" layoutY="11.0" text="KeepTime">
398-
<font>
399-
<Font name="Open Sans Regular" size="26.0" />
400-
</font>
401-
</Label>
402-
<Line fx:id="bigLine" endX="497.0" endY="111.0" fill="BLACK" layoutX="-23.0" layoutY="-39.0" smooth="false" startX="62.0" startY="111.0" strokeWidth="2.0" />
403-
<Label fx:id="versionLabel" layoutX="39.0" layoutY="92.0" text="Version:">
404-
<font>
405-
<Font name="Open Sans Regular" size="14.0" />
406-
</font>
407-
</Label>
408-
<Label fx:id="copyrightLabel" layoutX="39.0" layoutY="130.0" text="Copyright (c) doubleSlash Net-Business GmbH">
409-
<font>
410-
<Font name="Open Sans Regular" size="14.0" />
411-
</font>
412-
</Label>
413-
<Label fx:id="openSourceLabel" layoutX="39.0" layoutY="168.0" prefHeight="20.0" prefWidth="360.0" text="KeepTime is open source software, licensed under the">
414-
<font>
415-
<Font name="Open Sans Regular" size="14.0" />
416-
</font>
417-
</Label>
418-
<Hyperlink fx:id="gitHubHyperlink" focusTraversable="false" layoutX="34.0" layoutY="206.0" text="https://www.github.com/doubleSlashde/KeepTime" underline="true">
419-
<font>
420-
<Font name="Open Sans Regular" size="14.0" />
421-
</font>
422-
</Hyperlink>
423-
<Line fx:id="smallLine" endX="497.0" endY="273.0" layoutX="-23.0" layoutY="1.0" startX="62.0" startY="273.0" strokeWidth="2.0" />
424-
<Label fx:id="thirdPartyLabel" layoutX="39.0" layoutY="281.0" text="third party software">
425-
<font>
426-
<Font name="Open Sans Regular" size="14.0" />
427-
</font>
428-
</Label>
429-
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="396.0" layoutY="237.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="80" text="Report" />
430-
<Pane layoutX="280" layoutY="227" maxHeight="50.0" maxWidth="135.0" minHeight="50.0" minWidth="50.0" prefHeight="50.0" prefWidth="135.0">
431-
<children>
432-
<Label contentDisplay="CENTER" layoutY="-5.0" maxHeight="60.0" maxWidth="1.7976931348623157E308" minHeight="50.0" minWidth="50.0" prefHeight="60.0" prefWidth="107.0" text="Found a Bug ?" />
433-
<SVGPath fx:id="bugIcon" layoutX="-160.0" layoutY="-231.0" scaleX="0.04" scaleY="0.04" />
434-
</children>
435-
</Pane>
436-
<TableView fx:id="licenseTableView" focusTraversable="false" layoutX="39.0" layoutY="302.0" prefHeight="182.0" prefWidth="417.0" />
437-
<Label fx:id="versionNumberLabel" layoutX="97.0" layoutY="92.0" text="1.0.0">
438-
<font>
439-
<Font name="Open Sans Regular" size="14.0" />
440-
</font>
441-
</Label>
442-
<Hyperlink fx:id="ourLicenseHyperLink" layoutX="34.0" layoutY="182.0" text="GPL Version 3.0">
443-
<font>
444-
<Font name="Open Sans Regular" size="14.0" />
445-
</font>
446-
</Hyperlink>
447-
<Label layoutX="143.0" layoutY="186.0" text=". Check out our GitHub page:">
448-
<font>
449-
<Font name="Open Sans Regular" size="14.0" />
450-
</font>
451-
</Label>
452-
</children>
453-
</Pane>
454-
</children>
455-
</AnchorPane>
456-
</content>
457-
<graphic>
458-
<HBox styleClass="HBox" stylesheets="@../css/settingsv2.css">
459-
<children>
460-
<Region fx:id="aboutIcon" prefHeight="25.0" prefWidth="25.0" />
461-
<Label prefWidth="75.0" text="About" />
462-
</children>
463-
</HBox>
464-
</graphic>
465-
</Tab>
466384
<Tab>
467385
<content>
468386
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="489.0" prefWidth="452.0">
@@ -527,6 +445,85 @@
527445
</HBox>
528446
</graphic>
529447
</Tab>
448+
<Tab>
449+
<content>
450+
<ScrollPane fitToWidth="true" styleClass="ScrollPane" stylesheets="@../css/settingsv2.css">
451+
<content>
452+
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="446.0" prefWidth="501.0" styleClass="anchorPane" stylesheets="@../css/settingsv2.css">
453+
<children>
454+
<Pane fx:id="mainContainer" layoutX="-20.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="492.0" prefWidth="478.0" styleClass="tab-pane" stylesheets="@../css/settingsv2.css">
455+
<children>
456+
<Label fx:id="keepTimeLabel" layoutX="197.0" layoutY="11.0" text="KeepTime">
457+
<font>
458+
<Font name="Open Sans Regular" size="26.0" />
459+
</font>
460+
</Label>
461+
<Line fx:id="bigLine" endX="497.0" endY="111.0" fill="BLACK" layoutX="-23.0" layoutY="-39.0" smooth="false" startX="62.0" startY="111.0" strokeWidth="2.0" />
462+
<Label fx:id="versionLabel" layoutX="39.0" layoutY="92.0" text="Version:">
463+
<font>
464+
<Font name="Open Sans Regular" size="14.0" />
465+
</font>
466+
</Label>
467+
<Label fx:id="copyrightLabel" layoutX="39.0" layoutY="130.0" text="Copyright (c) doubleSlash Net-Business GmbH">
468+
<font>
469+
<Font name="Open Sans Regular" size="14.0" />
470+
</font>
471+
</Label>
472+
<Label fx:id="openSourceLabel" layoutX="39.0" layoutY="168.0" prefHeight="20.0" prefWidth="360.0" text="KeepTime is open source software, licensed under the">
473+
<font>
474+
<Font name="Open Sans Regular" size="14.0" />
475+
</font>
476+
</Label>
477+
<Hyperlink fx:id="gitHubHyperlink" focusTraversable="false" layoutX="34.0" layoutY="206.0" text="https://www.github.com/doubleSlashde/KeepTime" underline="true">
478+
<font>
479+
<Font name="Open Sans Regular" size="14.0" />
480+
</font>
481+
</Hyperlink>
482+
<Line fx:id="smallLine" endX="497.0" endY="273.0" layoutX="-23.0" layoutY="1.0" startX="62.0" startY="273.0" strokeWidth="2.0" />
483+
<Label fx:id="thirdPartyLabel" layoutX="39.0" layoutY="281.0" text="third party software">
484+
<font>
485+
<Font name="Open Sans Regular" size="14.0" />
486+
</font>
487+
</Label>
488+
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="396.0" layoutY="237.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="80" text="Report" />
489+
<Pane layoutX="280" layoutY="227" maxHeight="50.0" maxWidth="135.0" minHeight="50.0" minWidth="50.0" prefHeight="50.0" prefWidth="135.0">
490+
<children>
491+
<Label contentDisplay="CENTER" layoutY="-5.0" maxHeight="60.0" maxWidth="1.7976931348623157E308" minHeight="50.0" minWidth="50.0" prefHeight="60.0" prefWidth="107.0" text="Found a Bug ?" />
492+
<SVGPath fx:id="bugIcon" layoutX="-160.0" layoutY="-231.0" scaleX="0.04" scaleY="0.04" />
493+
</children>
494+
</Pane>
495+
<TableView fx:id="licenseTableView" focusTraversable="false" layoutX="39.0" layoutY="302.0" prefHeight="182.0" prefWidth="417.0" />
496+
<Label fx:id="versionNumberLabel" layoutX="97.0" layoutY="92.0" text="1.0.0">
497+
<font>
498+
<Font name="Open Sans Regular" size="14.0" />
499+
</font>
500+
</Label>
501+
<Hyperlink fx:id="ourLicenseHyperLink" layoutX="34.0" layoutY="182.0" text="GPL Version 3.0">
502+
<font>
503+
<Font name="Open Sans Regular" size="14.0" />
504+
</font>
505+
</Hyperlink>
506+
<Label layoutX="143.0" layoutY="186.0" text=". Check out our GitHub page:">
507+
<font>
508+
<Font name="Open Sans Regular" size="14.0" />
509+
</font>
510+
</Label>
511+
</children>
512+
</Pane>
513+
</children>
514+
</AnchorPane>
515+
</content>
516+
</ScrollPane>
517+
</content>
518+
<graphic>
519+
<HBox styleClass="HBox" stylesheets="@../css/settingsv2.css">
520+
<children>
521+
<Region fx:id="aboutIcon" prefHeight="25.0" prefWidth="25.0" />
522+
<Label prefWidth="75.0" text="About" />
523+
</children>
524+
</HBox>
525+
</graphic>
526+
</Tab>
530527
</tabs>
531528
<styleClass>
532529
<String fx:value="tab-header-area" />

0 commit comments

Comments
 (0)