adjust line height, make it could customizable

This commit is contained in:
Liang Ding 2014-11-14 13:40:35 +08:00
parent c6f8ab342d
commit dda620a6d0
5 changed files with 10 additions and 5 deletions

View File

@ -1,11 +1,11 @@
// Copyright (c) 2014, B3log // Copyright (c) 2014, B3log
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -65,6 +65,7 @@ type User struct {
type Editor struct { type Editor struct {
FontFamily string FontFamily string
FontSize string FontSize string
LineHeight string
} }
// Configuration. // Configuration.

View File

@ -23,7 +23,8 @@
"FontSize": "13px", "FontSize": "13px",
"Editor": { "Editor": {
"FontFamily": "Consolas, 'Courier New', monospace", "FontFamily": "Consolas, 'Courier New', monospace",
"FontSize": "inherit" "FontSize": "13px",
"LineHeight": "19px"
}, },
"LatestSessionContent": { "LatestSessionContent": {
"FileTree": [], "FileTree": [],

View File

@ -614,6 +614,7 @@ var editors = {
theme: 'wide', theme: 'wide',
indentUnit: 4, indentUnit: 4,
foldGutter: true, foldGutter: true,
cursorHeight: 1,
path: data.path, path: data.path,
extraKeys: { extraKeys: {
"Ctrl-\\": "autocompleteAnyWord", "Ctrl-\\": "autocompleteAnyWord",

View File

@ -9,5 +9,6 @@ button {
.CodeMirror, .CodeMirror,
.CodeMirror-hints { .CodeMirror-hints {
font-family: Consolas, 'Courier New', monospace; font-family: Consolas, 'Courier New', monospace;
font-size: inherit; font-size: 13px;
line-height: 19px;
} }

View File

@ -10,4 +10,5 @@ button {
.CodeMirror-hints { .CodeMirror-hints {
font-family: {{.user.Editor.FontFamily}}; font-family: {{.user.Editor.FontFamily}};
font-size: {{.user.Editor.FontSize}}; font-size: {{.user.Editor.FontSize}};
line-height: {{.user.Editor.LineHeight}};
} }