Comments (9)
You could do that already with a script.
https://www.qownnotes.org/scripting/methods-and-objects.html#add-a-custom-stylesheet
QOwnNotes/src/libraries/qdarkstyle/style.qss
Lines 50 to 51 in db8a0e4
from qownnotes.
The feature request is about making that themeable too, as is changing dynamically with the theme.
Can a script access current theme colors? Could you set selected-background-color to say current theme foreground color? If yes: I agree scripting can semi-solve this. If no: Hardcoding a script to go along with a theme is not what I had in mind.
Edit: I've experimented a bit with theme and script.
Updated theme to match Dracula colors
[Export]
SchemaKey=EditorColorSchema-7d6d6248-e1c7-4d2a-b308-32c549c31e88
[EditorColorSchema-7d6d6248-e1c7-4d2a-b308-32c549c31e88]
BackgroundColorEnabled_-1=true
BackgroundColorEnabled_0=false
BackgroundColorEnabled_1=true
BackgroundColorEnabled_11=false
BackgroundColorEnabled_12=false
BackgroundColorEnabled_13=false
BackgroundColorEnabled_14=false
BackgroundColorEnabled_15=false
BackgroundColorEnabled_16=false
BackgroundColorEnabled_17=false
BackgroundColorEnabled_18=false
BackgroundColorEnabled_19=true
BackgroundColorEnabled_2=true
BackgroundColorEnabled_21=false
BackgroundColorEnabled_22=false
BackgroundColorEnabled_23=true
BackgroundColorEnabled_24=false
BackgroundColorEnabled_25=true
BackgroundColorEnabled_3=false
BackgroundColorEnabled_4=true
BackgroundColorEnabled_8=false
BackgroundColorEnabled_9=false
BackgroundColor_-1=@Variant(\0\0\0\x43\x1\xff\xff((**66\0\0)
BackgroundColor_0=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xf8\xf8\xef\xef\0\0)
BackgroundColor_1=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xf2\xf2\xe4\xe4\0\0)
BackgroundColor_11=@Variant(\0\0\0\x43\x1\xff\xff\xaa\xaa\xf7\xf7\xff\xff\0\0)
BackgroundColor_12=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_13=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_14=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_15=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_16=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_17=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xf1\xf1\xf4\xf4\0\0)
BackgroundColor_18=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc\xe9\xe9OO\0\0)
BackgroundColor_19=@Variant(\0\0\0\x43\x1\xff\xff\xe2\xe2\xe7\xe7\xe2\xe2\0\0)
BackgroundColor_2=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xf2\xf2\xe4\xe4\0\0)
BackgroundColor_21=@Variant(\0\0\0\x43\x1\xff\xff\xeb\xeb\xeb\xeb\xeb\xeb\0\0)
BackgroundColor_22=@Variant(\0\0\0\x43\x1\xff\xff\xf7\xf7\xf6\xf6\xff\xff\0\0)
BackgroundColor_23=@Variant(\0\0\0\x43\x1\xff\xff((**66\0\0)
BackgroundColor_24=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)
BackgroundColor_25=@Variant(\0\0\0\x43\x1\xff\xff\x44\x44GGZZ\0\0)
BackgroundColor_28=@Variant(\0\0\0\x43\x1\xff\xff\x44\x44GGZZ\0\0)
BackgroundColor_3=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)
BackgroundColor_4=@Variant(\0\0\0\x43\x1\xff\xff((**66\0\0)
BackgroundColor_8=@Variant(\0\0\0\x43\x1\xff\xff\xdb\xdb\xf9\xf9\xe5\xe5\0\0)
BackgroundColor_9=@Variant(\0\0\0\x43\x1\xff\xff\xba\xba\xbd\xbd\xb6\xb6\0\0)
Bold_12=true
Bold_13=true
Bold_14=true
Bold_15=true
Bold_16=true
Bold_17=true
Bold_24=true
Bold_8=true
FallbackSchema=EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f
FontSizeAdaption_12=180
FontSizeAdaption_13=150
FontSizeAdaption_14=140
FontSizeAdaption_15=130
FontSizeAdaption_16=120
FontSizeAdaption_17=110
FontSizeAdaption_21=105
FontSizeAdaption_24=80
FontSizeAdaption_8=100
ForegroundColorEnabled_-1=true
ForegroundColorEnabled_-1000=true
ForegroundColorEnabled_0=true
ForegroundColorEnabled_1=true
ForegroundColorEnabled_10=true
ForegroundColorEnabled_11=true
ForegroundColorEnabled_12=true
ForegroundColorEnabled_13=true
ForegroundColorEnabled_14=true
ForegroundColorEnabled_15=true
ForegroundColorEnabled_16=true
ForegroundColorEnabled_17=true
ForegroundColorEnabled_18=true
ForegroundColorEnabled_19=true
ForegroundColorEnabled_2=true
ForegroundColorEnabled_20=true
ForegroundColorEnabled_21=true
ForegroundColorEnabled_22=true
ForegroundColorEnabled_23=true
ForegroundColorEnabled_24=true
ForegroundColorEnabled_26=true
ForegroundColorEnabled_3=true
ForegroundColorEnabled_31=true
ForegroundColorEnabled_4=true
ForegroundColorEnabled_5=true
ForegroundColorEnabled_6=true
ForegroundColorEnabled_7=true
ForegroundColorEnabled_8=true
ForegroundColorEnabled_9=true
ForegroundColor_-1=@Variant(\0\0\0\x43\x1\xff\xff\xf8\xf8\xf8\xf8\xf2\xf2\0\0)
ForegroundColor_-1000=@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\0\0\0\0)
ForegroundColor_0=@Variant(\0\0\0\x43\x1\xff\xff\xff\xffyy\xc6\xc6\0\0)
ForegroundColor_1=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc~~\0\0\0\0)
ForegroundColor_10=@Variant(\0\0\0\x43\x1\xff\xff\xa3\xa3\0\0{{\0\0)
ForegroundColor_1000=@Variant(\0\0\0\x43\x1\xff\xff\xff\xffyy\xc6\xc6\0\0)
ForegroundColor_1001=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xfa\xfa\x8c\x8c\0\0)
ForegroundColor_1002=@Variant(\0\0\0\x43\x1\xff\xff\x62\x62rr\xa4\xa4\0\0)
ForegroundColor_1003=@Variant(\0\0\0\x43\x1\xff\xff\x8b\x8b\xe9\xe9\xfd\xfd\0\0)
ForegroundColor_1004=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xb8\xb8ll\0\0)
ForegroundColor_1005=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_1006=@Variant(\0\0\0\x43\x1\xff\xffPP\xfa\xfa{{\0\0)
ForegroundColor_11=@Variant(\0\0\0\x43\x1\xff\xff\x62\x62rr\xa4\xa4\0\0)
ForegroundColor_12=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_13=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_14=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_15=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_16=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_17=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_18=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xfa\xfa\x8c\x8c\0\0)
ForegroundColor_19=@Variant(\0\0\0\x43\x1\xff\xff\0\0\x80\x80\0\0\0\0)
ForegroundColor_2=@Variant(\0\0\0\x43\x1\xff\xff\xfc\xfc~~\0\0\0\0)
ForegroundColor_20="@Variant(\0\0\0\x43\x1\xff\xff======\0\0)"
ForegroundColor_21=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_22=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xfa\xfa\x8c\x8c\0\0)
ForegroundColor_23=@Variant(\0\0\0\x43\x1\xff\xffPP\xfa\xfa{{\0\0)
ForegroundColor_24=@Variant(\0\0\0\x43\x1\xff\xff\xcf\xa3\xd6o\xe5\0\0\0)
ForegroundColor_26=@Variant(\0\0\0\x43\x1\xff\xff\xff\xffUUUU\0\0)
ForegroundColor_29=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xb8\xb8ll\0\0)
ForegroundColor_3=@Variant(\0\0\0\x43\x1\xff\xff\xff\xffyy\xc6\xc6\0\0)
ForegroundColor_30=@Variant(\0\0\0\x43\x1\xff\xff\xbd\xbd\x93\x93\xf9\xf9\0\0)
ForegroundColor_31=@Variant(\0\0\0\x43\x1\xff\xff\xf8\xf8\xf8\xf8\xf2\xf2\0\0)
ForegroundColor_4=@Variant(\0\0\0\x43\x1\xff\xffPP\xfa\xfa{{\0\0)
ForegroundColor_5="@Variant(\0\0\0\x43\x1\xff\xff======\0\0)"
ForegroundColor_6="@Variant(\0\0\0\x43\x1\xff\xff======\0\0)"
ForegroundColor_7=@Variant(\0\0\0\x43\x1\xff\xff\xf1\xf1\xfa\xfa\x8c\x8c\0\0)
ForegroundColor_8=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xb8\xb8ll\0\0)
ForegroundColor_9=@Variant(\0\0\0\x43\x1\xff\xff\xf8\xf8\xf8\xf8\xf2\xf2\0\0)
Italic_7=true
Name=Dracula (Copy)
Underline_0=true
Underline_18=true
Underline_26=true
Experimental script with hardcoded colors to go with the Dracula theme
import QtQml 2.0
QtObject {
function init() {
script.addStyleSheet(
"QWidget {
selection-background-color:#44475A;
selection-color:#F8F8F2;
}"
);
script.addStyleSheet(
"QWidget:item:selected {
background-color: #44475A;
color: #F8F8F2;
}"
)
script.addStyleSheet(
"QListView, QTableView, QTreeView {
background: #282A36;
}"
);
script.addStyleSheet(
"QListView::item:pressed, QTableView::item:pressed, QTreeView::item:pressed {
background: #44475A;
color: #F8F8F2;
}"
);
script.addStyleSheet(
"QListView::item:selected:active, QTableView::item:selected:active, QTreeView::item:selected:active {
background: #44475A;
color: #F8F8F2;
}"
);
script.addStyleSheet(
"QListView::item:selected:hover, QTableView::item:selected:hover, QTreeView::item:selected:hover {
background: #44475A;
color: #F8F8F2;
}"
);
}
}
Learnings:
- Setting QWidget background-color also sets background color of the editor.
- Some places in the source code it's says QListView twice, probably a bug?
QOwnNotes/src/libraries/qdarkstyle/style.qss
Line 995 in db8a0e4
QOwnNotes/src/libraries/qdarkstyle/style.qss
Line 1001 in db8a0e4
- Everything action related to script engine when running on Windows freezes up for many seconds.
from qownnotes.
The feature request is about making that themeable too, as is changing dynamically with the theme.
Hm, since this technically is something completely different (QML CSS Styles) from all the edit styles (QTextCharFormat in the highlighter), it will not easy to implement... 🤔 I'm not sure if I want to pull those settings into theming...
Setting QWidget background-color also sets background color of the editor.
yes, it's the background-color... selection-background-color should work tho...
Some places in the source code it's says QListView twice, probably a bug?
The CSS selectors are different 😉
Everything action related to script engine when running on Windows freezes up for many seconds.
Hm, really? Haven't heard any complaints from people using the script engine under Windows. 🤔
from qownnotes.
Hm, since this technically is something completely different (QML CSS Styles) from all the edit styles (QTextCharFormat in the highlighter), it will not easy to implement... 🤔 I'm not sure if I want to pull those settings into theming...
Roger roger.
yes, it's the background-color... selection-background-color should work tho...
Ok. I experimented with making the whole theme of QOwnNotes look Dracula-ish, but that will be hard if editor background can't be different from the application "frame" background.
The CSS selectors are different 😉
The exact same appears twice on the same line, is what I`m saying. Example:
QOwnNotes/src/libraries/qdarkstyle/style.qss
Line 995 in db8a0e4
- "QListView::item:!selected:hover, QListView::item:!selected:hover, QTreeView::item:!selected:hover {"
I guess the second one should've been QTableView::item:!selected:hover
? 🙂
- If yes I can make a PR.
Hm, really? Haven't heard any complaints from people using the script engine under Windows. 🤔
I can make an issue on it and try to get some relevant debug info when I got time.
from qownnotes.
Ok. I experimented with making the whole theme of QOwnNotes look Dracula-ish, but that will be hard if editor background can't be different from the application "frame" background.
Can't you use a CSS selector for just the editor? Something like QMarkdownTextEdit
...
I guess the second one should've been QTableView::item:!selected:hover? 🙂
Why do you think so?
It's more like an upstream question...
I can make an issue on it and try to get some relevant debug info when I got time.
👍️
from qownnotes.
Can't you use a CSS selector for just the editor? Something like QMarkdownTextEdit...
Hmm, probably. But then the lines between script and theme are blurred, as in the script is doing some of the work a theme is supposed to do. At that point it would almost be better to include the whole theme in the script.
Why do you think so? It's more like an upstream question...
Sorry, wrong assumption on my part. Just thought defining the exaxt same thing twice is redundant.
from qownnotes.
But then the lines between script and theme are blurred, as in the script is doing some of the work a theme is supposed to do.
What you are doing is UI-Theming and that's what you can do with the scripting engine 😉
At that point it would almost be better to include the whole theme in the script.
Good question how hard that would be, to make that scriptable. 🤔
from qownnotes.
This issue is stale because it has been open for 30 days with no activity.
from qownnotes.
This issue was closed because it has been inactive for 14 days since being marked as stale.
from qownnotes.
Related Issues (20)
- [BUG] Line count font size does not resize with text HOT 9
- [BUG] Slow accessing settings after Nextcloud connection is defined HOT 7
- [FEATURE] Option to show full file path in statusbar HOT 16
- [BUG] Freezes and "Not responding" when reloading script engine on Windows HOT 17
- [BUG] List Dot on the left side when in RTL mode in the preview window HOT 5
- [FEATURE] Add "AI" support HOT 20
- [BUG] Windows - Opening settings is slow -> Some registry keys are read 72 times HOT 13
- [I] "Move notes to subfolder..." does not stay in folder but jumps to root folder HOT 3
- [BUG] macdeoloyqt not found with jurplel/install-qt-action@v4 HOT 2
- [BUG] xml formatting in markdown HOT 5
- [FEATURE] Shortcut for switching from ltr to trl and dynamic one HOT 3
- [FEATURE][USABILITY] Switching between INS/OVR mode in QOwnNotes HOT 8
- [BUG] Cannot disable dark mode HOT 2
- [FEATURE] provide the option to use a self hosted AI (e.g. ollama) HOT 28
- [ Ctrl + insert ] does not copy selected text HOT 5
- [I] The notes were encrypted by me a few days ago with a password . Today i tried to decrypt them back and they are decrypting into some kind of other encryption HOT 1
- [FEATURE] the inserted images should be visible in the editor as well ( not only int the preview ) HOT 1
- [FEATURE] the preview should reload at changes HOT 3
- [SUPPORT] Newbie's questions HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qownnotes.