added custom-stylesheet script

This commit is contained in:
Patrizio Bekerle 2017-05-19 18:02:43 +02:00
parent 41bdca0692
commit 16624c41a5
No known key found for this signature in database
GPG Key ID: 2E9FFD770DABE838
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import QtQml 2.0
/**
* This script adds custom styles to the application
*
* You can get the object names from the *.ui files, for example
* https://github.com/pbek/QOwnNotes/blob/develop/src/mainwindow.ui
*
* Take a look at http://doc.qt.io/qt-5/stylesheet-reference.html for
* a reference of what styles are available.
*/
QtObject {
property string customStylesheet;
// register your settings variables so the user can set them in the script settings
property variant settingsVariables: [
{
"identifier": "customStylesheet",
"name": "Custom stylesheet",
"description": "Please enter your custom stylesheet:",
"type": "text",
"default": "QTreeWidget#noteTreeWidget {font-family: Pacifico; font-size: 28px;}",
},
];
/**
* Adds custom styles
*/
function init() {
// add a custom stylesheet to increase font size in the note list and set a font
script.addStyleSheet(customStylesheet);
}
}

View File

@ -0,0 +1,9 @@
{
"name": "Custom user interface styles",
"identifier": "custom-stylesheet",
"script": "custom-stylesheet.qml",
"authors": ["@pbek"],
"version": "0.0.1",
"minAppVersion": "17.05.7",
"description" : "With this script you can add custom styles to the application. Please take a look at <a href='http://docs.qownnotes.org/en/develop/scripting/README.html#add-a-custom-stylesheet'>Add a custom stylesheet</a> to find out how to style QOwnNotes."
}