mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +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;
|
||||
}
|
||||
|
||||
QToolBarExtension {
|
||||
QToolBarExtension#qt_toolbar_ext_button {
|
||||
background-color: @widgets#qtoolbar#extension#bg;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
/* QToolButton */
|
||||
|
@ -302,7 +302,10 @@
|
||||
"bg" : "@widgets#separator#bg"
|
||||
},
|
||||
"extension" : {
|
||||
"bg" : "@base#normal#fg"
|
||||
"bg" : "@base#normal#border",
|
||||
"hover" : {
|
||||
"bg" : "@base#hover#bg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"qtoolbutton" : {
|
||||
|
@ -152,8 +152,14 @@ QToolBar::separator {
|
||||
background-color: @widgets#qtoolbar#separator#bg;
|
||||
}
|
||||
|
||||
QToolBarExtension {
|
||||
QToolBarExtension#qt_toolbar_ext_button {
|
||||
background-color: @widgets#qtoolbar#extension#bg;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
QToolBarExtension#qt_toolbar_ext_button:hover {
|
||||
background-color: @widgets#qtoolbar#extension#hover#bg;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
/* QToolButton */
|
||||
|
@ -298,7 +298,10 @@
|
||||
"bg" : "@widgets#separator#bg"
|
||||
},
|
||||
"extension" : {
|
||||
"bg" : "@base#normal#fg"
|
||||
"bg" : "@base#normal#border",
|
||||
"hover" : {
|
||||
"bg" : "@base#hover#bg"
|
||||
}
|
||||
}
|
||||
},
|
||||
"qtoolbutton" : {
|
||||
|
@ -415,5 +415,6 @@ void WidgetUtils::selectBaseName(QLineEdit *p_lineEdit)
|
||||
|
||||
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()
|
||||
{
|
||||
auto toolBar = createToolBar(this);
|
||||
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
|
||||
const int iconSize = editorConfig.getToolBarIconSize();
|
||||
toolBar->setIconSize(QSize(iconSize, iconSize));
|
||||
|
||||
addToolBar(toolBar);
|
||||
|
||||
addAction(toolBar, ViewWindowToolBarHelper::EditReadDiscard);
|
||||
|
@ -14,11 +14,6 @@ OutlinePopup::OutlinePopup(QToolButton *p_btn, QWidget *p_parent)
|
||||
m_button(p_btn)
|
||||
{
|
||||
setupUI();
|
||||
|
||||
connect(this, &QMenu::aboutToShow,
|
||||
this, [this]() {
|
||||
m_viewer->setFocus();
|
||||
});
|
||||
}
|
||||
|
||||
void OutlinePopup::setupUI()
|
||||
@ -41,8 +36,12 @@ void OutlinePopup::showEvent(QShowEvent* p_event)
|
||||
{
|
||||
QMenu::showEvent(p_event);
|
||||
|
||||
const auto p = pos();
|
||||
const auto btnRect = m_button->geometry();
|
||||
// Move it to right-aligned.
|
||||
move(p.x() + btnRect.width() - geometry().width(), p.y());
|
||||
m_viewer->setFocus();
|
||||
|
||||
// Move it to be right-aligned.
|
||||
if (m_button->isVisible()) {
|
||||
const auto p = pos();
|
||||
const auto btnRect = m_button->geometry();
|
||||
move(p.x() + btnRect.width() - geometry().width(), p.y());
|
||||
}
|
||||
}
|
||||
|
@ -60,10 +60,6 @@ void TextViewWindow::setupUI()
|
||||
void TextViewWindow::setupToolBar()
|
||||
{
|
||||
auto toolBar = createToolBar(this);
|
||||
const auto &editorConfig = ConfigMgr::getInst().getEditorConfig();
|
||||
const int iconSize = editorConfig.getToolBarIconSize();
|
||||
toolBar->setIconSize(QSize(iconSize, iconSize));
|
||||
|
||||
addToolBar(toolBar);
|
||||
|
||||
addAction(toolBar, ViewWindowToolBarHelper::Save);
|
||||
|
@ -1146,6 +1146,16 @@ QToolBar *ViewWindow::createToolBar(QWidget *p_parent)
|
||||
{
|
||||
auto toolBar = new QToolBar(p_parent);
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user