Skip to content

Build your personal knowledge base with Trilium Notes

store font size in options #326

azivnerf1c327887406
diff --git a/db/migrations/0123__add_options_for_font_sizes.sql b/db/migrations/0123__add_options_for_font_sizes.sql
new file mode 100644
index 0000000000..d855d76928
--- /dev/null
+++ b/db/migrations/0123__add_options_for_font_sizes.sql
@@ -0,0 +1,8 @@
+INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
+VALUES ('mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
+
+INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
+VALUES ('treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
+
+INSERT INTO options (name, value, dateCreated, dateModified, isSynced)
+VALUES ('detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0);
\ No newline at end of file
diff --git a/src/routes/index.js b/src/routes/index.js
index c0af0c5f4e..3379434d4e 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -16,6 +16,9 @@ async function index(req, res) {
leftPaneMinWidth: parseInt(options.leftPaneMinWidth),
leftPaneWidthPercent: parseInt(options.leftPaneWidthPercent),
rightPaneWidthPercent: 100 - parseInt(options.leftPaneWidthPercent),
+ mainFontSize: parseInt(options.mainFontSize),
+ treeFontSize: parseInt(options.treeFontSize),
+ detailFontSize: parseInt(options.detailFontSize),
sourceId: await sourceIdService.generateSourceId(),
maxSyncIdAtLoad: await sql.getValue("SELECT MAX(id) FROM sync"),
instanceName: config.General ? config.General.instanceName : null,
diff --git a/src/services/app_info.js b/src/services/app_info.js
index 39fd52cd89..20e20323ad 100644
--- a/src/services/app_info.js
+++ b/src/services/app_info.js
@@ -4,7 +4,7 @@ const build = require('./build');
const packageJson = require('../../package');
const {TRILIUM_DATA_DIR} = require('./data_dir');
-const APP_DB_VERSION = 122;
+const APP_DB_VERSION = 123;
const SYNC_VERSION = 4;
module.exports = {
diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs
index b7faa90536..89f9cfe6ed 100644
--- a/src/views/desktop.ejs
+++ b/src/views/desktop.ejs
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>Trilium Notes</title>
</head>
-<body class="desktop theme-<%= theme %>">
+<body class="desktop theme-<%= theme %>" style="--main-font-size: <%= mainFontSize %>%; --tree-font-size: <%= treeFontSize %>%; --detail-font-size: <%= detailFontSize %>%;">
<div id="container" style="display: none; grid-template-columns: minmax(<%= leftPaneMinWidth %>px, <%= leftPaneWidthPercent %>fr) <%= rightPaneWidthPercent %>fr">
<div id="header" class="hide-toggle">
<div id="history-navigation" style="display: none;">