Skip to content

Commit

Permalink
fix: [ui] fix search filter background
Browse files Browse the repository at this point in the history
fix search filter background and fix tag crumbedit for refresh will lose text when editing

Log: [ui] fix search filter background
Bug: https://pms.uniontech.com/bug-view-237399.html https://pms.uniontech.com/bug-view-237399.html
  • Loading branch information
pppanghu77 committed Jan 8, 2024
1 parent fc76485 commit a0318e5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/plugins/common/dfmplugin-tag/widgets/tagwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ bool TagWidget::shouldShow(const QUrl &url)

void TagWidget::onCrumbListChanged()
{
if (!d->crumbEdit->property("updateCrumbsColor").toBool()) {
if (!d->crumbEdit->isEditing() && !d->crumbEdit->property("updateCrumbsColor").toBool()) {
updateCrumbsColor(TagManager::instance()->assignColorToTags((d->crumbEdit->crumbList())));
if (!d->crumbEdit->isEditing() && !d->crumbEdit->property("LoadFileTags").toBool()) {
if (!d->crumbEdit->property("LoadFileTags").toBool()) {
bool ret = TagManager::instance()->setTagsForFiles(d->crumbEdit->crumbList(), { d->url });

if (!ret) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <QDebug>
#include <QCloseEvent>
#include <QTimer>
#include <QGraphicsEffect>

using namespace dfmplugin_sidebar;
DFMBASE_USE_NAMESPACE
Expand Down Expand Up @@ -289,6 +290,12 @@ void SideBarWidget::onItemRenamed(const QModelIndex &index, const QString &newNa

void SideBarWidget::initializeUi()
{
QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect;
effect->setColor(QColor(0, 0, 0, 5));
effect->setOffset(4, 0);
effect->setBlurRadius(20);
setGraphicsEffect(effect);

QVBoxLayout *vlayout = new QVBoxLayout(this);

QWidget *spacer = new QWidget(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <dtkwidget_global.h>
#ifdef DTKWIDGET_CLASS_DSizeMode
# include <DSizeMode>
#include <QGraphicsEffect>
#endif

DFMBASE_USE_NAMESPACE
Expand Down Expand Up @@ -141,8 +142,12 @@ void AdvanceSearchBarPrivate::initUI()
formLayout->setSpacing(6);
formLayout->setMargin(6);

QVBoxLayout *vLayout = new QVBoxLayout(this);
vLayout->addSpacing(10);
vLayout->addLayout(formLayout);

mainLayout->addSpacing(20);
mainLayout->addLayout(formLayout);
mainLayout->addLayout(vLayout);
mainLayout->addSpacing(20);

q->setWidget(this);
Expand Down Expand Up @@ -445,17 +450,21 @@ AdvanceSearchBar::AdvanceSearchBar(QWidget *parent)
: QScrollArea(parent),
d(new AdvanceSearchBarPrivate(this))
{
QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect;
effect->setColor(QColor(0, 0, 0, 5));
effect->setOffset(0, 4);
effect->setBlurRadius(20);
setGraphicsEffect(effect);
#ifdef DTKWIDGET_CLASS_DSizeMode
setFixedHeight(DSizeModeHelper::element(73, QWIDGETSIZE_MAX));
setFixedHeight(DSizeModeHelper::element(83, 110));
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &AdvanceSearchBar::initUiForSizeMode);
#endif
}

void AdvanceSearchBar::initUiForSizeMode()
{
#ifdef DTKWIDGET_CLASS_DSizeMode
this->setFixedHeight(QWIDGETSIZE_MAX);
disconnect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::sizeModeChanged, this, &AdvanceSearchBar::initUiForSizeMode);
setFixedHeight(DSizeModeHelper::element(83, 110));
#endif
}

Expand Down

0 comments on commit a0318e5

Please sign in to comment.