Skip to content

Commit

Permalink
Version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
srilakshmikanthanp committed Oct 17, 2021
1 parent 95f79b7 commit 2422c00
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 4,393 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.srilakshmikanthanp.quicknote</groupId>
<artifactId>quicknote</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ private Node getTopBar(Stage pStage) {
*/
public MainPane(Stage pStage) {
// add navigation
this.setId("qnote-main-pane");
this.setLeft(this.getNavigator());
this.innerPane.setTop(this.getTopBar(pStage));
this.setSection(this.navSections.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ private VBox getContentPane() {
);
var themesList = new ChoiceBox<String>(
FXCollections.observableArrayList(
Prefs.MODENA_THEME,
Prefs.CASPIAN_THEME,
Prefs.BOLDDARK_THEME
Prefs.LIGHT_THEME,
Prefs.DARK_THEME
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javafx.scene.layout.*;
import javafx.scene.control.*;
import javafx.scene.input.*;
import javafx.scene.paint.Color;

import java.io.*;

Expand Down Expand Up @@ -103,7 +104,7 @@ private void updatePrefs(String key) {
*/
public Editor() {
// Stage Preerties
this.initStyle(StageStyle.UNDECORATED);
this.initStyle(StageStyle.TRANSPARENT);
this.initOwner(this.getEmptyStage());

// create things
Expand All @@ -121,13 +122,14 @@ public Editor() {
Prefs.setText(newVal);
});
textArea.getStyleClass().add("qnote-focus-color-none");
textArea.setPadding(new Insets(6, 6, 0, 6));
textArea.setPromptText("Place your text here");
textArea.setWrapText(true);

borderPane.setId("qnote-editor");
borderPane.setCenter(textArea);
borderPane.setPadding(new Insets(12, 7, 7, 7));
borderPane.setPadding(new Insets(10, 5, 5, 5));

scene.setFill(Color.TRANSPARENT);

// Focus Event
this.focusedProperty().addListener((obs, isLost, isGain) -> {
Expand Down Expand Up @@ -156,9 +158,10 @@ public Editor() {
this.setMaxWidth(Prefs.MAX_WIDTH);
this.setMaxHeight(Prefs.MAX_HEIGHT);
this.setAlwaysOnTop(true);
new Resizer(this, 10, 7);
Helper.setTheme(scene);

new Resizer(this, 10, 5);

// add Event Listener to preference
Prefs.prefs.addPreferenceChangeListener(e -> {
Platform.runLater(() -> this.updatePrefs(e.getKey()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.image.*;
import javafx.scene.paint.Color;

import javax.swing.*;

Expand All @@ -26,7 +27,7 @@ public class QuickNote extends Application {
*/
private void stageInitilizer(Stage pStage) {
// init primary stage
pStage.initStyle(StageStyle.UNDECORATED);
pStage.initStyle(StageStyle.TRANSPARENT);
pStage.getIcons().add(
new Image(getClass().getResource("/images/logo.png").toExternalForm())
);
Expand All @@ -39,6 +40,8 @@ private void stageInitilizer(Stage pStage) {
mainPane, Helper.MIN_WIN_WIDTH, Helper.MIN_WIN_HEIGHT
);

scene.setFill(Color.TRANSPARENT);

pStage.setScene(scene);
}

Expand All @@ -49,10 +52,12 @@ private void stageInitilizer(Stage pStage) {
public void start(Stage pStage) throws Exception {
// init
this.stageInitilizer(pStage);
new Resizer(pStage, 10, 7);
Helper.setTheme(pStage.getScene());
pStage.setMinWidth(Helper.MIN_WIN_WIDTH);
pStage.setMinHeight(Helper.MIN_WIN_HEIGHT);

// add Resizer
new Resizer(pStage, 10, 7);

// init Editor stage
var eStage = new Editor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Quick Note System Tray onle from awt thread
*/
public class Tray extends MouseInputAdapter {
public class Tray {
/**
* SystemTRay
*/
Expand Down Expand Up @@ -135,7 +135,14 @@ public Tray(Stage pStage, Editor eStage) {
exit.addActionListener(
e -> this.exit()
);
this.trayIcon.addMouseListener(this);
this.trayIcon.addMouseListener(new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
Tray.this.showEditor(e.getX(), e.getY());
}
}
});

// init tray
this.trayIcon.setImageAutoSize(true);
Expand All @@ -144,14 +151,4 @@ public Tray(Stage pStage, Editor eStage) {
// Add to system tray
this.addToTray();
}

/**
* Listener for mouse click
*/
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
this.showEditor(e.getX(), e.getY());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,22 @@ public static boolean isAppRunning() {
* set theme to scene
*/
public static void setTheme(Scene scene) {
scene.getStylesheets().clear();
scene.getStylesheets().add(
Helper.class.getResource(
"/styles/" + Prefs.getTheme() + ".css"
).toExternalForm()
var prefsTheme = Helper.class.getResource(
"/styles/" + Prefs.getTheme() + ".css"
);
var defltTheme = Helper.class.getResource(
"/styles/" + Prefs.DEFAULT_THEME + ".css"
);
var sceneStyle = scene.getStylesheets();

scene.getStylesheets().clear();

if(prefsTheme != null) {
sceneStyle.add(prefsTheme.toExternalForm());
return;
}

Prefs.setTheme(Prefs.DEFAULT_THEME);
sceneStyle.add(defltTheme.toExternalForm());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ public static double getWidth() {
/********************************************************/

public static final String THEME_PREF_KEY = "THEME";
public static final String MODENA_THEME = "Modena";
public static final String CASPIAN_THEME = "Caspian";
public static final String BOLDDARK_THEME = "BoldDark";
public static final String DEFAULT_THEME = MODENA_THEME;
public static final String LIGHT_THEME = "Light";
public static final String DARK_THEME = "Dark";
public static final String DEFAULT_THEME = DARK_THEME;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* https://opensource.org/licenses/MIT
*/

@import url("./base_themes/BoldDark.css");
@import url("./base_themes/Dark.css");

/**
* Close Button
Expand Down Expand Up @@ -86,7 +86,13 @@
/**
* Editor
*/
#qnote-editor {
-fx-background-radius: 10;
}

#qnote-editor .text-area {
-fx-background-radius: 10;
-fx-border-radius: 15;
-fx-prompt-text-fill: gray;
-fx-control-inner-background: #1a1a1a;
-fx-border-color: transparent;
Expand All @@ -95,3 +101,13 @@
-fx-text-fill: white;
-fx-font-size: 1.1em;
}

#qnote-editor .text-area .scroll-pane {
-fx-background-color: transparent;
}
#qnote-editor .text-area .scroll-pane .viewport{
-fx-background-color: transparent;
}
#qnote-editor .text-area .scroll-pane .content{
-fx-background-color: transparent;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* https://opensource.org/licenses/MIT
*/

@import url("./base_themes/Modena.css");
@import url("./base_themes/Light.css");

/**
* Close Button
Expand All @@ -27,8 +27,8 @@
}

/**
* siz Button
*/
* siz Button
*/
#qnote-size-btn {
-fx-border-color: transparent;
-fx-border-width: 0;
Expand All @@ -45,8 +45,8 @@
}

/**
* min Button
*/
* min Button
*/
#qnote-mini-btn {
-fx-border-color: transparent;
-fx-border-width: 0;
Expand Down Expand Up @@ -79,7 +79,12 @@
/**
* Editor
*/
#qnote-editor {
-fx-background-radius: 10;
}

#qnote-editor .text-area {
-fx-background-radius: 10;
-fx-font-size: 1.1em;
-fx-border-color: transparent;
-fx-focus-color: transparent;
Expand Down
Loading

0 comments on commit 2422c00

Please sign in to comment.