Skip to content

Commit cdab9da

Browse files
wjyrichdeepin-bot[bot]
authored andcommitted
fix: remove redundant palette setup in RoundScrollArea
1. Removed unnecessary palette initialization in constructor that was setting window brush to transparent 2. Changed paintEvent to directly use Qt::transparent instead of palette().window() 3. This simplifies the code while maintaining the same visual effect of transparency 4. The palette setup was redundant since we're manually painting the background anyway fix: 移除RoundScrollArea,使用QScrollArea. 1. 移除RoundScrollArea 2. 修改paintEvent直接使用Qt::transparent替代palette().window() 3. 在保持相同透明视觉效果的同时简化了代码 4. 调色板设置是多余的,因为我们已经手动绘制背景 Pms: bug-315535
1 parent 731f05a commit cdab9da

5 files changed

Lines changed: 2 additions & 70 deletions

File tree

plugins/dde-dock/brightness/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ file(GLOB_RECURSE SRCS
1414
"../widgets/*.cpp"
1515
"../common/*.h"
1616
"../common/*.cpp"
17-
"../util/roundscrollarea.h"
18-
"../util/roundscrollarea.cpp"
1917
"../dbus/types/*.h"
2018
"../dbus/types/*.cpp"
2119
)

plugins/dde-dock/brightness/brightnessapplet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ DWIDGET_USE_NAMESPACE
2222
BrightnessApplet::BrightnessApplet(QWidget* parent)
2323
: QWidget(parent)
2424
, m_titleWidget(new QWidget(this))
25-
, m_scrollArea(new RoundScrollArea(this))
25+
, m_scrollArea(new QScrollArea(this))
2626
, m_monitorsLayout(nullptr)
2727
, m_jumpSettingButton(new JumpSettingButton(this))
2828
, m_minHeight(-1)
@@ -58,7 +58,6 @@ void BrightnessApplet::initUI()
5858
widget->setAttribute(Qt::WA_TranslucentBackground);
5959
widget->setLayout(m_monitorsLayout);
6060
m_scrollArea->setWidget(widget);
61-
m_scrollArea->setRadius(0);
6261
m_scrollArea->setWidgetResizable(true);
6362
m_scrollArea->setFrameStyle(QFrame::NoFrame);
6463
m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

plugins/dde-dock/brightness/brightnessapplet.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "jumpsettingbutton.h"
99
#include "monitor.h"
1010
#include "slidercontainer.h"
11-
#include "roundscrollarea.h"
1211

1312
#include <QWidget>
1413
#include <QScrollArea>
@@ -39,7 +38,7 @@ class BrightnessApplet : public QWidget
3938

4039
private:
4140
QWidget *m_titleWidget;
42-
RoundScrollArea *m_scrollArea;
41+
QScrollArea *m_scrollArea;
4342
QVBoxLayout *m_monitorsLayout;
4443
JumpSettingButton *m_jumpSettingButton;
4544
int m_minHeight;

plugins/dde-dock/util/roundscrollarea.cpp

Lines changed: 0 additions & 39 deletions
This file was deleted.

plugins/dde-dock/util/roundscrollarea.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)