Browse Source

change default style and config tool bar icon size by tool_bar_icon_size

Le Tan 8 years ago
parent
commit
7a384b1592

+ 3 - 3
src/resources/styles/default.css

@@ -1,13 +1,13 @@
 body {
     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, "宋体";
-    color: #444444;
+    color: #363636;
     line-height: 1;
     padding: 30px;
 }
 
 h1, h2, h3, h4, h5, h6 {
-    color: #222222;
+    color: #363636;
     font-weight: bold;
     margin-bottom: 24px;
     padding: 0;
@@ -97,7 +97,7 @@ pre code {
    border: none;
    background: transparent;
    overflow: auto;
-   color: #444444;
+   color: #363636;
 }
 
 aside {

+ 7 - 6
src/resources/styles/default.mdhl

@@ -13,6 +13,7 @@ editor
 # 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-size: 12
+foreground: 363636
 # [VNote] Style for trailing space
 trailing-space: a8a8a8
 # [VNote] Style for line number
@@ -46,32 +47,32 @@ vim-visual-background: 90caf9
 vim-replace-background: f8bbd0
 
 H1
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +8
 
 H2
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +6
 
 H3
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +4
 
 H4
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +2
 
 H5
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +2
 
 H6
-foreground: 111111
+foreground: 363636
 font-style: bold
 font-size: +2
 

+ 3 - 0
src/resources/vnote.ini

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

+ 3 - 0
src/vconfigmanager.cpp

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

+ 10 - 0
src/vconfigmanager.h

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

+ 1 - 1
src/vmainwindow.cpp

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