mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
fix styles
This commit is contained in:
parent
b8dd91e353
commit
3b03fd2189
@ -152,8 +152,14 @@ QToolBar::separator {
|
|||||||
background-color: @widgets#qtoolbar#separator#bg;
|
background-color: @widgets#qtoolbar#separator#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
background-color: @widgets#qtoolbar#extension#bg;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
|
background-color: @widgets#qtoolbar#extension#hover#bg;
|
||||||
|
margin: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
@ -302,7 +302,10 @@
|
|||||||
"bg" : "@widgets#separator#bg"
|
"bg" : "@widgets#separator#bg"
|
||||||
},
|
},
|
||||||
"extension" : {
|
"extension" : {
|
||||||
"bg" : "@base#normal#fg"
|
"bg" : "@base#normal#border",
|
||||||
|
"hover" : {
|
||||||
|
"bg" : "@base#hover#bg"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"qtoolbutton" : {
|
"qtoolbutton" : {
|
||||||
|
@ -152,8 +152,14 @@ QToolBar::separator {
|
|||||||
background-color: @widgets#qtoolbar#separator#bg;
|
background-color: @widgets#qtoolbar#separator#bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolBarExtension {
|
QToolBarExtension#qt_toolbar_ext_button {
|
||||||
background-color: @widgets#qtoolbar#extension#bg;
|
background-color: @widgets#qtoolbar#extension#bg;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||||
|
background-color: @widgets#qtoolbar#extension#hover#bg;
|
||||||
|
margin: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* QToolButton */
|
/* QToolButton */
|
||||||
|
@ -298,7 +298,10 @@
|
|||||||
"bg" : "@widgets#separator#bg"
|
"bg" : "@widgets#separator#bg"
|
||||||
},
|
},
|
||||||
"extension" : {
|
"extension" : {
|
||||||
"bg" : "@base#normal#fg"
|
"bg" : "@base#normal#border",
|
||||||
|
"hover" : {
|
||||||
|
"bg" : "@base#hover#bg"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"qtoolbutton" : {
|
"qtoolbutton" : {
|
||||||
|
@ -415,5 +415,6 @@ void WidgetUtils::selectBaseName(QLineEdit *p_lineEdit)
|
|||||||
|
|
||||||
void WidgetUtils::setContentsMargins(QLayout *p_layout)
|
void WidgetUtils::setContentsMargins(QLayout *p_layout)
|
||||||
{
|
{
|
||||||
p_layout->setContentsMargins(CONTENTS_MARGIN, CONTENTS_MARGIN, CONTENTS_MARGIN, CONTENTS_MARGIN);
|
// Use 0 bottom margin to align dock widgets with the content area.
|
||||||
|
p_layout->setContentsMargins(CONTENTS_MARGIN, CONTENTS_MARGIN, CONTENTS_MARGIN, 0);
|
||||||
}
|
}
|
||||||
|
@ -251,12 +251,6 @@ void MarkdownViewWindow::handleBufferChangedInternal(const QSharedPointer<FileOp
|
|||||||
void MarkdownViewWindow::setupToolBar()
|
void MarkdownViewWindow::setupToolBar()
|
||||||
{
|
{
|
||||||
auto toolBar = createToolBar(this);
|
auto toolBar = createToolBar(this);
|
||||||
|
|
||||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
|
||||||
|
|
||||||
const int iconSize = editorConfig.getToolBarIconSize();
|
|
||||||
toolBar->setIconSize(QSize(iconSize, iconSize));
|
|
||||||
|
|
||||||
addToolBar(toolBar);
|
addToolBar(toolBar);
|
||||||
|
|
||||||
addAction(toolBar, ViewWindowToolBarHelper::EditReadDiscard);
|
addAction(toolBar, ViewWindowToolBarHelper::EditReadDiscard);
|
||||||
|
@ -14,11 +14,6 @@ OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
|||||||
m_button(p_btn)
|
m_button(p_btn)
|
||||||
{
|
{
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|
||||||
connect(this, &QMenu::aboutToShow,
|
|
||||||
this, [this]() {
|
|
||||||
m_viewer->setFocus();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutlinePopup::setupUI()
|
void OutlinePopup::setupUI()
|
||||||
@ -41,8 +36,12 @@ void OutlinePopup::showEvent(QShowEvent* p_event)
|
|||||||
{
|
{
|
||||||
QMenu::showEvent(p_event);
|
QMenu::showEvent(p_event);
|
||||||
|
|
||||||
|
m_viewer->setFocus();
|
||||||
|
|
||||||
|
// Move it to be right-aligned.
|
||||||
|
if (m_button->isVisible()) {
|
||||||
const auto p = pos();
|
const auto p = pos();
|
||||||
const auto btnRect = m_button->geometry();
|
const auto btnRect = m_button->geometry();
|
||||||
// Move it to right-aligned.
|
|
||||||
move(p.x() + btnRect.width() - geometry().width(), p.y());
|
move(p.x() + btnRect.width() - geometry().width(), p.y());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -60,10 +60,6 @@ void TextViewWindow::setupUI()
|
|||||||
void TextViewWindow::setupToolBar()
|
void TextViewWindow::setupToolBar()
|
||||||
{
|
{
|
||||||
auto toolBar = createToolBar(this);
|
auto toolBar = createToolBar(this);
|
||||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
|
||||||
const int iconSize = editorConfig.getToolBarIconSize();
|
|
||||||
toolBar->setIconSize(QSize(iconSize, iconSize));
|
|
||||||
|
|
||||||
addToolBar(toolBar);
|
addToolBar(toolBar);
|
||||||
|
|
||||||
addAction(toolBar, ViewWindowToolBarHelper::Save);
|
addAction(toolBar, ViewWindowToolBarHelper::Save);
|
||||||
|
@ -1146,6 +1146,16 @@ QToolBar *ViewWindow::createToolBar(QWidget *p_parent)
|
|||||||
{
|
{
|
||||||
auto toolBar = new QToolBar(p_parent);
|
auto toolBar = new QToolBar(p_parent);
|
||||||
toolBar->setProperty(PropertyDefs::c_viewWindowToolBar, true);
|
toolBar->setProperty(PropertyDefs::c_viewWindowToolBar, true);
|
||||||
|
|
||||||
|
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||||
|
const int iconSize = editorConfig.getToolBarIconSize();
|
||||||
|
toolBar->setIconSize(QSize(iconSize, iconSize));
|
||||||
|
|
||||||
|
/*
|
||||||
|
auto extBtn = toolBar->findChild<QToolButton *>(QLatin1String("qt_toolbar_ext_button"));
|
||||||
|
Q_ASSERT(extBtn);
|
||||||
|
*/
|
||||||
|
|
||||||
return toolBar;
|
return toolBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user