From c448602b71642400c6f898415a41957a555c40de Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Wed, 24 Jan 2024 17:11:18 -0800 Subject: [PATCH] show border around panel with focus --- src/docks/encodedock.ui | 10 +++++----- src/docks/filtersdock.cpp | 11 +++++++++-- src/docks/jobsdock.ui | 8 ++++---- src/docks/keyframesdock.cpp | 2 +- src/docks/playlistdock.ui | 8 ++++---- src/docks/recentdock.ui | 8 ++++---- src/docks/timelinedock.cpp | 2 +- src/mainwindow.cpp | 11 +++++++++++ src/widgets/scopes/videozoomscopewidget.cpp | 4 ++-- 9 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/docks/encodedock.ui b/src/docks/encodedock.ui index a94aa22835..de8c411ef1 100644 --- a/src/docks/encodedock.ui +++ b/src/docks/encodedock.ui @@ -23,16 +23,16 @@ 0 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 @@ -799,7 +799,7 @@ with parallel processing enabled. YADIF - temporal + spatial (better) - + BWDIF (best) diff --git a/src/docks/filtersdock.cpp b/src/docks/filtersdock.cpp index 0c5a558256..72c5a56961 100644 --- a/src/docks/filtersdock.cpp +++ b/src/docks/filtersdock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2023 Meltytech, LLC + * Copyright (c) 2013-2024 Meltytech, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "actions.h" @@ -58,7 +59,13 @@ FiltersDock::FiltersDock(MetadataModel *metadataModel, AttachedFiltersModel *att #ifndef Q_OS_MAC m_qview.setAttribute(Qt::WA_AcceptTouchEvents); #endif - setWidget(&m_qview); + auto vboxLayout = new QVBoxLayout; + vboxLayout->setSpacing(0); + vboxLayout->setContentsMargins(1, 1, 1, 1); + vboxLayout->addWidget(&m_qview); + auto dockContentsWidget = new QWidget; + dockContentsWidget->setLayout(vboxLayout); + QDockWidget::setWidget(dockContentsWidget); QmlUtilities::setCommonProperties(m_qview.rootContext()); m_qview.rootContext()->setContextProperty("view", new QmlView(&m_qview)); diff --git a/src/docks/jobsdock.ui b/src/docks/jobsdock.ui index ba9ff06776..2c01400814 100644 --- a/src/docks/jobsdock.ui +++ b/src/docks/jobsdock.ui @@ -23,16 +23,16 @@ 0 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 diff --git a/src/docks/keyframesdock.cpp b/src/docks/keyframesdock.cpp index c9eb61757c..c467f2aaae 100644 --- a/src/docks/keyframesdock.cpp +++ b/src/docks/keyframesdock.cpp @@ -143,7 +143,7 @@ KeyframesDock::KeyframesDock(QmlProducer *qmlProducer, QWidget *parent) QVBoxLayout *vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(0); - vboxLayout->setContentsMargins(0, 0, 0, 0); + vboxLayout->setContentsMargins(1, 1, 1, 1); DockToolBar *toolbar = new DockToolBar(tr("Keyframes Controls")); QToolButton *menuButton = new QToolButton(); diff --git a/src/docks/playlistdock.ui b/src/docks/playlistdock.ui index ed8e945e29..507f892285 100644 --- a/src/docks/playlistdock.ui +++ b/src/docks/playlistdock.ui @@ -23,16 +23,16 @@ 0 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 diff --git a/src/docks/recentdock.ui b/src/docks/recentdock.ui index bdeba1d278..12f4493b8d 100644 --- a/src/docks/recentdock.ui +++ b/src/docks/recentdock.ui @@ -29,16 +29,16 @@ 0 - 0 + 1 - 0 + 1 - 0 + 1 - 0 + 1 diff --git a/src/docks/timelinedock.cpp b/src/docks/timelinedock.cpp index 81677cdd8b..1181ed1658 100644 --- a/src/docks/timelinedock.cpp +++ b/src/docks/timelinedock.cpp @@ -160,7 +160,7 @@ TimelineDock::TimelineDock(QWidget *parent) : QVBoxLayout *vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(0); - vboxLayout->setContentsMargins(0, 0, 0, 0); + vboxLayout->setContentsMargins(1, 1, 1, 1); DockToolBar *toolbar = new DockToolBar(tr("Timeline Controls")); QToolButton *menuButton = new QToolButton(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 562b00fa9e..014e593e3c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -690,6 +690,17 @@ void MainWindow::setupAndConnectDocks() tabifyDockWidget(m_keyframesDock, m_timelineDock); m_recentDock->raise(); resetDockCorners(); + + for (auto dock : findChildren()) { + connect(qApp, &QApplication::focusChanged, dock, [ = ](QWidget * from, QWidget * to) { + while (to && to != dock) + to = to->parentWidget(); + if (to == dock) + dock->setStyleSheet(QStringLiteral("QDockWidget > QWidget {border: 1px solid rgb(23, 92, 118)}")); + else + dock->setStyleSheet(QStringLiteral("QDockWidget > QWidget {border: 1px solid rgba(0, 0, 0, 0)}")); + }); + } } void MainWindow::setupMenuFile() diff --git a/src/widgets/scopes/videozoomscopewidget.cpp b/src/widgets/scopes/videozoomscopewidget.cpp index 75e68191d4..b91c239617 100644 --- a/src/widgets/scopes/videozoomscopewidget.cpp +++ b/src/widgets/scopes/videozoomscopewidget.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023 Meltytech, LLC + * Copyright (c) 2019-2024 Meltytech, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -106,7 +106,7 @@ VideoZoomScopeWidget::VideoZoomScopeWidget() QWidget::setFont(font); QHBoxLayout *hlayout = new QHBoxLayout(this); - hlayout->setContentsMargins(0, 0, 0, 0); + hlayout->setContentsMargins(1, 1, 1, 1); hlayout->setSpacing(0); QGridLayout *glayout = new QGridLayout(); glayout->setContentsMargins(5, 5, 2, 0);