From 8b24e48fde887c7fedbec14bd7219d5e5afd7818 Mon Sep 17 00:00:00 2001 From: xboxones1 <91512529+xboxones1@users.noreply.github.com> Date: Thu, 2 Jan 2025 12:23:27 +0900 Subject: [PATCH] Minor style fixes (#11445) * Clean up removed elements in qt stylesheets * Disable main window when saving * Fixed triangle size in group view --------- Co-authored-by: Jonathan White --- src/gui/DatabaseWidget.cpp | 13 +++++++------ src/gui/styles/base/BaseStyle.cpp | 2 +- src/gui/styles/dark/darkstyle.qss | 4 ++-- src/gui/styles/light/lightstyle.qss | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 6d648b6899..36cca414df 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -2227,9 +2227,10 @@ bool DatabaseWidget::performSave(QString& errorMessage, const QString& fileName) QPointer focusWidget(qApp->focusWidget()); // Lock out interactions - m_entryView->setDisabled(true); - m_groupView->setDisabled(true); - m_tagView->setDisabled(true); + auto mainWindow = getMainWindow(); + if (mainWindow) { + mainWindow->setDisabled(true); + } QApplication::processEvents(); Database::SaveAction saveAction = Database::Atomic; @@ -2269,9 +2270,9 @@ bool DatabaseWidget::performSave(QString& errorMessage, const QString& fileName) } // Return control - m_entryView->setDisabled(false); - m_groupView->setDisabled(false); - m_tagView->setDisabled(false); + if (mainWindow) { + mainWindow->setDisabled(false); + } if (focusWidget && focusWidget->isVisible()) { focusWidget->setFocus(); diff --git a/src/gui/styles/base/BaseStyle.cpp b/src/gui/styles/base/BaseStyle.cpp index 60df4a2ee3..74edec3952 100644 --- a/src/gui/styles/base/BaseStyle.cpp +++ b/src/gui/styles/base/BaseStyle.cpp @@ -1051,7 +1051,7 @@ namespace Phantom // Expected time (release): 5usecs for regular-sized arrows Q_NEVER_INLINE void drawArrow(QPainter* p, QRect rect, Qt::ArrowType arrowDirection, const QBrush& brush) { - const qreal ArrowBaseRatio = 0.9; + const qreal ArrowBaseRatio = 1.0; qreal irx, iry, irw, irh; QRectF(rect).getRect(&irx, &iry, &irw, &irh); if (irw < 1.0 || irh < 1.0) diff --git a/src/gui/styles/dark/darkstyle.qss b/src/gui/styles/dark/darkstyle.qss index b25458e9fc..2b0cfebc09 100644 --- a/src/gui/styles/dark/darkstyle.qss +++ b/src/gui/styles/dark/darkstyle.qss @@ -1,11 +1,11 @@ -DatabaseWidget:!active, GroupView:!active, +DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, EntryPreviewWidget TagsEdit:!active, QStatusBar:!active { background-color: #404042; } -DatabaseWidget:disabled, GroupView:disabled, +DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled { diff --git a/src/gui/styles/light/lightstyle.qss b/src/gui/styles/light/lightstyle.qss index ceb8164aeb..a2b6d77699 100644 --- a/src/gui/styles/light/lightstyle.qss +++ b/src/gui/styles/light/lightstyle.qss @@ -1,11 +1,11 @@ -DatabaseWidget:!active, GroupView:!active, +DatabaseWidget:!active, DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active, EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active, EntryPreviewWidget TagsEdit:!active, QStatusBar:!active { background-color: #FCFCFC; } -DatabaseWidget:disabled, GroupView:disabled, +DatabaseWidget:disabled, DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled, EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled, EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled {