editor: fix selection-color by style sheet

This commit is contained in:
Le Tan 2019-01-02 20:27:39 +08:00
parent e3b9d060f3
commit b9d1164d8d
3 changed files with 12 additions and 8 deletions

View File

@ -14,12 +14,12 @@ editor
font-family: Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, WenQuanYi Micro Hei, 文泉驿雅黑, Dengxian, 等线体, STXihei, 华文细黑, Liberation Sans, Droid Sans, NSimSun, 新宋体, SimSun, 宋体, Verdana, Helvetica, sans-serif, Tahoma, Arial, Geneva, Georgia, Times New Roman
font-size: 12
foreground: 222222
background: f5f5f5
background: eeeeee
# [VNote] Style for trailing space
trailing-space: a8a8a8
# [VNote] Style for line number
line-number-background: eaeaea
line-number-foreground: 424242
line-number-background: eeeeee
line-number-foreground: 666666
# [VNote] Style for selected word highlight
selected-word-foreground: 222222
selected-word-background: dfdf00
@ -39,7 +39,7 @@ color-column-foreground: ffff00
preview-image-line-foreground: 9575cd
editor-selection
foreground: f5f5f5
foreground: eeeeee
background: 1976d2
editor-current-line

View File

@ -7,7 +7,7 @@ mdhl_file=v_pure.mdhl
css_file=v_pure.css
codeblock_css_file=v_pure_codeblock.css
mermaid_css_file=v_pure_mermaid.css
version=25
version=26
[phony]
; Abstract color attributes.
@ -56,7 +56,7 @@ pressed_fg=@base_fg
pressed_bg=#B2B2B2
edit_fg=#222222
edit_bg=#F5F5F5
edit_bg=#EEEEEE
edit_focus_bg=#E0F2F1
edit_focus_border=@master_bg
edit_hover_bg=#F2FAF9

View File

@ -1423,13 +1423,17 @@ void VMdEditor::setFontAndPaletteByStyleSheet(const QFont &p_font, const QPalett
"font-family: \"%1\";"
"font-size: %2pt;"
"color: %3;"
"background-color: %4; } "
"background-color: %4;"
"selection-color: %5;"
"selection-background-color: %6; } "
"VLineNumberArea {"
"font-size: %5pt; }")
"font-size: %7pt; }")
.arg(p_font.family())
.arg(p_font.pointSize())
.arg(p_palette.color(QPalette::Text).name())
.arg(p_palette.color(QPalette::Base).name())
.arg(p_palette.color(QPalette::HighlightedText).name())
.arg(p_palette.color(QPalette::Highlight).name())
.arg(p_font.pointSize() + LINE_NUMBER_AREA_FONT_DELTA));
setStyleSheet(styles);