Skip to content

Commit

Permalink
show border around panel with focus
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Jan 25, 2024
1 parent 46edb12 commit c448602
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/docks/encodedock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand Down Expand Up @@ -799,7 +799,7 @@ with parallel processing enabled.</string>
<string>YADIF - temporal + spatial (better)</string>
</property>
</item>
<item>
<item>
<property name="text">
<string>BWDIF (best)</string>
</property>
Expand Down
11 changes: 9 additions & 2 deletions src/docks/filtersdock.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,6 +25,7 @@
#include <QQmlContext>
#include <QAction>
#include <QIcon>
#include <QVBoxLayout>
#include <Logger.h>

#include "actions.h"
Expand Down Expand Up @@ -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));
Expand Down
8 changes: 4 additions & 4 deletions src/docks/jobsdock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
Expand Down
2 changes: 1 addition & 1 deletion src/docks/keyframesdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/docks/playlistdock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<item>
<widget class="QStackedWidget" name="stackedWidget">
Expand Down
8 changes: 4 additions & 4 deletions src/docks/recentdock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>1</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
<number>1</number>
</property>
<item>
<widget class="LineEditClear" name="lineEdit">
Expand Down
2 changes: 1 addition & 1 deletion src/docks/timelinedock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 11 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,17 @@ void MainWindow::setupAndConnectDocks()
tabifyDockWidget(m_keyframesDock, m_timelineDock);
m_recentDock->raise();
resetDockCorners();

for (auto dock : findChildren<QDockWidget *>()) {
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()
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/scopes/videozoomscopewidget.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c448602

Please sign in to comment.