shutdown plugin add efficient mode

Change-Id: Ic3a603faa5ba810e7e2e85067e1fdfb66928865a
This commit is contained in:
石博文 2016-06-29 11:26:51 +08:00 committed by Hualet Wang
parent 33a08c3cd4
commit a999ca6bf7
5 changed files with 31 additions and 2 deletions

View File

@ -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()

View File

@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/icons">
<file>resources/icons/fashion.svg</file>
<file>resources/icons/normal.svg</file>
</qresource>
</RCC>

View 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="&#x56FE;&#x5C42;_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

View File

@ -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)

View File

@ -14,6 +14,7 @@ public:
const QString pluginName() const;
void init(PluginProxyInterface *proxyInter);
void displayModeChanged(const Dock::DisplayMode displayMode);
ItemType pluginType(const QString &itemKey);