ui: Custom style for dock widget title bars
* avoid style loading in every view on application start * improved contrast of reference label * moved Reset Window Layout action up in View menu
This commit is contained in:
@@ -62,6 +62,7 @@ void Application::createInstance(
|
||||
s_instance->m_componentManager->setup(s_instance->m_mainView.get());
|
||||
s_instance->m_mainView->loadLayout();
|
||||
|
||||
s_instance->m_componentManager->refreshViews();
|
||||
}
|
||||
|
||||
if (networkFactory != nullptr)
|
||||
|
||||
@@ -14,7 +14,6 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout)
|
||||
: CodeView(viewLayout)
|
||||
{
|
||||
m_widget = new QtCodeNavigator();
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
QtCodeView::~QtCodeView()
|
||||
|
||||
@@ -180,8 +180,6 @@ void QtErrorView::initView()
|
||||
checkboxes->addSpacing(10);
|
||||
|
||||
layout->addLayout(checkboxes);
|
||||
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
void QtErrorView::refreshView()
|
||||
|
||||
@@ -150,8 +150,6 @@ void QtGraphView::initView()
|
||||
updateTrailButtons();
|
||||
trailDepthChanged(0);
|
||||
}
|
||||
|
||||
refreshView();
|
||||
}
|
||||
|
||||
void QtGraphView::refreshView()
|
||||
|
||||
@@ -9,7 +9,6 @@ QtRefreshView::QtRefreshView(ViewLayout* viewLayout)
|
||||
: RefreshView(viewLayout)
|
||||
{
|
||||
m_widget = new QtRefreshBar();
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
QtRefreshView::~QtRefreshView()
|
||||
|
||||
@@ -11,7 +11,6 @@ QtSearchView::QtSearchView(ViewLayout* viewLayout)
|
||||
: SearchView(viewLayout)
|
||||
{
|
||||
m_widget = new QtSearchBar();
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
QtSearchView::~QtSearchView()
|
||||
|
||||
@@ -74,8 +74,6 @@ void QtStatusView::initView()
|
||||
filters->addSpacing(10);
|
||||
|
||||
layout->addLayout(filters);
|
||||
|
||||
refreshView();
|
||||
}
|
||||
|
||||
void QtStatusView::refreshView()
|
||||
|
||||
@@ -9,7 +9,6 @@ QtUndoRedoView::QtUndoRedoView(ViewLayout* viewLayout)
|
||||
: UndoRedoView(viewLayout)
|
||||
{
|
||||
m_widget = new QtUndoRedo();
|
||||
setStyleSheet();
|
||||
}
|
||||
|
||||
QtUndoRedoView::~QtUndoRedoView()
|
||||
|
||||
@@ -128,7 +128,7 @@ QtMainWindow::QtMainWindow()
|
||||
{
|
||||
// can only be done once, because resetting the style on the QCoreApplication causes crash
|
||||
app->setStyleSheet(
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("scrollbar.css"))).c_str());
|
||||
utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("main/scrollbar.css"))).c_str());
|
||||
}
|
||||
|
||||
m_recentProjectAction = new QAction*[ApplicationSettings::getInstance()->getMaxRecentProjectsCount()];
|
||||
@@ -379,7 +379,7 @@ void QtMainWindow::setContentEnabled(bool enabled)
|
||||
|
||||
void QtMainWindow::refreshStyle()
|
||||
{
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("main.css"))).c_str());
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concatenate(FilePath("main/main.css"))).c_str());
|
||||
}
|
||||
|
||||
void QtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
@@ -685,7 +685,7 @@ void QtMainWindow::resetWindowLayout()
|
||||
{
|
||||
FileSystem::remove(UserPaths::getWindowSettingsPath());
|
||||
FileSystem::copyFile(
|
||||
ResourcePaths::getFallbackPath().concatenate(FilePath("window_settings.ini")),
|
||||
ResourcePaths::getFallbackPath().concatenate(FilePath("window_settings.ini")),
|
||||
UserPaths::getWindowSettingsPath()
|
||||
);
|
||||
loadDockWidgetLayout();
|
||||
@@ -851,15 +851,15 @@ void QtMainWindow::setupViewMenu()
|
||||
m_showTitleBarsAction->setChecked(m_showDockWidgetTitleBars);
|
||||
connect(m_showTitleBarsAction, &QAction::triggered, this, &QtMainWindow::toggleShowDockWidgetTitleBars);
|
||||
menu->addAction(m_showTitleBarsAction);
|
||||
menu->addAction(tr("Reset Window Layout"), this, &QtMainWindow::resetWindowLayout);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
m_viewSeparator = menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Larger font"), this, &QtMainWindow::zoomIn, QKeySequence::ZoomIn);
|
||||
menu->addAction(tr("Smaller font"), this, &QtMainWindow::zoomOut, QKeySequence::ZoomOut);
|
||||
menu->addAction(tr("Reset font size"), this, &QtMainWindow::resetZoom, QKeySequence(Qt::CTRL + Qt::Key_0));
|
||||
menu->addAction(tr("Reset window layout"), this, &QtMainWindow::resetWindowLayout);
|
||||
menu->addAction(tr("Larger Font"), this, &QtMainWindow::zoomIn, QKeySequence::ZoomIn);
|
||||
menu->addAction(tr("Smaller Font"), this, &QtMainWindow::zoomOut, QKeySequence::ZoomOut);
|
||||
menu->addAction(tr("Reset Font Size"), this, &QtMainWindow::resetZoom, QKeySequence(Qt::CTRL + Qt::Key_0));
|
||||
|
||||
m_viewMenu = menu;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user