This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kubuntu 16.04 text color in Notes Widget

Tags: None
(comma "," separated)
gthib
Registered Member
Posts
21
Karma
0
Greetings,

I have found an extremely nice Notes Widget appearance with the transparency.
Alas my contentment has been quickly faded when I found that the only letter color is solid black.
The text becomes completely invisible on a dark desktop background.

Is there any clever trick, possibility to have the text color of one's choice?

Thanks in advance.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
(with the Plasma 5.7.2)

Plasma 5 is using qml scripts: https://en.wikipedia.org/wiki/QML .

Notes widget qml scripts are at: /usr/share/plasma/plasmoids/org.kde.plasma.notes/
Text color is at: /usr/share/plasma/plasmoids/org.kde.plasma.notes/contents/ui/main.qml
Code: Select all
        style: PlasmaStyle.TextAreaStyle {
            //this is deliberately _NOT_ the theme color as we are over a known bright background
            //an unknown colour over a known colour is a bad move as you end up with white on yellow
            textColor: plasmoid.configuration.color === "black" ? "#dfdfdf" : "#202020"
        }


The user can edit the "#202020" to set the wanted color - qml colors: http://doc.qt.io/qt-5/qml-color.html

Example - changing:
Code: Select all
textColor: plasmoid.configuration.color === "black" ? "#dfdfdf" : "#202020"

to
Code: Select all
textColor: plasmoid.configuration.color === "black" ? "#dfdfdf" : "orange"


=>

Image

Note !
Upgrades to the plasma will overwrite the /usr/share/plasma/plasmoids/org.kde.plasma.notes/ edits.


My Notes

A bit better way is to copy the scripts to the users home and rename the notes widget.

Copying the /usr/share/plasma/plasmoids/org.kde.plasma.notes/ to ~/.local/share/plasma/plasmoids/org.kde.plasma.mynotes/

Editing the ~/.local/share/plasma/plasmoids/org.kde.plasma.mynotes/metadata.desktop:
Code: Select all
[Desktop Entry]
Name=My Notes
Name[x-test]=xxMy Notesxx

Comment=Custom Desktop sticky notes
Comment[x-test]=xxCustom Desktop sticky notesxx

Icon=knotes
Type=Service

X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-Plasma-DropMimeTypes=text/plain,text/richtext
X-KDE-ServiceTypes=Plasma/Applet
X-KDE-PluginInfo-Author=
X-KDE-PluginInfo-Email=
X-KDE-PluginInfo-Name=org.kde.plasma.mynotes
X-KDE-PluginInfo-Version=2.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-Requires-FileDialog=Unused
X-Plasma-Requires-LaunchApp=Unused
X-Plasma-StandAloneApp=true


Editing the ~/.local/share/plasma/plasmoids/org.kde.plasma.mynotes/contents/ui/main.qml
and setting the wanted text color:
Code: Select all
textColor: plasmoid.configuration.color === "black" ? "#dfdfdf" : "orange"


Restarting the plasmashell or log out - log in.

Adding the custom notes:

Image
gthib
Registered Member
Posts
21
Karma
0
Wow. I thank you very much and really appreciate your exaustuve, very comprehensive explanation. I am very impressed.

I will give a try hoping all will go well as I have no programming knowledge.

PS
Seeing your deep pedagogical abilities and above all your knowledge I was wondering if you could help me to remove all drop shadow behind windows in Plasma, ie Breeze decoration including all menu boxes, panel, etc?
Ideally I would like to not having rounded corners...

Once more many thanks for the quality of your elucidation and guidance.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
gthib wrote:Wow. I thank you very much and really appreciate your exaustuve, very comprehensive explanation. I am very impressed.

I will give a try hoping all will go well as I have no programming knowledge.

PS
Seeing your deep pedagogical abilities and above all your knowledge I was wondering if you could help me to remove all drop shadow behind windows in Plasma, ie Breeze decoration including all menu boxes, panel, etc?
Ideally I would like to not having rounded corners...

Once more many thanks for the quality of your elucidation and guidance.


Adding few short notes and links to the viewtopic.php?f=17&t=135024
duns
Registered Member
Posts
78
Karma
0
OS
He, I'd like instead change the background color, according to css rules, as I asked today https://forum.kde.org/viewtopic.php?f=289&t=161219&p=418782#p418782: it's possible?
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Please do not hijack threads that are 3 years old, you asked your question, just be patient.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]