mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
shutdown plugin add efficient mode
Change-Id: Ic3a603faa5ba810e7e2e85067e1fdfb66928865a
This commit is contained in:
parent
33a08c3cd4
commit
a999ca6bf7
@ -130,7 +130,7 @@ QSize PluginsItem::sizeHint() const
|
||||
return DockItem::sizeHint();
|
||||
|
||||
// TODO: icon size on efficient mode
|
||||
return QSize(48, 48);
|
||||
return QSize(24, 24);
|
||||
}
|
||||
|
||||
void PluginsItem::startDrag()
|
||||
|
@ -1,5 +1,6 @@
|
||||
<RCC>
|
||||
<qresource prefix="/icons">
|
||||
<file>resources/icons/fashion.svg</file>
|
||||
<file>resources/icons/normal.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
18
plugins/shutdown/resources/icons/normal.svg
Normal file
18
plugins/shutdown/resources/icons/normal.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M7.458,13.976c-3.074,0-5.575-2.501-5.575-5.575c0-1.71,0.77-3.303,2.111-4.368
|
||||
c0.248-0.196,0.611-0.157,0.808,0.093c0.197,0.249,0.156,0.61-0.093,0.808C3.644,5.779,3.033,7.042,3.033,8.4
|
||||
c0,2.44,1.984,4.425,4.425,4.425s4.425-1.984,4.425-4.425c0-1.347-0.603-2.605-1.653-3.45C9.982,4.751,9.942,4.39,10.142,4.142
|
||||
s0.563-0.286,0.809-0.088c1.323,1.064,2.083,2.649,2.083,4.346C13.033,11.475,10.532,13.976,7.458,13.976z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M7.5,8.497c-0.276,0-0.5-0.224-0.5-0.5v-5c0-0.276,0.224-0.5,0.5-0.5S8,2.72,8,2.997v5
|
||||
C8,8.273,7.776,8.497,7.5,8.497z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -5,7 +5,6 @@
|
||||
ShutdownPlugin::ShutdownPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
m_icon.addFile(":/icons/resources/icons/fashion.svg");
|
||||
}
|
||||
|
||||
const QString ShutdownPlugin::pluginName() const
|
||||
@ -24,6 +23,16 @@ void ShutdownPlugin::init(PluginProxyInterface *proxyInter)
|
||||
{
|
||||
m_proxyInter = proxyInter;
|
||||
m_proxyInter->itemAdded(this, QString());
|
||||
|
||||
displayModeChanged(qApp->property(PROP_DISPLAY_MODE).value<Dock::DisplayMode>());
|
||||
}
|
||||
|
||||
void ShutdownPlugin::displayModeChanged(const Dock::DisplayMode displayMode)
|
||||
{
|
||||
if (displayMode == Dock::Fashion)
|
||||
m_icon.addFile(":/icons/resources/icons/fashion.svg");
|
||||
else
|
||||
m_icon.addFile(":/icons/resources/icons/normal.svg");
|
||||
}
|
||||
|
||||
const QIcon ShutdownPlugin::itemIcon(const QString &itemKey)
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
|
||||
const QString pluginName() const;
|
||||
void init(PluginProxyInterface *proxyInter);
|
||||
void displayModeChanged(const Dock::DisplayMode displayMode);
|
||||
|
||||
ItemType pluginType(const QString &itemKey);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user