change default style and config tool bar icon size by tool_bar_icon_size

This commit is contained in:
Le Tan 2017-09-13 21:51:07 +08:00
parent a36b512e94
commit 7a384b1592
6 changed files with 27 additions and 10 deletions

View File

@ -1,13 +1,13 @@
body { body {
margin: 0 auto; margin: 0 auto;
font-family: Helvetica, sans-serif, Tahoma, Arial, Verdana, Geneva, Georgia, Palatino, "Times New Roman", "Hiragino Sans GB", "冬青黑体", "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "WenQuanYi Micro Hei", "文泉驿雅黑", Dengxian, "等线体", STXihei, "华文细黑", "Liberation Sans", "Droid Sans", NSimSun, "新宋体", SimSun, "宋体"; font-family: Helvetica, sans-serif, Tahoma, Arial, Verdana, Geneva, Georgia, Palatino, "Times New Roman", "Hiragino Sans GB", "冬青黑体", "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "WenQuanYi Micro Hei", "文泉驿雅黑", Dengxian, "等线体", STXihei, "华文细黑", "Liberation Sans", "Droid Sans", NSimSun, "新宋体", SimSun, "宋体";
color: #444444; color: #363636;
line-height: 1; line-height: 1;
padding: 30px; padding: 30px;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
color: #222222; color: #363636;
font-weight: bold; font-weight: bold;
margin-bottom: 24px; margin-bottom: 24px;
padding: 0; padding: 0;
@ -97,7 +97,7 @@ pre code {
border: none; border: none;
background: transparent; background: transparent;
overflow: auto; overflow: auto;
color: #444444; color: #363636;
} }
aside { aside {

View File

@ -13,6 +13,7 @@ editor
# Do not use "" to quote the name # Do not use "" to quote the name
font-family: Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, WenQuanYi Micro Hei, 文泉驿雅黑, Dengxian, 等线体, STXihei, 华文细黑, Liberation Sans, Droid Sans, NSimSun, 新宋体, SimSun, 宋体, Helvetica, sans-serif, Tahoma, Arial, Verdana, Geneva, Georgia, Times New Roman font-family: Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, WenQuanYi Micro Hei, 文泉驿雅黑, Dengxian, 等线体, STXihei, 华文细黑, Liberation Sans, Droid Sans, NSimSun, 新宋体, SimSun, 宋体, Helvetica, sans-serif, Tahoma, Arial, Verdana, Geneva, Georgia, Times New Roman
font-size: 12 font-size: 12
foreground: 363636
# [VNote] Style for trailing space # [VNote] Style for trailing space
trailing-space: a8a8a8 trailing-space: a8a8a8
# [VNote] Style for line number # [VNote] Style for line number
@ -46,32 +47,32 @@ vim-visual-background: 90caf9
vim-replace-background: f8bbd0 vim-replace-background: f8bbd0
H1 H1
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +8 font-size: +8
H2 H2
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +6 font-size: +6
H3 H3
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +4 font-size: +4
H4 H4
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +2 font-size: +2
H5 H5
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +2 font-size: +2
H6 H6
foreground: 111111 foreground: 363636
font-style: bold font-style: bold
font-size: +2 font-size: +2

View File

@ -93,6 +93,9 @@ color_column=0
; Whether display line number of code block in read mode ; Whether display line number of code block in read mode
enable_code_block_line_number=false enable_code_block_line_number=false
; The icon size of tool bar (in pixels)
tool_bar_icon_size=18
[session] [session]
tools_dock_checked=true tools_dock_checked=true

View File

@ -182,6 +182,9 @@ void VConfigManager::initialize()
m_enableCodeBlockLineNumber = getConfigFromSettings("global", m_enableCodeBlockLineNumber = getConfigFromSettings("global",
"enable_code_block_line_number").toBool(); "enable_code_block_line_number").toBool();
m_toolBarIconSize = getConfigFromSettings("global",
"tool_bar_icon_size").toInt();
} }
void VConfigManager::readPredefinedColorsFromSettings() void VConfigManager::readPredefinedColorsFromSettings()

View File

@ -244,6 +244,8 @@ public:
bool getEnableCodeBlockLineNumber() const; bool getEnableCodeBlockLineNumber() const;
void setEnableCodeBlockLineNumber(bool p_enabled); void setEnableCodeBlockLineNumber(bool p_enabled);
int getToolBarIconSize() const;
// Return the configured key sequence of @p_operation. // Return the configured key sequence of @p_operation.
// Return empty if there is no corresponding config. // Return empty if there is no corresponding config.
QString getShortcutKeySequence(const QString &p_operation) const; QString getShortcutKeySequence(const QString &p_operation) const;
@ -496,6 +498,9 @@ private:
// The foreground color of the color column. // The foreground color of the color column.
QString m_editorColorColumnFg; QString m_editorColorColumnFg;
// Icon size of tool bar in pixels.
int m_toolBarIconSize;
// The name of the config file in each directory, obsolete. // The name of the config file in each directory, obsolete.
// Use c_dirConfigFile instead. // Use c_dirConfigFile instead.
static const QString c_obsoleteDirConfigFile; static const QString c_obsoleteDirConfigFile;
@ -1289,4 +1294,9 @@ inline void VConfigManager::setEnableCodeBlockLineNumber(bool p_enabled)
m_enableCodeBlockLineNumber); m_enableCodeBlockLineNumber);
} }
inline int VConfigManager::getToolBarIconSize() const
{
return m_toolBarIconSize;
}
#endif // VCONFIGMANAGER_H #endif // VCONFIGMANAGER_H

View File

@ -196,7 +196,7 @@ QWidget *VMainWindow::setupDirectoryPanel()
void VMainWindow::initToolBar() void VMainWindow::initToolBar()
{ {
const int tbIconSize = 20 * VUtils::calculateScaleFactor(); const int tbIconSize = g_config->getToolBarIconSize() * VUtils::calculateScaleFactor();
QSize iconSize(tbIconSize, tbIconSize); QSize iconSize(tbIconSize, tbIconSize);
initFileToolBar(iconSize); initFileToolBar(iconSize);