mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
Merge branch 'wangxuwen-uos' into 'uos'
fixed : change the dock position will display error for bug 25873 See merge request dde-v20/dde-dock!508
This commit is contained in:
commit
89acbaea91
@ -28,6 +28,7 @@
|
||||
#include <QCursor>
|
||||
|
||||
#define PLUGIN_MARGIN 10
|
||||
#define ITEM_MAXSIZE 100
|
||||
|
||||
Position DockItem::DockPosition = Position::Top;
|
||||
DisplayMode DockItem::DockDisplayMode = DisplayMode::Efficient;
|
||||
@ -75,6 +76,8 @@ DockItem::DockItem(QWidget *parent)
|
||||
QSize DockItem::sizeHint() const
|
||||
{
|
||||
int size = qMin(maximumWidth(), maximumHeight());
|
||||
if (size > ITEM_MAXSIZE)
|
||||
size = ITEM_MAXSIZE;
|
||||
|
||||
return QSize(size, size);
|
||||
}
|
||||
|
@ -217,6 +217,9 @@ void MainPanelControl::updateMainPanelLayout()
|
||||
m_pluginLayout->setContentsMargins(0, 10, 0, 10);
|
||||
break;
|
||||
}
|
||||
|
||||
resizeDesktopWidget();
|
||||
resizeDockIcon();
|
||||
}
|
||||
|
||||
void MainPanelControl::addFixedAreaItem(int index, QWidget *wdg)
|
||||
@ -277,14 +280,7 @@ void MainPanelControl::removePluginAreaItem(QWidget *wdg)
|
||||
|
||||
void MainPanelControl::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
if (m_position == Position::Right || m_position == Position::Left)
|
||||
m_desktopWidget->setFixedSize(width(), DESKTOP_SIZE);
|
||||
else
|
||||
m_desktopWidget->setFixedSize(DESKTOP_SIZE, height());
|
||||
|
||||
if (DisplayMode::Fashion == m_dislayMode)
|
||||
m_desktopWidget->setFixedSize(0, 0);
|
||||
|
||||
resizeDesktopWidget();
|
||||
resizeDockIcon();
|
||||
return QWidget::resizeEvent(event);
|
||||
}
|
||||
@ -1076,3 +1072,15 @@ void MainPanelControl::getTrayVisableItemCount()
|
||||
// 模式切换时,托盘区域宽度错误,对应任务11933
|
||||
m_trayAreaWidget->adjustSize();
|
||||
}
|
||||
|
||||
void MainPanelControl::resizeDesktopWidget()
|
||||
{
|
||||
if (m_position == Position::Right || m_position == Position::Left)
|
||||
m_desktopWidget->setFixedSize(width(), DESKTOP_SIZE);
|
||||
else
|
||||
m_desktopWidget->setFixedSize(DESKTOP_SIZE, height());
|
||||
|
||||
if (DisplayMode::Fashion == m_dislayMode)
|
||||
m_desktopWidget->setFixedSize(0, 0);
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ private:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void resizeDockIcon();
|
||||
void calcuDockIconSize(const int w, const int h, PluginsItem *trashPlugin, PluginsItem *shutdownPlugin, PluginsItem *keyboardPlugin, PluginsItem *notificationPlugin);
|
||||
|
||||
void resizeDesktopWidget();
|
||||
public slots:
|
||||
void insertItem(const int index, DockItem *item);
|
||||
void removeItem(DockItem *item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user