mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
feat(showdesktop):icon display and default sort
This commit is contained in:
parent
71a45e8cea
commit
355bbc1a02
@ -126,7 +126,7 @@ void ShowDesktopPlugin::invokedMenuItem(const QString &itemKey, const QString &m
|
||||
if (menuId == "show-desktop") {
|
||||
QProcess::startDetached("/usr/lib/deepin-daemon/desktop-toggle");
|
||||
} else if (menuId == "remove") {
|
||||
m_proxyInter->itemRemoved(this, POWER_KEY);
|
||||
pluginStateSwitched();
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ int ShowDesktopPlugin::itemSortKey(const QString &itemKey)
|
||||
{
|
||||
const QString key = QString("pos_%1_%2").arg(itemKey).arg(displayMode());
|
||||
|
||||
return m_proxyInter->getValue(this, key, displayMode() == Dock::DisplayMode::Fashion ? 3 : 3).toInt();
|
||||
return m_proxyInter->getValue(this, key, 1).toInt();
|
||||
}
|
||||
|
||||
void ShowDesktopPlugin::setSortKey(const QString &itemKey, const int order)
|
||||
@ -163,7 +163,10 @@ PluginsItemInterface::PluginType ShowDesktopPlugin::type()
|
||||
|
||||
void ShowDesktopPlugin::updateBatteryVisible()
|
||||
{
|
||||
|
||||
if (pluginIsDisable())
|
||||
m_proxyInter->itemRemoved(this, POWER_KEY);
|
||||
else
|
||||
m_proxyInter->itemAdded(this, POWER_KEY);
|
||||
}
|
||||
|
||||
void ShowDesktopPlugin::loadPlugin()
|
||||
|
@ -47,7 +47,14 @@ void ShowDesktopWidget::paintEvent(QPaintEvent *e)
|
||||
Q_UNUSED(e);
|
||||
|
||||
const auto ratio = devicePixelRatioF();
|
||||
QPixmap icon = QIcon::fromTheme("deepin-toggle-desktop").pixmap(size() * ratio);
|
||||
QPixmap icon;
|
||||
|
||||
if (Dock::Fashion == qApp->property(PROP_DISPLAY_MODE).value<Dock::DisplayMode>()) {
|
||||
icon = QIcon::fromTheme("deepin-toggle-desktop").pixmap(size() * 0.8 * ratio);
|
||||
} else {
|
||||
icon = QIcon::fromTheme("deepin-toggle-desktop").pixmap(size() * 0.7 * ratio);
|
||||
}
|
||||
|
||||
icon.setDevicePixelRatio(ratio);
|
||||
|
||||
QPainter painter(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user