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:
Eberhard Graether
2018-01-05 01:06:49 +01:00
parent c17f7dd3d4
commit ea8ab3df8e
21 changed files with 64 additions and 34 deletions
+8 -2
View File
@@ -8,6 +8,12 @@
<handle>#80999999</handle>
<line>#80999999</line>
</scrollbar>
<dock>
<text>white</text>
<background>#808080</background>
<line>#A0A0A0</line>
<icon_type>white</icon_type> <!-- white, grey, black -->
</dock>
</window>
<search>
@@ -86,7 +92,7 @@
<navigation>
<background>#494949</background>
<text>#A0A0A0</text>
<text>#CCCCCC</text>
<line>#999</line>
</navigation>
@@ -487,7 +493,7 @@
<box>
<background>#494949</background>
<text>#D4D4D4</text>
<match_label>#A0A0A0</match_label>
<match_label>#CCCCCC</match_label>
</box>
<filter>white</filter>
<button>
+8 -2
View File
@@ -8,6 +8,12 @@
<handle>#80999999</handle>
<line>#80999999</line>
</scrollbar>
<dock>
<text>black</text>
<background>#E0E0E0</background>
<line>#BEBEBE</line>
<icon_type>grey</icon_type> <!-- white, grey, black -->
</dock>
</window>
<search>
@@ -86,7 +92,7 @@
<navigation>
<background>white</background>
<text>#A2A2A2</text>
<text>#727272</text>
<line>#D2D2D2</line>
</navigation>
@@ -448,7 +454,7 @@
<box>
<background>white</background>
<text>black</text>
<match_label>#A0A0A0</match_label>
<match_label>#727272</match_label>
</box>
<filter>black</filter>
<button>
+9 -3
View File
@@ -2,12 +2,18 @@
<config>
<window>
<separator>#AAA</separator>
<separator>#CCC</separator>
<scrollbar>
<background>transparent</background>
<handle>#80999999</handle>
<line>#80999999</line>
</scrollbar>
<dock>
<text>#F7F7F7</text>
<background>#777777</background>
<line>#A0A0A0</line>
<icon_type>white</icon_type> <!-- white, grey, black -->
</dock>
</window>
<search>
@@ -86,7 +92,7 @@
<navigation>
<background>#272728</background>
<text>#A0A0A0</text>
<text>#C5C5C5</text>
<line>#525253</line>
</navigation>
@@ -458,7 +464,7 @@
<box>
<background>#272728</background>
<text>#F7F7F7</text>
<match_label>#A0A0A0</match_label>
<match_label>#C5C5C5</match_label>
</box>
<filter>#F7F7F7</filter>
<button>
-10
View File
@@ -1,10 +0,0 @@
QToolTip {
background-color: #E0E0E0;
color: black;
font-size: <setting:font_size>px;
}
QMainWindow::separator {
background: <color:window/separator>;
width: 1px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

+31
View File
@@ -0,0 +1,31 @@
QToolTip {
background-color: #E0E0E0;
color: black;
font-size: <setting:font_size>px;
}
QMainWindow::separator {
background: <color:window/separator>;
width: 1px;
}
QDockWidget {
color: <color:window/dock/text>;
font-size: 10pt;
titlebar-close-icon: url(<setting:gui_path>main/images/close_<color:window/dock/icon_type>.png);
titlebar-normal-icon: url(<setting:gui_path>main/images/float_<color:window/dock/icon_type>.png);
}
QDockWidget::title {
border-bottom: 1px solid <color:window/dock/line>;
background: <color:window/dock/background>;
text-align: center;
padding-top: 1px;
}
QDockWidget::close-button, QDockWidget::float-button {
background: transparent;
border: none;
icon-size: 12px;
margin-top: 2px;
}
+1
View File
@@ -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)
-1
View File
@@ -14,7 +14,6 @@ QtCodeView::QtCodeView(ViewLayout* viewLayout)
: CodeView(viewLayout)
{
m_widget = new QtCodeNavigator();
setStyleSheet();
}
QtCodeView::~QtCodeView()
-2
View File
@@ -180,8 +180,6 @@ void QtErrorView::initView()
checkboxes->addSpacing(10);
layout->addLayout(checkboxes);
setStyleSheet();
}
void QtErrorView::refreshView()
-2
View File
@@ -150,8 +150,6 @@ void QtGraphView::initView()
updateTrailButtons();
trailDepthChanged(0);
}
refreshView();
}
void QtGraphView::refreshView()
-1
View File
@@ -9,7 +9,6 @@ QtRefreshView::QtRefreshView(ViewLayout* viewLayout)
: RefreshView(viewLayout)
{
m_widget = new QtRefreshBar();
setStyleSheet();
}
QtRefreshView::~QtRefreshView()
-1
View File
@@ -11,7 +11,6 @@ QtSearchView::QtSearchView(ViewLayout* viewLayout)
: SearchView(viewLayout)
{
m_widget = new QtSearchBar();
setStyleSheet();
}
QtSearchView::~QtSearchView()
-2
View File
@@ -74,8 +74,6 @@ void QtStatusView::initView()
filters->addSpacing(10);
layout->addLayout(filters);
refreshView();
}
void QtStatusView::refreshView()
-1
View File
@@ -9,7 +9,6 @@ QtUndoRedoView::QtUndoRedoView(ViewLayout* viewLayout)
: UndoRedoView(viewLayout)
{
m_widget = new QtUndoRedo();
setStyleSheet();
}
QtUndoRedoView::~QtUndoRedoView()
+7 -7
View File
@@ -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;
}