Skip to content

Commit

Permalink
fix: [254647/dock] device list might be shorten
Browse files Browse the repository at this point in the history
use `resize` to adjust the size of device list.

Log: as title.

Bug: https://pms.uniontech.com/bug-view-254647.html
  • Loading branch information
itsXuSt authored and deepin-bot[bot] committed May 20, 2024
1 parent 9b192ba commit c8b9d53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ DeviceList::DeviceList(QWidget *parent)
initConnect();
}

void DeviceList::showEvent(QShowEvent *event)
{
updateHeight();
QScrollArea::showEvent(event);
}

void DeviceList::addDevice(const DockItemData &item)
{
if (deviceItems.contains(item.id))
Expand Down Expand Up @@ -117,7 +111,7 @@ void DeviceList::updateHeight()
int contentHeight = 50 + kDeviceItemHeight * deviceItems.count();
if (contentHeight > 420)
contentHeight = 420;
setFixedHeight(contentHeight);
resize(width(), contentHeight);
}

QWidget *DeviceList::createHeader()
Expand Down
3 changes: 0 additions & 3 deletions src/external/dde-dock-plugins/disk-mount/widgets/devicelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class DeviceList : public QScrollArea
public:
explicit DeviceList(QWidget *parent = nullptr);

protected:
void showEvent(QShowEvent *event) override;

private Q_SLOTS:
void addDevice(const DockItemData &item);
void removeDevice(const QString &id);
Expand Down

0 comments on commit c8b9d53

Please sign in to comment.