mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
modify stylesheet
Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
parent
a3b83b7f81
commit
9413ef875b
@ -1,14 +1,15 @@
|
||||
QPushButton[FlatBtn="true"] {
|
||||
padding: 3px;
|
||||
QPushButton[CornerBtn="true"] {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
QPushButton[FlatBtn="true"]::menu-indicator {
|
||||
QPushButton[CornerBtn="true"]::menu-indicator {
|
||||
image: none;
|
||||
}
|
||||
|
||||
QPushButton[FlatBtn="true"]::hover {
|
||||
QPushButton[CornerBtn="true"]::hover {
|
||||
background-color: @hover-color;
|
||||
}
|
||||
|
||||
@ -28,6 +29,11 @@ QMenuBar::item:selected {
|
||||
background-color: @hover-color;
|
||||
}
|
||||
|
||||
/* DockWidget */
|
||||
QDockWidget::Title {
|
||||
background: @base-color;
|
||||
}
|
||||
|
||||
QDockWidget::close-button, QDockWidget::float-button {
|
||||
border: none;
|
||||
}
|
||||
@ -35,10 +41,11 @@ QDockWidget::close-button, QDockWidget::float-button {
|
||||
QDockWidget::close-button:hover, QDockWidget::float-button:hover {
|
||||
background-color: @hover-color;
|
||||
}
|
||||
/* End DockWidget */
|
||||
|
||||
/* QComboBox#NotebookSelector */
|
||||
QComboBox#NotebookSelector {
|
||||
border: 1px solid grey;
|
||||
border: none;
|
||||
background-color: @base-background;
|
||||
font-size: 14px;
|
||||
padding-top: 3px;
|
||||
@ -74,12 +81,59 @@ QComboBox#NotebookSelector QListWidget::item:hover {
|
||||
}
|
||||
/* End QComboBox#NotebookSelector */
|
||||
|
||||
QTreeWidget {
|
||||
padding-top: 3px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
QTreeWidget::item {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
QListWidget {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QListWidget::item {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
QListWidget#FileList {
|
||||
border-top: 2px solid @base-color;
|
||||
}
|
||||
|
||||
QSplitter {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QSplitter::handle {
|
||||
background-color: @base-color;
|
||||
}
|
||||
|
||||
QSplitter::handle:vertical {
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* QMainWindow */
|
||||
QMainWindow::separator {
|
||||
background-color: @base-color;
|
||||
height: 2px;
|
||||
}
|
||||
/* End QMainWindow */
|
||||
|
||||
QTabWidget {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QLabel[TitleLabel="true"] {
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
background-color: @base-color;
|
||||
}
|
||||
|
||||
QToolBox::tab {
|
||||
background-color: @Indigo2;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ void VEditArea::setupUI()
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout();
|
||||
mainLayout->addWidget(splitter);
|
||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
setLayout(mainLayout);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ void VEditWindow::setupCornerWidget()
|
||||
|
||||
rightBtn = new QPushButton(QIcon(":/resources/icons/corner_menu.svg"),
|
||||
"", this);
|
||||
rightBtn->setProperty("FlatBtn", true);
|
||||
rightBtn->setProperty("CornerBtn", true);
|
||||
QMenu *rightMenu = new QMenu(this);
|
||||
rightMenu->addAction(splitAct);
|
||||
rightMenu->addAction(removeSplitAct);
|
||||
@ -61,7 +61,7 @@ void VEditWindow::setupCornerWidget()
|
||||
this, &VEditWindow::tabListJump);
|
||||
leftBtn = new QPushButton(QIcon(":/resources/icons/corner_tablist.svg"),
|
||||
"", this);
|
||||
leftBtn->setProperty("FlatBtn", true);
|
||||
leftBtn->setProperty("CornerBtn", true);
|
||||
QMenu *leftMenu = new QMenu(this);
|
||||
leftBtn->setMenu(leftMenu);
|
||||
setCornerWidget(leftBtn, Qt::TopLeftCorner);
|
||||
@ -534,7 +534,7 @@ bool VEditWindow::eventFilter(QObject *watched, QEvent *event)
|
||||
bool VEditWindow::scrollerVisible() const
|
||||
{
|
||||
QTabBar *bar = tabBar();
|
||||
int barWidth = bar->width();
|
||||
int barWidth = rect().width() - leftBtn->width() - rightBtn->width();
|
||||
int nrTab = count();
|
||||
int tabsWidth = 0;
|
||||
for (int i = 0; i < nrTab; ++i) {
|
||||
|
@ -21,6 +21,7 @@ void VFileList::setupUI()
|
||||
fileList = new QListWidget(this);
|
||||
fileList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
fileList->setObjectName("FileList");
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
mainLayout->addWidget(fileList);
|
||||
|
@ -78,7 +78,9 @@ void VMainWindow::setupUI()
|
||||
QWidget *VMainWindow::setupDirectoryPanel()
|
||||
{
|
||||
notebookLabel = new QLabel(tr("Notebook"));
|
||||
notebookLabel->setProperty("TitleLabel", true);
|
||||
directoryLabel = new QLabel(tr("Directory"));
|
||||
directoryLabel->setProperty("TitleLabel", true);
|
||||
|
||||
notebookSelector = new VNotebookSelector(vnote);
|
||||
notebookSelector->setObjectName("NotebookSelector");
|
||||
@ -91,7 +93,8 @@ QWidget *VMainWindow::setupDirectoryPanel()
|
||||
nbLayout->addWidget(notebookSelector);
|
||||
nbLayout->addWidget(directoryLabel);
|
||||
nbLayout->addWidget(directoryTree);
|
||||
nbLayout->setContentsMargins(5, 0, 0, 0);
|
||||
nbLayout->setContentsMargins(2, 0, 0, 0);
|
||||
nbLayout->setSpacing(0);
|
||||
QWidget *nbContainer = new QWidget();
|
||||
nbContainer->setLayout(nbLayout);
|
||||
nbContainer->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding);
|
||||
|
@ -30,6 +30,20 @@ void VNote::initPalette(QPalette palette)
|
||||
m_palette.append(QPair<QString, QString>("base-foreground",
|
||||
palette.background().color().name()));
|
||||
m_palette.append(QPair<QString, QString>("hover-color", "#42A5F5"));
|
||||
m_palette.append(QPair<QString, QString>("base-color", "#81C784"));
|
||||
|
||||
// Material Design Colors
|
||||
m_palette.append(QPair<QString, QString>("teal0", "#E0F2F1"));
|
||||
m_palette.append(QPair<QString, QString>("teal1", "#B2DFDB"));
|
||||
m_palette.append(QPair<QString, QString>("teal2", "#80CBC4"));
|
||||
m_palette.append(QPair<QString, QString>("teal3", "#4DB6AC"));
|
||||
m_palette.append(QPair<QString, QString>("teal4", "#26A69A"));
|
||||
|
||||
m_palette.append(QPair<QString, QString>("Indigo0", "#E8EAF6"));
|
||||
m_palette.append(QPair<QString, QString>("Indigo1", "#C5CAE9"));
|
||||
m_palette.append(QPair<QString, QString>("Indigo2", "#9FA8DA"));
|
||||
m_palette.append(QPair<QString, QString>("Indigo3", "#7986CB"));
|
||||
m_palette.append(QPair<QString, QString>("Indigo4", "#5C6BC0"));
|
||||
}
|
||||
|
||||
void VNote::initTemplate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user