diff --git a/src/resources/themes/v_white/down.svg b/src/resources/themes/v_white/down.svg
new file mode 100644
index 00000000..386ac7f8
--- /dev/null
+++ b/src/resources/themes/v_white/down.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/down_disabled.svg b/src/resources/themes/v_white/down_disabled.svg
new file mode 100644
index 00000000..2a53e0f0
--- /dev/null
+++ b/src/resources/themes/v_white/down_disabled.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/left.svg b/src/resources/themes/v_white/left.svg
new file mode 100644
index 00000000..aee69f4a
--- /dev/null
+++ b/src/resources/themes/v_white/left.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/left_disabled.svg b/src/resources/themes/v_white/left_disabled.svg
new file mode 100644
index 00000000..3cabd4b5
--- /dev/null
+++ b/src/resources/themes/v_white/left_disabled.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/right.svg b/src/resources/themes/v_white/right.svg
new file mode 100644
index 00000000..c524ab79
--- /dev/null
+++ b/src/resources/themes/v_white/right.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/right_disabled.svg b/src/resources/themes/v_white/right_disabled.svg
new file mode 100644
index 00000000..c0c83ba8
--- /dev/null
+++ b/src/resources/themes/v_white/right_disabled.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/up.svg b/src/resources/themes/v_white/up.svg
new file mode 100644
index 00000000..52be26da
--- /dev/null
+++ b/src/resources/themes/v_white/up.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/up_disabled.svg b/src/resources/themes/v_white/up_disabled.svg
new file mode 100644
index 00000000..36e54158
--- /dev/null
+++ b/src/resources/themes/v_white/up_disabled.svg
@@ -0,0 +1,8 @@
+
diff --git a/src/resources/themes/v_white/v_white.palette b/src/resources/themes/v_white/v_white.palette
index ed2e1f43..f002cc0d 100644
--- a/src/resources/themes/v_white/v_white.palette
+++ b/src/resources/themes/v_white/v_white.palette
@@ -67,6 +67,12 @@ danger_icon_fg=@danger_red
item_icon_fg=@icon_fg
title_icon_fg=@icon_fg
+; VVimIndicator.
+vim_indicator_key_label_fg=@base_fg
+vim_indicator_key_label_bg=@base_bg
+vim_indicator_mode_label_fg=@base_fg
+vim_indicator_cmd_edit_pending_bg=@selected_bg
+
[widgets]
; Widget color attributes.
@@ -240,7 +246,8 @@ statusbar_bg=@main_bg
; ScrollBar.
scrollbar_bg=#EEEEEE
scrollbar_handle_bg=#D0D0D0
-scrollbar_addline_bg=#E0E0E0
+scrollbar_handle_hover_bg=@hover_bg
+scrollbar_handle_pressed_bg=@pressed_bg
; VEditWindow.
editwindow_corner_icon_fg=@icon_fg
diff --git a/src/resources/themes/v_white/v_white.qss b/src/resources/themes/v_white/v_white.qss
index e24ebd45..83ddd6e1 100644
--- a/src/resources/themes/v_white/v_white.qss
+++ b/src/resources/themes/v_white/v_white.qss
@@ -478,6 +478,18 @@ QLabel[MenuSeparator="true"] {
border-top: 1px solid @menu_separator_bg
}
+VVimIndicator QLabel[VimIndicatorKeyLabel="true"] {
+ font: bold;
+ color: @vim_indicator_key_label_fg;
+ background: @vim_indicator_key_label_bg;
+}
+
+VVimIndicator QLabel[VimIndicatorModeLabel="true"] {
+ padding: 0px 2px 0px 2px;
+ font: bold;
+ color: @vim_indicator_mode_label_fg;
+ /* background color will be controlled by the code. */
+}
/* End QLabel */
/* QLineEdit */
@@ -494,6 +506,8 @@ QLineEdit[VimCommandLine="true"] {
padding: 0px;
margin: 0px;
border: none;
+ color: @lineedit_fg;
+ background: @lineedit_bg;
}
/* End QLineEdit */
@@ -548,6 +562,30 @@ QTabBar::close-button:focus {
image: url(close.svg);
background-color: @tabbar_closebutton_focus_bg;
}
+
+QTabBar::scroller {
+ width: 20px;
+}
+
+QTabBar QToolButton {
+ border: none;
+}
+
+QTabBar QToolButton::right-arrow:enabled {
+ image: url(right.svg);
+}
+
+QTabBar QToolButton::left-arrow:enabled {
+ image: url(left.svg);
+}
+
+QTabBar QToolButton::right-arrow:disabled {
+ image: url(right_disabled.svg);
+}
+
+QTabBar QToolButton::left-arrow:disabled {
+ image: url(left_disabled.svg);
+}
/* End QTabBar */
VSelectorItemWidget QLabel[SelectorItemShortcutLabel="true"] {
@@ -699,3 +737,139 @@ QDialog {
color: @base_fg;
background: @base_bg;
}
+
+/* QScrollBar */
+QScrollBar:vertical {
+ background: @scrollbar_bg;
+ width: 20px;
+ margin: 20px 0px 20px 0px;
+ padding: 0px 2px 0px 2px;
+ border: none;
+}
+
+QScrollBar::handle:vertical {
+ background: @scrollbar_handle_bg;
+ min-height: 20px;
+}
+
+QScrollBar::handle:vertical:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::handle:vertical:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::add-line:vertical {
+ border: none;
+ background: @scrollbar_bg;
+ width: 20px;
+ height: 20px;
+ subcontrol-position: bottom;
+ subcontrol-origin: margin;
+}
+
+QScrollBar::add-line:vertical:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::add-line:vertical:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::sub-line:vertical {
+ border: none;
+ background: @scrollbar_bg;
+ width: 20px;
+ height: 20px;
+ subcontrol-position: top;
+ subcontrol-origin: margin;
+}
+
+QScrollBar::sub-line:vertical:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::sub-line:vertical:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::down-arrow:vertical {
+ image: url(down.svg);
+ width: 20px;
+ height: 20px;
+}
+
+QScrollBar::up-arrow:vertical {
+ image: url(up.svg);
+ width: 20px;
+ height: 20px;
+}
+
+QScrollBar:horizontal {
+ background: @scrollbar_bg;
+ height: 20px;
+ margin: 0px 20px 0px 20px;
+ padding: 2px 0px 2px 0px;
+ border: none;
+}
+
+QScrollBar::handle:horizontal {
+ background: @scrollbar_handle_bg;
+ min-width: 20px;
+}
+
+QScrollBar::handle:horizontal:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::handle:horizontal:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::add-line:horizontal {
+ border: none;
+ background: @scrollbar_bg;
+ width: 20px;
+ height: 20px;
+ subcontrol-position: right;
+ subcontrol-origin: margin;
+}
+
+QScrollBar::add-line:horizontal:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::add-line:horizontal:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::sub-line:horizontal {
+ border: none;
+ background: @scrollbar_bg;
+ width: 20px;
+ height: 20px;
+ subcontrol-position: left;
+ subcontrol-origin: margin;
+}
+
+QScrollBar::sub-line:horizontal:hover {
+ background: @scrollbar_handle_hover_bg;
+}
+
+QScrollBar::sub-line:horizontal:pressed {
+ background: @scrollbar_handle_pressed_bg;
+}
+
+QScrollBar::right-arrow:horizontal {
+ image: url(right.svg);
+ width: 20px;
+ height: 20px;
+}
+
+QScrollBar::left-arrow:horizontal {
+ image: url(left.svg);
+ width: 20px;
+ height: 20px;
+}
+/* End QScrollBar */
diff --git a/src/veditwindow.cpp b/src/veditwindow.cpp
index 6f2b9402..9c4feddc 100644
--- a/src/veditwindow.cpp
+++ b/src/veditwindow.cpp
@@ -516,6 +516,11 @@ void VEditWindow::updateTabStatus(int p_index)
void VEditWindow::updateTabInfo(int p_index)
{
+ static QIcon editModified = VIconUtils::tabBarSpecialIcon(":/resources/icons/editing_modified.svg");
+ static QIcon edit = VIconUtils::tabBarIcon(":/resources/icons/editing.svg");
+ static QIcon readModified = VIconUtils::tabBarSpecialIcon(":/resources/icons/reading_modified.svg");
+ static QIcon read = VIconUtils::tabBarIcon(":/resources/icons/reading.svg");
+
VEditTab *editor = getTab(p_index);
const VFile *file = editor->getFile();
bool editMode = editor->isEditMode();
@@ -525,11 +530,9 @@ void VEditWindow::updateTabInfo(int p_index)
QIcon icon;
if (editMode) {
- icon = editor->isModified() ? VIconUtils::tabBarSpecialIcon(":/resources/icons/editing_modified.svg")
- : VIconUtils::tabBarIcon(":/resources/icons/editing.svg");
+ icon = editor->isModified() ? editModified : edit;
} else {
- icon = editor->isModified() ? VIconUtils::tabBarSpecialIcon(":/resources/icons/reading_modified.svg")
- : VIconUtils::tabBarIcon(":/resources/icons/reading.svg");
+ icon = editor->isModified() ? readModified : read;
}
setTabIcon(p_index, icon);
@@ -968,12 +971,17 @@ void VEditWindow::connectEditTab(const VEditTab *p_tab)
void VEditWindow::setCurrentWindow(bool p_current)
{
+ static QIcon menuCur = VIconUtils::editWindowCornerIcon(":/resources/icons/corner_menu_cur.svg");
+ static QIcon tablistCur = VIconUtils::editWindowCornerIcon(":/resources/icons/corner_tablist_cur.svg");
+ static QIcon menu = VIconUtils::editWindowCornerInactiveIcon(":/resources/icons/corner_menu.svg");
+ static QIcon tablist = VIconUtils::editWindowCornerInactiveIcon(":/resources/icons/corner_tablist.svg");
+
if (p_current) {
- rightBtn->setIcon(VIconUtils::editWindowCornerIcon(":/resources/icons/corner_menu_cur.svg"));
- leftBtn->setIcon(VIconUtils::editWindowCornerIcon(":/resources/icons/corner_tablist_cur.svg"));
+ rightBtn->setIcon(menuCur);
+ leftBtn->setIcon(tablistCur);
} else {
- rightBtn->setIcon(VIconUtils::editWindowCornerInactiveIcon(":/resources/icons/corner_menu.svg"));
- leftBtn->setIcon(VIconUtils::editWindowCornerInactiveIcon(":/resources/icons/corner_tablist.svg"));
+ rightBtn->setIcon(menu);
+ leftBtn->setIcon(tablist);
}
}
diff --git a/src/vmainwindow.cpp b/src/vmainwindow.cpp
index 8670a393..1d0161f2 100644
--- a/src/vmainwindow.cpp
+++ b/src/vmainwindow.cpp
@@ -506,8 +506,6 @@ void VMainWindow::initEditToolBar(QSize p_iconSize)
m_editToolBar->addAction(codeBlockAct);
- m_editToolBar->addSeparator();
-
// Insert link.
QAction *insetLinkAct = new QAction(VIconUtils::toolButtonIcon(":/resources/icons/link.svg"),
tr("Insert Link\t%1").arg(VUtils::getShortcutText("Ctrl+L")),
@@ -668,13 +666,11 @@ void VMainWindow::initFileToolBar(QSize p_iconSize)
fileToolBar->addAction(newRootDirAct);
fileToolBar->addAction(newNoteAct);
- fileToolBar->addSeparator();
fileToolBar->addAction(noteInfoAct);
fileToolBar->addAction(deleteNoteAct);
fileToolBar->addAction(editNoteAct);
fileToolBar->addAction(saveExitAct);
fileToolBar->addAction(saveNoteAct);
- fileToolBar->addSeparator();
}
void VMainWindow::initMenuBar()
diff --git a/src/vnote.qrc b/src/vnote.qrc
index 16d858ff..498ab7a7 100644
--- a/src/vnote.qrc
+++ b/src/vnote.qrc
@@ -151,5 +151,13 @@
resources/themes/v_white/branch_more.svg
resources/themes/v_white/branch_open.svg
resources/themes/v_white/line.svg
+ resources/themes/v_white/down.svg
+ resources/themes/v_white/left.svg
+ resources/themes/v_white/right.svg
+ resources/themes/v_white/up.svg
+ resources/themes/v_white/left_disabled.svg
+ resources/themes/v_white/right_disabled.svg
+ resources/themes/v_white/down_disabled.svg
+ resources/themes/v_white/up_disabled.svg
diff --git a/src/vvimindicator.cpp b/src/vvimindicator.cpp
index 609cdf27..520a322e 100644
--- a/src/vvimindicator.cpp
+++ b/src/vvimindicator.cpp
@@ -13,9 +13,12 @@
#include "vconfigmanager.h"
#include "vbuttonwithwidget.h"
#include "vedittab.h"
+#include "vpalette.h"
extern VConfigManager *g_config;
+extern VPalette *g_palette;
+
VVimIndicator::VVimIndicator(QWidget *p_parent)
: QWidget(p_parent), m_vim(NULL)
{
@@ -99,6 +102,7 @@ void VVimIndicator::setupUI()
m_cmdLineEdit->hide();
m_modeLabel = new QLabel(this);
+ m_modeLabel->setProperty("VimIndicatorModeLabel", true);
QTreeWidget *regTree = new QTreeWidget(this);
regTree->setColumnCount(2);
@@ -133,6 +137,7 @@ void VVimIndicator::setupUI()
this, &VVimIndicator::updateMarksTree);
m_keyLabel = new QLabel(this);
+ m_keyLabel->setProperty("VimIndicatorKeyLabel", true);
QFontMetrics metric(font());
m_keyLabel->setMinimumWidth(metric.width('A') * 5);
@@ -268,9 +273,7 @@ void VVimIndicator::update(const VVim *p_vim, const VEditTab *p_editTab)
pendingKeys = p_vim->getPendingKeys();
}
- QString style = QString("QLabel { padding: 0px 2px 0px 2px; font: bold; background-color: %1; }")
- .arg(modeBackgroundColor(mode));
- m_modeLabel->setStyleSheet(style);
+ m_modeLabel->setStyleSheet(QString("background: %1;").arg(modeBackgroundColor(mode)));
m_modeLabel->setText(modeToString(mode));
m_regBtn->setText(curRegName);
@@ -279,9 +282,7 @@ void VVimIndicator::update(const VVim *p_vim, const VEditTab *p_editTab)
.arg(lastUsedMark.isNull() ? QChar(' ') : lastUsedMark);
m_markBtn->setText(markText);
- QString keyText = QString("%2")
- .arg("#15AE67").arg(pendingKeys);
- m_keyLabel->setText(keyText);
+ m_keyLabel->setText(pendingKeys);
}
void VVimIndicator::updateRegistersTree(QWidget *p_widget)
@@ -550,7 +551,7 @@ void VVimCmdLineEdit::setRegisterPending(bool p_pending)
{
if (p_pending && !m_registerPending) {
// Going to pending.
- setStyleSheet("QLineEdit { background: #D6EACE }");
+ setStyleSheet(QString("background: %1;").arg(g_palette->color("vim_indicator_cmd_edit_pending_bg")));
} else if (!p_pending && m_registerPending) {
// Leaving pending.
setStyleSheet(m_originStyleSheet);