mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00

完成快捷设置面板加载插件,显示插件,完成快捷设置的插件的接口 Log: 完成快捷设置面板的基本功能 Influence: v23任务栏快捷设置面板 Task: https://pms.uniontech.com/task-view-110309.html Change-Id: Idaf5c50f8f447d684646afd3ed0fa3e42a94f83c
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#ifndef QUICKPLUGINWINDOW_H
|
|
#define QUICKPLUGINWINDOW_H
|
|
|
|
#include "constants.h"
|
|
|
|
#include <QWidget>
|
|
|
|
class QuickSettingItem;
|
|
class PluginsItemInterface;
|
|
class QHBoxLayout;
|
|
class QuickSettingContainer;
|
|
class QStandardItemModel;
|
|
class QStandardItem;
|
|
class QMouseEvent;
|
|
|
|
namespace Dtk { namespace Gui { class DRegionMonitor; }
|
|
namespace Widget { class DListView; class DStandardItem; } }
|
|
|
|
using namespace Dtk::Widget;
|
|
|
|
class QuickPluginWindow : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_SIGNALS:
|
|
void itemCountChanged();
|
|
|
|
public:
|
|
explicit QuickPluginWindow(QWidget *parent = nullptr);
|
|
~QuickPluginWindow() override;
|
|
|
|
void setPositon(Dock::Position position);
|
|
void addPlugin(QuickSettingItem *item);
|
|
|
|
QSize suitableSize();
|
|
|
|
protected:
|
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
private:
|
|
void initUi();
|
|
void initConnection();
|
|
void resetSortRole();
|
|
int fixedItemCount();
|
|
DStandardItem *createStandItem(QuickSettingItem *item);
|
|
void removePlugin(QuickSettingItem *item);
|
|
void startDrag(QuickSettingItem *moveItem);
|
|
|
|
private:
|
|
DListView *m_listView;
|
|
QStandardItemModel *m_model;
|
|
Dock::Position m_position;
|
|
};
|
|
|
|
#endif // QUICKPLUGINWINDOW_H
|