Skip to content
Snippets Groups Projects
Commit 0c6b074e authored by Guransh Khurana's avatar Guransh Khurana
Browse files

Working on the darkmode stylesheet

parent 2eb41660
No related branches found
No related tags found
3 merge requests!34All additional functionalities added,!33Added theme and image support functionality to the note app,!32Draft: Dark theme main serverless
Pipeline #90280 passed
This commit is part of merge request !33. Comments created here will be created in the context of that merge request.
......@@ -25,7 +25,7 @@ dependencies {
implementation project(':utilities')
testImplementation 'org.jetbrains.kotlin:kotlin-test'
implementation 'org.xerial:sqlite-jdbc:3.30.1'
implementation 'org.xerial:sqlite-jdbc:3.39.3.0'
implementation("org.slf4j:slf4j-simple:1.6.1")
......
No preview for this file type
......@@ -268,15 +268,18 @@ class TextWindow(): Application() {
stage.scene = Scene(box, 300.0, 300.0)
dark.setOnAction {
if (!isDarkMode) {
toggleDarkMode(textarea, isDarkMode)
toggleDarkMode(stage.scene, textarea, isDarkMode)
isDarkMode = !isDarkMode
}
}
light.setOnAction {
if (isDarkMode) {
toggleDarkMode(textarea, isDarkMode)
toggleDarkMode(stage.scene, textarea, isDarkMode)
isDarkMode = !isDarkMode
}
}
......
......@@ -13,17 +13,21 @@ import javafx.scene.text.Font
import javafx.scene.web.HTMLEditor
import javax.swing.text.html.StyleSheet
fun toggleDarkMode(editor: HTMLEditor, isDarkMode: Boolean) {
fun toggleDarkMode(scene: Scene, editor: HTMLEditor, isDarkMode: Boolean) {
//val darktheme: StyleSheet = StyleSheet(false, "notes/multi/utilities/darktheme.css")
if (isDarkMode) {
//note.text.toString(). = Color.WHITE
//scene.root.style = "-fx-background-color: ${Color.BLACK.toString().replace("0x", "#")}; -fx-text-fill: ${Color.WHITE.toString().replace("0x", "#")}"
editor.style = "-fx-background-color: white;"
editor.htmlText = "<body style='background-color: white;'" + editor.htmlText + "/>"
} else {
//note.text = Color.BLACK
//scene.root.style = "-fx-background-color: ${Color.WHITE.toString().replace("0x", "#")}; -fx-text-fill: ${Color.BLACK.toString().replace("0x", "#")}"
editor.style = "-fx-background-color: black;"
editor.htmlText = "<body style='background-color: black;'" + editor.htmlText + "/>"
editor.style = "-fx-background-color: black"
scene.stylesheets.add("darktheme.css")
}
//isDarkMode = !isDarkMode
}
\ No newline at end of file
.html-editor .top-toolbar {
-fx-background-color: #292929;
}
.html-editor .bottom-toolbar {
-fx-background-color: #292929;
}
.html-editor .button, .html-editor .toggle-button, .html-editor .color-picker {
-fx-background-color: #292929;
-fx-border-color: #E0E0E0;
}
/*Combo Boxes*/
.html-editor .combo-box {
/*-fx-background-color: #292929;
-fx-border-color: #E0E0E0;
-fx-text-fill: #E0E0E0;
-fx-background-radius: 0;*/
-fx-border-insets: 0 0 -1 0;
-fx-border-width: 1;
-fx-border-color: #E0E0E0;
-fx-background-color: #292929;
}
.combo-box .list-cell:selected{
-fx-background-color: #292929;
}
.combo-box .list-cell:hover{
-fx-background-color: #EEAE4D;
-fx-text-fill: #121212;
}
/*.combo-box:hover{
-fx-border-color: #222222;
-fx-background-color: #3E3E40;
}*/
/*.combo-box:focused{
-fx-border-color: #4e4e4e;
-fx-background-color: #1A1A1A;
}*/
/*.combo-box-base .arrow-button {
-fx-padding: 0 6;
}*/
.combo-box-base .arrow-button .arrow {
-fx-background-color: #E0E0E0;
}
/*.combo-box .list-view{
-fx-background-radius: 0;
-fx-background-color: #1A1A1A;
background-color: #1A1A1A;
-fx-border-width: 0;
border-width: 0;
-fx-padding: 1;
padding: 1;
}*/
/*List Cells*/
.list-cell{
-fx-text-fill: #E0E0E0;
-fx-background-color: #292929;
}
/*.list-cell:hover{
-fx-background-color: #3E3E40;
}*/
/*.list-cell:pressed{
-fx-background-color: #3E3E40;
}*/
/*.list-cell:selected{
-fx-background-color: #E0E0E0;
}*/
/*ListView*/
.list-view{
-fx-background-color: #292929;
}
/*.list-view .scroll-bar{
-fx-background-insets: 0 -1 0 0;
}*/
/*Buttons*/
.button {
-fx-background-color: #292929;
-fx-border-color: #E0E0E0;
}
.button:hover{
-fx-border-color: #222222;
-fx-background-color: #E0E0E0;
}
.button:pressed{
-fx-border-color: #474747;
-fx-background-color: #474747;
}
/*ScrollBar*/
.scroll-bar{
-fx-background-color: #292929;
}
.scroll-bar .decrement-button, .scroll-bar .increment-button{
-fx-background-color: #292929;
}
.scroll-bar .decrement-button:hover, .scroll-bar .increment-button:hover{
-fx-background-color: #EEAE4D;
-fx-text-fill: #121212;
}
.scroll-bar .increment-arrow, .scroll-bar .decrement-arrow {
-fx-background-color: #121212;
}
.scroll-bar .thumb {
-fx-background-color: #121212;
}
/*Tooltip*/
.tooltip{
-fx-text-fill: #121212;
-fx-background-color: #E0E0E0;
}
/*ColorPicker*/
.color-picker {
-fx-background-color: #292929;
-fx-border-color: #E0E0E0;
}
.color-picker .arrow-button .arrow {
-fx-background-color: #E0E0E0;
}
/*ColorPalette*/
.color-palette{
-fx-background-color: #292929;
-fx-spacing: 15px;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 0 6 6 6, 0 5 5 5, 0 4 4 4;
-fx-padding: 15 15 15 15;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 8, 0.0 , 0 , 0 );
}
.color-palette > .color-picker-grid > .color-square > .color-rect {
-fx-stroke: black;
-fx-stroke-width: 0.4;
-fx-border-color: black;
}
.color-palette > .color-picker-grid {
-fx-border-color: transparent;
}
.color-palette > .color-picker-grid > .color-square {
-fx-background-color: transparent;
-fx-background-insets: -1, 0;
-fx-padding: 0.5;
-fx-border: black;
}
.color-palette-region > .color-square.hover-square {
-fx-background-color: #EEAE4D;
-fx-border-color: #EEAE4D;
-fx-background-insets: -1;
-fx-padding: 0;
}
.color-palette .separator .line {
-fx-background-color: #121212;
-fx-border-color: #121212;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment