Skip to content

Commit

Permalink
For Win 11
Browse files Browse the repository at this point in the history
  • Loading branch information
srilakshmikanthanp committed Nov 3, 2021
1 parent 2422c00 commit 8583882
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Binary file modified assets/images/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public Editor() {
this.setMaxWidth(Prefs.MAX_WIDTH);
this.setMaxHeight(Prefs.MAX_HEIGHT);
this.setAlwaysOnTop(true);

Helper.setTheme(scene);

new Resizer(this, 10, 5);
Expand All @@ -175,19 +176,20 @@ public void showOnPosition(double x, double y) {
var rect2D = Screen.getPrimary().getVisualBounds();
var scaleX = Screen.getPrimary().getOutputScaleX();
var scaleY = Screen.getPrimary().getOutputScaleY();
var margin = 15;
var pCalcX = x / scaleX - (this.getWidth() / 2);
var pCalcY = y / scaleY - (this.getHeight() / 2);

if (pCalcX < rect2D.getMinX()) {
pCalcX = rect2D.getMinX();
pCalcX = rect2D.getMinX() + margin;
} else if (pCalcX + this.getWidth() > rect2D.getMaxX()) {
pCalcX = rect2D.getMaxX() - this.getWidth();
pCalcX = rect2D.getMaxX() - this.getWidth() - margin;
}

if (pCalcY < rect2D.getMinY()) {
pCalcY = rect2D.getMinY();
pCalcY = rect2D.getMinY() + margin;
} else if (pCalcY + this.getHeight() > rect2D.getMaxY()) {
pCalcY = rect2D.getMaxY() - this.getHeight();
pCalcY = rect2D.getMaxY() - this.getHeight() - margin;
}

this.show();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/quicknote.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=${project.version}
artifactId=${project.artifactId}
artifactId=${project.artifactId}
1 change: 1 addition & 0 deletions src/main/resources/styles/Dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
*/
#qnote-editor {
-fx-background-radius: 10;
-fx-background-color: #1f1e1e;
}

#qnote-editor .text-area {
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/styles/Light.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
*/
#qnote-editor {
-fx-background-radius: 10;
-fx-background-color: #ebd5d5;
}

#qnote-editor .text-area {
Expand All @@ -89,4 +90,7 @@
-fx-border-color: transparent;
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
-fx-control-inner-background: #EEEEEE;
-fx-prompt-text-fill: gray;
-fx-text-fill: black;
}

0 comments on commit 8583882

Please sign in to comment.