mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
feat():add sound and wired icon
This commit is contained in:
parent
0b86ba1c52
commit
d618b622c8
49
plugins/onboard/icon/deepin-virtualkeyboard.svg
Normal file
49
plugins/onboard/icon/deepin-virtualkeyboard.svg
Normal file
@ -0,0 +1,49 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 64 64">
|
||||
<defs>
|
||||
<linearGradient id="deepin-virtualkeyboard-c" x1="50%" x2="50%" y1="0%" y2="98.139%">
|
||||
<stop offset="0%" stop-color="#FFF"/>
|
||||
<stop offset="100%" stop-color="#EDEDED"/>
|
||||
</linearGradient>
|
||||
<rect id="deepin-virtualkeyboard-b" width="52" height="50" x="6" y="7" rx="10.097"/>
|
||||
<filter id="deepin-virtualkeyboard-a" width="119.2%" x="-9.6%" y="-8%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="1.5"/>
|
||||
<feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
|
||||
</filter>
|
||||
<linearGradient id="deepin-virtualkeyboard-d" x1="50%" x2="50%" y1="35.61%" y2="100%">
|
||||
<stop offset="0%" stop-color="#FFF"/>
|
||||
<stop offset="100%" stop-color="#93A0A5"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="deepin-virtualkeyboard-g" x1="50%" x2="50%" y1="0%" y2="100%">
|
||||
<stop offset="0%" stop-color="#4A4A4A"/>
|
||||
<stop offset="97.645%" stop-color="#363636"/>
|
||||
</linearGradient>
|
||||
<path id="deepin-virtualkeyboard-f" d="M44,24 L48,24 L48,28 L44,28 L44,24 Z M38,24 L42,24 L42,28 L38,28 L38,24 Z M32,24 L36,24 L36,28 L32,28 L32,24 Z M38,30 L38,34 L34,34 L34,30 L38,30 Z M26,24 L30,24 L30,28 L26,28 L26,24 Z M32,30 L32,34 L28,34 L28,30 L32,30 Z M16,24 L24,24 L24,28 L16,28 L16,24 Z M16,30 L26,30 L26,34 L16,34 L16,30 Z M42,40 L24,40 L24,36 L42,36 L42,40 Z M22,40 L16,40 L16,36 L22,36 L22,40 Z M48,34 L40,34 L40,30 L48,30 L48,34 Z M48,40 L44,40 L44,36 L48,36 L48,40 Z"/>
|
||||
<filter id="deepin-virtualkeyboard-e" width="103.1%" height="112.5%" x="-1.6%" y="-3.1%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
|
||||
<feColorMatrix in="shadowOffsetOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>
|
||||
</filter>
|
||||
<filter id="deepin-virtualkeyboard-h" width="103.1%" height="112.5%" x="-1.6%" y="-3.1%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetInner1"/>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" k2="-1" k3="1" operator="arithmetic" result="shadowInnerInner1"/>
|
||||
<feColorMatrix in="shadowInnerInner1" result="shadowMatrixInner1" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0"/>
|
||||
<feOffset dy="-1" in="SourceAlpha" result="shadowOffsetInner2"/>
|
||||
<feComposite in="shadowOffsetInner2" in2="SourceAlpha" k2="-1" k3="1" operator="arithmetic" result="shadowInnerInner2"/>
|
||||
<feColorMatrix in="shadowInnerInner2" result="shadowMatrixInner2" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="shadowMatrixInner1"/>
|
||||
<feMergeNode in="shadowMatrixInner2"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<use fill="#000" filter="url(#deepin-virtualkeyboard-a)" xlink:href="#deepin-virtualkeyboard-b"/>
|
||||
<use fill="url(#deepin-virtualkeyboard-c)" xlink:href="#deepin-virtualkeyboard-b"/>
|
||||
<path fill="url(#deepin-virtualkeyboard-d)" fill-rule="nonzero" d="M16.0970874,8 C11.0729048,8 7,12.0729048 7,17.0970874 L7,46.9029126 C7,51.9270952 11.0729048,56 16.0970874,56 L47.9029126,56 C52.9270952,56 57,51.9270952 57,46.9029126 L57,17.0970874 C57,12.0729048 52.9270952,8 47.9029126,8 L16.0970874,8 Z M16.0970874,7 L47.9029126,7 C53.47938,7 58,11.52062 58,17.0970874 L58,46.9029126 C58,52.47938 53.47938,57 47.9029126,57 L16.0970874,57 C10.52062,57 6,52.47938 6,46.9029126 L6,17.0970874 C6,11.52062 10.52062,7 16.0970874,7 Z"/>
|
||||
<g fill-rule="nonzero">
|
||||
<use fill="#000" filter="url(#deepin-virtualkeyboard-e)" xlink:href="#deepin-virtualkeyboard-f"/>
|
||||
<use fill="url(#deepin-virtualkeyboard-g)" xlink:href="#deepin-virtualkeyboard-f"/>
|
||||
<use fill="#000" filter="url(#deepin-virtualkeyboard-h)" xlink:href="#deepin-virtualkeyboard-f"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
@ -1,4 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/icons">
|
||||
<file>icon/deepin-virtualkeyboard.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -43,6 +43,7 @@ OnboardItem::OnboardItem(QWidget *parent)
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
|
||||
update();
|
||||
});
|
||||
m_icon = QIcon::fromTheme(":/icons/icon/deepin-virtualkeyboard.svg");
|
||||
}
|
||||
|
||||
QSize OnboardItem::sizeHint() const
|
||||
@ -116,7 +117,7 @@ const QPixmap OnboardItem::loadSvg(const QString &fileName, const QSize &size) c
|
||||
const auto ratio = devicePixelRatioF();
|
||||
|
||||
QPixmap pixmap;
|
||||
pixmap = QIcon::fromTheme(fileName).pixmap(size * ratio);
|
||||
pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(size * ratio);
|
||||
pixmap.setDevicePixelRatio(ratio);
|
||||
|
||||
return pixmap;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "constants.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
|
||||
class OnboardItem : public QWidget
|
||||
{
|
||||
@ -49,6 +50,7 @@ private:
|
||||
Dock::DisplayMode m_displayMode;
|
||||
bool m_hover;
|
||||
bool m_pressed;
|
||||
QIcon m_icon;
|
||||
};
|
||||
|
||||
#endif // ONBOARDITEM_H
|
||||
|
@ -43,6 +43,7 @@ PluginWidget::PluginWidget(QWidget *parent)
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
|
||||
update();
|
||||
});
|
||||
m_icon = QIcon::fromTheme(":/icons/resources/icons/system-shutdown.svg");
|
||||
}
|
||||
|
||||
QSize PluginWidget::sizeHint() const
|
||||
@ -108,6 +109,7 @@ void PluginWidget::paintEvent(QPaintEvent *e)
|
||||
painter.setOpacity(1);
|
||||
|
||||
pixmap = loadSvg(iconName, QSize(iconSize, iconSize));
|
||||
|
||||
const QRectF &rf = QRectF(rect());
|
||||
const QRectF &rfp = QRectF(pixmap.rect());
|
||||
painter.drawPixmap(rf.center() - rfp.center() / pixmap.devicePixelRatioF(), pixmap);
|
||||
@ -118,7 +120,7 @@ const QPixmap PluginWidget::loadSvg(const QString &fileName, const QSize &size)
|
||||
const auto ratio = devicePixelRatioF();
|
||||
|
||||
QPixmap pixmap;
|
||||
pixmap = QIcon::fromTheme(fileName).pixmap(size * ratio);
|
||||
pixmap = QIcon::fromTheme(fileName, m_icon).pixmap(size * ratio);
|
||||
pixmap.setDevicePixelRatio(ratio);
|
||||
|
||||
return pixmap;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "constants.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
|
||||
class PluginWidget : public QWidget
|
||||
{
|
||||
@ -49,6 +50,7 @@ private:
|
||||
Dock::DisplayMode m_displayMode;
|
||||
bool m_hover;
|
||||
bool m_pressed;
|
||||
QIcon m_icon;
|
||||
};
|
||||
|
||||
#endif // PLUGINWIDGET_H
|
||||
|
3
plugins/shutdown/resources/icons/system-shutdown.svg
Normal file
3
plugins/shutdown/resources/icons/system-shutdown.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
||||
<path fill="#FFF" fill-rule="evenodd" d="M10,0 C15.5138095,0 20,4.48619048 20,10 C20,15.5138095 15.5138095,20 10,20 C4.48571429,20 0,15.5138095 0,10 C0,4.48619048 4.48571429,0 10,0 Z M13.65725,5.1199999 C13.3921533,4.92117739 13.0160725,4.97490322 12.81725,5.2399999 C12.6184275,5.50509658 12.6721533,5.88117739 12.93725,6.0799999 C14.1640688,7.00011398 14.9,8.43965246 14.9,10.0021999 C14.9,12.7084791 12.7062792,14.9021999 10,14.9021999 C7.29372085,14.9021999 5.1,12.7084791 5.1,10.0021999 C5.1,8.44070019 5.83490353,7.00215721 7.06028437,6.08198649 C7.32526319,5.88300693 7.37876615,5.50689435 7.17978659,5.24191553 C6.98080703,4.97693672 6.60469444,4.92343375 6.33971563,5.12241332 C4.81562554,6.26689266 3.9,8.05919144 3.9,10.0021999 C3.9,13.3712208 6.63097915,16.1021999 10,16.1021999 C13.3690208,16.1021999 16.1,13.3712208 16.1,10.0021999 C16.1,8.05789775 15.1831141,6.26439802 13.65725,5.1199999 Z M10.0000002,3 C9.30000019,3 9.30000019,3.69999981 9.30000019,3.69999981 L9.3002076,9.30891871 C9.3031113,9.39022239 9.34666686,10 10.0000002,10 C10.7000002,10 10.7000002,9.30000019 10.7000002,9.30000019 L10.7000002,9.30000019 L10.7000002,3.69999981 C10.7000002,3.69999981 10.7000002,3 10.0000002,3 Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -2,5 +2,6 @@
|
||||
<qresource prefix="/icons">
|
||||
<file>resources/icons/fashion.svg</file>
|
||||
<file>resources/icons/normal.svg</file>
|
||||
<file>resources/icons/system-shutdown.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -12,7 +12,7 @@ find_package(Qt5Svg REQUIRED)
|
||||
find_package(DtkWidget REQUIRED)
|
||||
|
||||
add_definitions("${QT_DEFINITIONS} -DQT_PLUGIN")
|
||||
add_library(${PLUGIN_NAME} SHARED ${SRCS})
|
||||
add_library(${PLUGIN_NAME} SHARED ${SRCS} resource.qrc)
|
||||
set_target_properties(${PLUGIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../)
|
||||
target_include_directories(${PLUGIN_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS}
|
||||
../../interfaces)
|
||||
|
42
plugins/trash/icons/user-trash.svg
Normal file
42
plugins/trash/icons/user-trash.svg
Normal file
@ -0,0 +1,42 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" viewBox="0 0 48 48">
|
||||
<defs>
|
||||
<filter id="user-trash-48px-a" width="134.2%" height="134.2%" x="-17.1%" y="-17.1%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="1"/>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/>
|
||||
<feColorMatrix in="shadowBlurOuter1" result="shadowMatrixOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="shadowMatrixOuter1"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
<path id="user-trash-48px-b" d="M1.75513602,0 L36.244864,-6.66133815e-16 C37.0732911,-8.18313409e-16 37.744864,0.671572875 37.744864,1.5 C37.744864,1.57825952 37.7387394,1.65639902 37.7265465,1.73370286 L32.8052571,32.9348114 C32.3452035,35.8515637 29.8313382,38 26.8785272,38 L11.1214728,38 C8.16866177,38 5.65479649,35.8515637 5.1947429,32.9348114 L0.273453535,1.73370286 C0.144383011,0.915392219 0.70312252,0.147388043 1.52143316,0.0183175191 C1.59873699,0.00612453745 1.6768765,1.56868827e-15 1.75513602,1.55431223e-15 Z"/>
|
||||
<filter id="user-trash-48px-c" width="143.4%" height="144.7%" x="-21.7%" y="-22.4%" filterUnits="objectBoundingBox">
|
||||
<feMorphology in="SourceAlpha" radius="4" result="shadowSpreadInner1"/>
|
||||
<feGaussianBlur in="shadowSpreadInner1" result="shadowBlurInner1" stdDeviation="4"/>
|
||||
<feOffset dy="-5" in="shadowBlurInner1" result="shadowOffsetInner1"/>
|
||||
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" k2="-1" k3="1" operator="arithmetic" result="shadowInnerInner1"/>
|
||||
<feColorMatrix in="shadowInnerInner1" result="shadowMatrixInner1" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0"/>
|
||||
<feGaussianBlur in="SourceAlpha" result="shadowBlurInner2" stdDeviation=".5"/>
|
||||
<feOffset dy="1" in="shadowBlurInner2" result="shadowOffsetInner2"/>
|
||||
<feComposite in="shadowOffsetInner2" in2="SourceAlpha" k2="-1" k3="1" operator="arithmetic" result="shadowInnerInner2"/>
|
||||
<feColorMatrix in="shadowInnerInner2" result="shadowMatrixInner2" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="shadowMatrixInner1"/>
|
||||
<feMergeNode in="shadowMatrixInner2"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
<linearGradient id="user-trash-48px-d" x1="98.965%" x2="0%" y1="50%" y2="50%">
|
||||
<stop offset="0%" stop-color="#9BAF03"/>
|
||||
<stop offset="45.365%" stop-color="#4F6A00"/>
|
||||
<stop offset="100%" stop-color="#A7BB00"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g filter="url(#user-trash-48px-a)" transform="translate(5 5)">
|
||||
<use fill="#BFC7DC" fill-opacity=".8" xlink:href="#user-trash-48px-b"/>
|
||||
<use fill="#000" filter="url(#user-trash-48px-c)" xlink:href="#user-trash-48px-b"/>
|
||||
</g>
|
||||
<path fill="url(#user-trash-48px-d)" d="M23.9160697,18.5651163 C21.8118933,14.3026074 19.5984708,17.7349997 19.5984708,17.7349997 L17.9201962,20.6559531 L21.3749086,22.6379731 L23.9160697,18.5651163 Z M31.3875583,17.2593149 L29.5256234,18.2946288 L28.8432306,17.1116349 C28.8432306,17.1116349 28.3159991,15.8804507 25.7146734,16.0094764 C25.7146734,16.0094764 22.4911196,16.0980843 22.1554646,16.0374578 C22.1554646,16.0374578 23.069016,16.2146737 23.5234168,16.9095466 L25.5816781,20.4849553 L24.0775641,21.3181809 L29.1250541,21.4254432 L31.3875583,17.2593149 Z M19.0158245,27.568928 C16.4049992,31.5469588 20.5436877,31.6231305 20.5436877,31.6231305 L23.9524851,31.5127592 L23.8844042,27.5844732 L19.0158245,27.568928 Z M14,21.9819633 L15.868268,23.0048411 L15.190625,24.1909441 C15.190625,24.1909441 14.3958195,25.2760029 15.8603516,27.3870485 C15.8603516,27.3870485 17.6162068,30.0483962 17.7333694,30.3608558 C17.7333694,30.3608558 17.411964,29.5027577 17.7808677,28.7596945 L19.8232962,25.1749587 L21.3321601,26.0004118 L18.8004987,21.7130304 L14,21.9819633 Z M29.7488656,26.9735447 C34.5604473,27.2720136 32.6082656,23.6903869 32.6082656,23.6903869 L30.8460772,20.8191783 L27.3881982,22.7965347 L29.7488656,26.9735447 Z M24.6459608,30.0157511 L27.2267039,25.7547967 L27.2267039,27.4538931 L31.4081409,27.4538931 C32.2488615,27.4072573 32.8552569,26.7123844 32.8552569,26.7123844 C32.6351813,26.9642176 31.1247342,29.7685816 31.1247342,29.7685816 C29.9626081,32.0537341 28.6104888,31.9013906 28.6104888,31.9013906 L27.2267039,31.9013906 L27.2267039,34 L24.6459608,30.0157511 Z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.5 KiB |
5
plugins/trash/resource.qrc
Normal file
5
plugins/trash/resource.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/user-trash.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -45,6 +45,8 @@ TrashWidget::TrashWidget(QWidget *parent)
|
||||
setAcceptDrops(true);
|
||||
|
||||
setMinimumSize(PLUGIN_ICON_MIN_SIZE, PLUGIN_ICON_MIN_SIZE);
|
||||
|
||||
m_defaulticon = QIcon::fromTheme(":/icons/user-trash.svg");
|
||||
}
|
||||
|
||||
QWidget *TrashWidget::popupApplet()
|
||||
@ -167,10 +169,9 @@ void TrashWidget::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
updateIcon();
|
||||
|
||||
QPainter painter(this);
|
||||
const QRectF &rf = QRectF(rect());
|
||||
const QRectF &rfp = QRectF(m_icon.rect());
|
||||
painter.drawPixmap(rf.center() - rfp.center() / devicePixelRatioF(), m_icon);
|
||||
@ -203,7 +204,7 @@ void TrashWidget::updateIcon()
|
||||
iconString.append("-symbolic");
|
||||
|
||||
const int size = std::min(width(), height()) ;
|
||||
QIcon icon = QIcon::fromTheme(iconString);
|
||||
QIcon icon = QIcon::fromTheme(iconString, m_defaulticon);
|
||||
|
||||
const auto ratio = devicePixelRatioF();
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include <QPixmap>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QIcon>
|
||||
|
||||
class TrashWidget : public QWidget
|
||||
{
|
||||
@ -68,6 +69,7 @@ private:
|
||||
PopupControlWidget *m_popupApplet;
|
||||
|
||||
QPixmap m_icon;
|
||||
QIcon m_defaulticon;
|
||||
};
|
||||
|
||||
#endif // TRASHWIDGET_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user