Skip to content

Commit

Permalink
fix: border color issue
Browse files Browse the repository at this point in the history
adjust Inner border and outer border

Issue: linuxdeepin/developer-center#8342
  • Loading branch information
mhduiy committed Jun 19, 2024
1 parent 58604a5 commit 7a2e456
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
8 changes: 2 additions & 6 deletions app/mainview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
DGUI_USE_NAMESPACE
WIDGETS_FRAME_BEGIN_NAMESPACE
MainView::MainView( WidgetManager *manager, QWidget *parent)
: DBlurEffectWidget (parent)
: QWidget (parent)
, m_manager(manager)
, m_animationContainer(new AnimationViewContainer(parent))
, m_layout(new QHBoxLayout(this))
Expand All @@ -31,6 +31,7 @@ MainView::MainView( WidgetManager *manager, QWidget *parent)
, m_trickTimer(new QTimer(this))
{
setParent(m_animationContainer);
setAttribute(Qt::WA_TranslucentBackground);
m_appearancehandler->addTargetWidget(m_animationContainer);

// don't display tray in Dock
Expand All @@ -45,7 +46,6 @@ MainView::MainView( WidgetManager *manager, QWidget *parent)
handler.setEnableSystemMove(false);
}

setBlendMode(DBlurEffectWidget::BehindWindowBlend);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);

m_layout->setContentsMargins(UI::defaultMargins);
Expand Down Expand Up @@ -91,10 +91,6 @@ MainView::MainView( WidgetManager *manager, QWidget *parent)
});

m_layout->addStretch();

DPlatformWindowHandle handler(parentWidget());
handler.setBorderWidth(0);
handler.setShadowRadius(0);
}

MainView::~MainView()
Expand Down
2 changes: 1 addition & 1 deletion app/mainview.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GeometryHandler;
class Appearancehandler;
DWIDGET_USE_NAMESPACE

class MainView : public DBlurEffectWidget
class MainView : public QWidget
{
Q_OBJECT

Expand Down
9 changes: 6 additions & 3 deletions app/utils/animationviewcontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ WIDGETS_USE_NAMESPACE
DGUI_USE_NAMESPACE
WIDGETS_FRAME_BEGIN_NAMESPACE
AnimationViewContainer::AnimationViewContainer(QWidget *parent)
: DBlurEffectWidget (parent)
#ifdef DTKWIDGET_CLASS_DBlurEffectWithBorderWidget
: DBlurEffectWithBorderWidget (parent)
#else
: DBlurEffectWidget(parent)
#endif
{
setBlurEnabled(false);
setAttribute(Qt::WA_TranslucentBackground);

resize(0, 0); // Should set size explicitly for region monitor to work correctly.
setWindowFlags(Qt::Tool);
}
Expand Down
10 changes: 10 additions & 0 deletions app/utils/animationviewcontainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@
#include "global.h"
#include <QWidget>
#include <DRegionMonitor>
#include <dtkwidget_config.h>

#ifdef DTKWIDGET_CLASS_DBlurEffectWithBorderWidget
#include <DBlurEffectWithBorderWidget>
#else
#include <DBlurEffectWidget>
#endif

class QPropertyAnimation;
DGUI_USE_NAMESPACE
WIDGETS_FRAME_BEGIN_NAMESPACE
DWIDGET_USE_NAMESPACE
#ifdef DTKWIDGET_CLASS_DBlurEffectWithBorderWidget
class AnimationViewContainer : public DBlurEffectWithBorderWidget
#else
class AnimationViewContainer : public DBlurEffectWidget
#endif
{
Q_OBJECT
Q_PROPERTY(int currentX READ currentX WRITE setCurrentX)
Expand Down

0 comments on commit 7a2e456

Please sign in to comment.