Update Interface Category
Change-Id: Id6a12102239077577876daebb4c4a2b61c6a46d5
Verified+1: Anonymous Coward #1000004 Code-Review+2: <mr.asianwang@gmail.com> Submitted-by: <mr.asianwang@gmail.com> Submitted-at: Sun, 06 Sep 2015 17:25:46 +0800 Reviewed-on: https://cr.deepin.io/6793 Project: dde/dde-dock Branch: refs/heads/master
@ -1,6 +1,6 @@
|
||||
#include <QDebug>
|
||||
|
||||
#include "dockconstants.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
#include "trayicon.h"
|
||||
#include "compositetrayitem.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <QFrame>
|
||||
#include <QMap>
|
||||
|
||||
#include "dockconstants.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class TrayIcon;
|
||||
class CompositeTrayItem : public QFrame
|
||||
|
@ -6,9 +6,9 @@
|
||||
#include <QWindow>
|
||||
#include <QWidget>
|
||||
|
||||
#include "dockconstants.h"
|
||||
#include "dockplugininterface.h"
|
||||
#include "dockpluginproxyinterface.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
#include "interfaces/dockplugininterface.h"
|
||||
#include "interfaces/dockpluginproxyinterface.h"
|
||||
|
||||
#include "dbustraymanager.h"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <QX11Info>
|
||||
|
||||
#include "dockconstants.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
#include "trayicon.h"
|
||||
#include <X11/Xlib.h>
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "dialogs/confirmuninstalldialog.h"
|
||||
#include "dialogs/cleartrashdialog.h"
|
||||
#include "dockconstants.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
#include "dbus/dbusfiletrashmonitor.h"
|
||||
#include "dbus/dbusfileoperations.h"
|
||||
#include "dbus/dbusemptytrashjob.h"
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <QIcon>
|
||||
#include <QDebug>
|
||||
#include "mainitem.h"
|
||||
#include "dockconstants.h"
|
||||
#include "dockplugininterface.h"
|
||||
#include "dockpluginproxyinterface.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
#include "interfaces/dockplugininterface.h"
|
||||
#include "interfaces/dockpluginproxyinterface.h"
|
||||
|
||||
class TrashPlugin : public QObject, public DockPluginInterface
|
||||
{
|
||||
|
16
dde-dock/dark.qrc
Normal file
@ -0,0 +1,16 @@
|
||||
<RCC>
|
||||
<qresource prefix="/images">
|
||||
<file>resources/dark/images/close_hover.png</file>
|
||||
<file>resources/dark/images/close_normal.png</file>
|
||||
<file>resources/dark/images/close_press.png</file>
|
||||
<file>resources/dark/images/dark_dock.svg</file>
|
||||
<file>resources/dark/images/open-indicator.png</file>
|
||||
<file>resources/dark/images/opening-indicator.png</file>
|
||||
<file>resources/dark/images/setting_close_small_hover.png</file>
|
||||
<file>resources/dark/images/setting_close_small_normal.png</file>
|
||||
<file>resources/dark/images/setting_close_small_press.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qss">
|
||||
<file>resources/dark/qss/dde-dock.qss</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -14,92 +14,92 @@ INCLUDEPATH += ./src ./libs
|
||||
|
||||
DEFINES += PLUGIN_API_VERSION=1.0
|
||||
|
||||
SOURCES += \
|
||||
src/main.cpp \
|
||||
src/mainwidget.cpp \
|
||||
src/abstractdockitem.cpp \
|
||||
src/Widgets/appbackground.cpp \
|
||||
src/Widgets/appicon.cpp \
|
||||
src/Widgets/docklayout.cpp \
|
||||
src/Widgets/screenmask.cpp \
|
||||
src/Widgets/windowpreview.cpp \
|
||||
src/Panel/panel.cpp \
|
||||
src/Widgets/appitem.cpp \
|
||||
src/Panel/panelmenu.cpp \
|
||||
src/Controller/dockmodedata.cpp \
|
||||
src/Controller/appmanager.cpp \
|
||||
src/DBus/dbusentrymanager.cpp \
|
||||
src/DBus/dbusentryproxyer.cpp \
|
||||
src/DBus/dbuspanelmanager.cpp \
|
||||
src/DBus/dbusclientmanager.cpp \
|
||||
src/DBus/dbusdockedappmanager.cpp \
|
||||
src/DBus/dbusdocksetting.cpp \
|
||||
src/pluginitemwrapper.cpp \
|
||||
src/Widgets/arrowrectangle.cpp \
|
||||
src/dockpluginproxy.cpp \
|
||||
src/dockpluginmanager.cpp\
|
||||
src/DBus/dbusmenumanager.cpp \
|
||||
src/DBus/dbusmenu.cpp \
|
||||
src/Widgets/apppreviews.cpp \
|
||||
src/Widgets/closebutton.cpp \
|
||||
src/DBus/dbushidestatemanager.cpp \
|
||||
libs/xcb_misc.cpp \
|
||||
src/Widgets/launcheritem.cpp \
|
||||
src/Widgets/reflectioneffect.cpp \
|
||||
src/Widgets/highlighteffect.cpp \
|
||||
src/Widgets/previewarrowrectangle.cpp \
|
||||
src/Panel/pluginssettingframe.cpp
|
||||
|
||||
HEADERS += \
|
||||
src/abstractdockitem.h \
|
||||
src/dockplugininterface.h \
|
||||
src/mainwidget.h \
|
||||
src/Widgets/appbackground.h \
|
||||
src/Widgets/appicon.h \
|
||||
src/Widgets/docklayout.h \
|
||||
src/Widgets/screenmask.h \
|
||||
src/Widgets/windowpreview.h \
|
||||
src/Panel/panel.h \
|
||||
src/Widgets/appitem.h \
|
||||
src/Panel/panelmenu.h \
|
||||
src/Controller/dockmodedata.h \
|
||||
src/Controller/appmanager.h \
|
||||
src/DBus/dbusentrymanager.h \
|
||||
src/DBus/dbusentryproxyer.h \
|
||||
src/DBus/dbuspanelmanager.h \
|
||||
src/DBus/dbusclientmanager.h \
|
||||
src/DBus/dbusdockedappmanager.h \
|
||||
src/DBus/dbusdocksetting.h \
|
||||
src/pluginitemwrapper.h \
|
||||
src/Widgets/arrowrectangle.h\
|
||||
src/dockpluginproxyinterface.h \
|
||||
src/dockpluginproxy.h \
|
||||
src/DBus/dbusmenumanager.h \
|
||||
src/DBus/dbusmenu.h \
|
||||
src/dockpluginmanager.h \
|
||||
src/dockconstants.h \
|
||||
src/Widgets/apppreviews.h \
|
||||
src/Widgets/closebutton.h \
|
||||
src/DBus/dbushidestatemanager.h \
|
||||
libs/xcb_misc.h \
|
||||
src/Widgets/launcheritem.h \
|
||||
src/Widgets/reflectioneffect.h \
|
||||
src/Widgets/highlighteffect.h \
|
||||
src/Widgets/previewarrowrectangle.h \
|
||||
src/Panel/pluginssettingframe.h
|
||||
|
||||
RESOURCES += \
|
||||
images.qrc \
|
||||
qss.qrc
|
||||
dark.qrc \
|
||||
light.qrc
|
||||
|
||||
PKGCONFIG += gtk+-2.0 x11 cairo xcb xcb-ewmh xcb-damage dui
|
||||
CONFIG += c++11 link_pkgconfig
|
||||
|
||||
target.path = /usr/bin/
|
||||
|
||||
headers.files += src/dockconstants.h \
|
||||
src/dockplugininterface.h \
|
||||
src/dockpluginproxyinterface.h
|
||||
headers.files += src/interfaces/dockconstants.h \
|
||||
src/interfaces/dockplugininterface.h \
|
||||
src/interfaces/dockpluginproxyinterface.h
|
||||
headers.path = /usr/include/dde-dock
|
||||
|
||||
INSTALLS += headers target
|
||||
|
||||
HEADERS += \
|
||||
libs/xcb_misc.h \
|
||||
src/controller/appmanager.h \
|
||||
src/controller/dockmodedata.h \
|
||||
src/controller/plugins/dockpluginmanager.h \
|
||||
src/controller/plugins/dockpluginproxy.h \
|
||||
src/controller/plugins/pluginitemwrapper.h \
|
||||
src/controller/plugins/pluginssettingframe.h \
|
||||
src/dbus/dbusclientmanager.h \
|
||||
src/dbus/dbusdockedappmanager.h \
|
||||
src/dbus/dbusdocksetting.h \
|
||||
src/dbus/dbusentrymanager.h \
|
||||
src/dbus/dbusentryproxyer.h \
|
||||
src/dbus/dbushidestatemanager.h \
|
||||
src/dbus/dbusmenu.h \
|
||||
src/dbus/dbusmenumanager.h \
|
||||
src/dbus/dbuspanelmanager.h \
|
||||
src/panel/panel.h \
|
||||
src/panel/panelmenu.h \
|
||||
src/widgets/abstractdockitem.h \
|
||||
src/widgets/appbackground.h \
|
||||
src/widgets/appicon.h \
|
||||
src/widgets/appitem.h \
|
||||
src/widgets/apppreviews.h \
|
||||
src/widgets/arrowrectangle.h \
|
||||
src/widgets/docklayout.h \
|
||||
src/widgets/dockmodel.h \
|
||||
src/widgets/dockview.h \
|
||||
src/widgets/highlighteffect.h \
|
||||
src/widgets/launcheritem.h \
|
||||
src/widgets/previewarrowrectangle.h \
|
||||
src/widgets/reflectioneffect.h \
|
||||
src/widgets/screenmask.h \
|
||||
src/widgets/windowpreview.h \
|
||||
src/mainwidget.h
|
||||
|
||||
SOURCES += \
|
||||
libs/xcb_misc.cpp \
|
||||
src/controller/appmanager.cpp \
|
||||
src/controller/dockmodedata.cpp \
|
||||
src/controller/plugins/dockpluginmanager.cpp \
|
||||
src/controller/plugins/dockpluginproxy.cpp \
|
||||
src/controller/plugins/pluginitemwrapper.cpp \
|
||||
src/controller/plugins/pluginssettingframe.cpp \
|
||||
src/dbus/dbusclientmanager.cpp \
|
||||
src/dbus/dbusdockedappmanager.cpp \
|
||||
src/dbus/dbusdocksetting.cpp \
|
||||
src/dbus/dbusentrymanager.cpp \
|
||||
src/dbus/dbusentryproxyer.cpp \
|
||||
src/dbus/dbushidestatemanager.cpp \
|
||||
src/dbus/dbusmenu.cpp \
|
||||
src/dbus/dbusmenumanager.cpp \
|
||||
src/dbus/dbuspanelmanager.cpp \
|
||||
src/panel/panel.cpp \
|
||||
src/panel/panelmenu.cpp \
|
||||
src/widgets/abstractdockitem.cpp \
|
||||
src/widgets/appbackground.cpp \
|
||||
src/widgets/appicon.cpp \
|
||||
src/widgets/appitem.cpp \
|
||||
src/widgets/apppreviews.cpp \
|
||||
src/widgets/arrowrectangle.cpp \
|
||||
src/widgets/docklayout.cpp \
|
||||
src/widgets/dockmodel.cpp \
|
||||
src/widgets/dockview.cpp \
|
||||
src/widgets/highlighteffect.cpp \
|
||||
src/widgets/launcheritem.cpp \
|
||||
src/widgets/previewarrowrectangle.cpp \
|
||||
src/widgets/reflectioneffect.cpp \
|
||||
src/widgets/screenmask.cpp \
|
||||
src/widgets/windowpreview.cpp \
|
||||
src/main.cpp \
|
||||
src/mainwidget.cpp
|
||||
|
@ -1,10 +1,3 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>Resources/images/close_hover.png</file>
|
||||
<file>Resources/images/close_press.png</file>
|
||||
<file>Resources/images/close_normal.png</file>
|
||||
<file>Resources/images/dark_dock.svg</file>
|
||||
<file>Resources/images/opening-indicator.png</file>
|
||||
<file>Resources/images/open-indicator.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/"/>
|
||||
</RCC>
|
||||
|
16
dde-dock/light.qrc
Normal file
@ -0,0 +1,16 @@
|
||||
<RCC>
|
||||
<qresource prefix="/images">
|
||||
<file>resources/light/images/close_hover.png</file>
|
||||
<file>resources/light/images/close_normal.png</file>
|
||||
<file>resources/light/images/close_press.png</file>
|
||||
<file>resources/light/images/dark_dock.svg</file>
|
||||
<file>resources/light/images/open-indicator.png</file>
|
||||
<file>resources/light/images/opening-indicator.png</file>
|
||||
<file>resources/light/images/setting_close_small_hover.png</file>
|
||||
<file>resources/light/images/setting_close_small_normal.png</file>
|
||||
<file>resources/light/images/setting_close_small_press.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qss">
|
||||
<file>resources/light/qss/dde-dock.qss</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,5 +1,3 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>Resources/qss/default.qss</file>
|
||||
</qresource>
|
||||
<qresource prefix="/"/>
|
||||
</RCC>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 962 B After Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
BIN
dde-dock/resources/dark/images/setting_close_small_hover.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
dde-dock/resources/dark/images/setting_close_small_normal.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
dde-dock/resources/dark/images/setting_close_small_press.png
Normal file
After Width: | Height: | Size: 214 B |
@ -4,10 +4,19 @@ QLabel#Panel[isFashionMode="false"] {
|
||||
|
||||
QLabel#Panel[isFashionMode="true"] {
|
||||
border-width: 0px 21px 50px 21px;
|
||||
border-image: url(://Resources/images/dark_dock.svg) 0 21 50 21 stretch;
|
||||
border-image: url(:/images/resources/dark/images/dark_dock.svg) 0 21 50 21 stretch;
|
||||
|
||||
}
|
||||
|
||||
QLabel#DockAppTitle {
|
||||
color: rgba(255,255,255,0.8);
|
||||
}
|
||||
|
||||
QLabel#ClassicModeTitle {
|
||||
color: rgba(255,255,255,1);
|
||||
}
|
||||
|
||||
/*************************************App Background***********************************************/
|
||||
/*item is current opened and is hovered*/
|
||||
QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="true"] {
|
||||
background: rgba(0,188,255,0.80);
|
||||
@ -33,17 +42,22 @@ QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="false"]
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
QLabel#panelMenuContent {
|
||||
background: rgba(255,255,255,0.8);
|
||||
border-radius: 5px;
|
||||
QLabel#AppBackgroundActiveLabel {
|
||||
qproperty-openIndicatorIcon:url(:/images/resources/dark/images/open-indicator.png);
|
||||
qproperty-openingIndicatorIcon:url(:/images/resources/dark/images/opening-indicator.png);
|
||||
}
|
||||
|
||||
QLabel#DockAppTitle {
|
||||
color: rgba(255,255,255,0.8);
|
||||
/******************************Item Preview***********************/
|
||||
QPushButton#PreviewCloseButton {
|
||||
border-image: url(:/images/resources/dark/images/close_normal.png);
|
||||
}
|
||||
|
||||
QLabel#ClassicModeTitle {
|
||||
color: rgba(255,255,255,1);
|
||||
QPushButton#PreviewCloseButton:hover {
|
||||
border-image: url(:/images/resources/dark/images/close_hover.png);
|
||||
}
|
||||
|
||||
QPushButton#PreviewCloseButton:pressed {
|
||||
border-image: url(:/images/resources/dark/images/close_press.png);
|
||||
}
|
||||
|
||||
QFrame#WindowPreview[isHover="true"] {
|
||||
@ -59,10 +73,6 @@ QLabel#AppPreviewFrameTitle {
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
PanelMenuItem:hover {
|
||||
background: gray;
|
||||
color: #ffffff
|
||||
}
|
||||
|
||||
/********************************Plugin Setting********************/
|
||||
QLabel#PluginSettingTitle {
|
||||
@ -79,16 +89,14 @@ QWidget#PluginsSettingFrame {
|
||||
}
|
||||
|
||||
QPushButton#PluginSettingCloseButton{
|
||||
|
||||
border-image: url(":/images/Resource/dark/images/dark_close_small_normal.png");
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_normal.png);
|
||||
}
|
||||
|
||||
QPushButton#PluginSettingCloseButton:hover{
|
||||
border-image: url(":/images/Resource/dark/images/dark_close_small_hover.png");
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_hover.png);
|
||||
}
|
||||
|
||||
|
||||
QPushButton#PluginSettingCloseButton:pressed{
|
||||
border-image: url(":/images/Resource/dark/images/dark_close_small_press.png");
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_press.png);
|
||||
}
|
||||
|
BIN
dde-dock/resources/light/images/close_hover.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
dde-dock/resources/light/images/close_normal.png
Normal file
After Width: | Height: | Size: 962 B |
BIN
dde-dock/resources/light/images/close_press.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
30
dde-dock/resources/light/images/dark_dock.svg
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="91px" height="49px" viewBox="0 0 91 49" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12072) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>dark_dock副本</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<linearGradient x1="50.0289068%" y1="0.191268191%" x2="50.0289068%" y2="99.983368%" id="linearGradient-1">
|
||||
<stop stop-color="#000000" stop-opacity="0.4982" offset="0%"></stop>
|
||||
<stop stop-color="#000000" stop-opacity="0.802" offset="91.41%"></stop>
|
||||
<stop stop-color="#1E1E1E" stop-opacity="0.8772" offset="92.11%"></stop>
|
||||
<stop stop-color="#343434" stop-opacity="0.9" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<radialGradient cx="50.0071591%" cy="-376.96%" fx="50.0071591%" fy="-376.96%" r="0.568181818%" id="radialGradient-2">
|
||||
<stop stop-color="#FFFFFF" stop-opacity="0.25" offset="0%"></stop>
|
||||
<stop stop-color="#FFFFFF" stop-opacity="0.2" offset="100%"></stop>
|
||||
</radialGradient>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="dark_dock副本" sketch:type="MSLayerGroup">
|
||||
<g id="Page-1" sketch:type="MSShapeGroup">
|
||||
<g id="dark_dock">
|
||||
<g id="Mask" fill="url(#linearGradient-1)">
|
||||
<path d="M0.7,44.5 C0.3,46.9 1.6,48.9 3.7,48.9 L87.5,48.9 C89.6,48.9 90.9,46.9 90.5,44.5 L83.5,5.2 C83.1,2.8 81.1,0.8 79,0.8 L12.2,0.8 C10.2,0.8 8.1,2.8 7.7,5.2 L0.7,44.5 L0.7,44.5 Z" id="Shape"></path>
|
||||
</g>
|
||||
<path d="M1.5,44.4 L89.5,44.4" id="Line" stroke="url(#radialGradient-2)"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
BIN
dde-dock/resources/light/images/open-indicator.png
Normal file
After Width: | Height: | Size: 349 B |
BIN
dde-dock/resources/light/images/opening-indicator.png
Normal file
After Width: | Height: | Size: 818 B |
BIN
dde-dock/resources/light/images/setting_close_small_hover.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
dde-dock/resources/light/images/setting_close_small_normal.png
Normal file
After Width: | Height: | Size: 178 B |
BIN
dde-dock/resources/light/images/setting_close_small_press.png
Normal file
After Width: | Height: | Size: 214 B |
102
dde-dock/resources/light/qss/dde-dock.qss
Normal file
@ -0,0 +1,102 @@
|
||||
QLabel#Panel[isFashionMode="false"] {
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
QLabel#Panel[isFashionMode="true"] {
|
||||
border-width: 0px 21px 50px 21px;
|
||||
border-image: url(:/images/resources/dark/images/dark_dock.svg) 0 21 50 21 stretch;
|
||||
|
||||
}
|
||||
|
||||
QLabel#DockAppTitle {
|
||||
color: rgba(255,255,255,0.8);
|
||||
}
|
||||
|
||||
QLabel#ClassicModeTitle {
|
||||
color: rgba(255,255,255,1);
|
||||
}
|
||||
|
||||
/*************************************App Background***********************************************/
|
||||
/*item is current opened and is hovered*/
|
||||
QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="true"] {
|
||||
background: rgba(0,188,255,0.80);
|
||||
border: 1px solid rgba(79,174,249,0.50);
|
||||
/*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/
|
||||
border-radius: 2px;
|
||||
}
|
||||
/*item is current opened but not hovered*/
|
||||
QLabel#AppBackground[isFashionMode="false"][isCurrentOpened="true"][isHovered="false"] {
|
||||
background: rgba(0,188,255,0.60);
|
||||
border: 1px solid rgba(79,174,249,0.50);
|
||||
/*box-shadow: inset 0px -4px 0px 0px #01BDFF, inset 0px 0px 1px 2px rgba(25,210,255,0.20);*/
|
||||
border-radius: 2px;
|
||||
}
|
||||
/*item is actived and hovered*/
|
||||
QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="true"][isCurrentOpened="false"] {
|
||||
background: rgba(255,255,255,0.40);
|
||||
border-radius: 2px;
|
||||
}
|
||||
/*item is actived but not hovered*/
|
||||
QLabel#AppBackground[isFashionMode="false"][isActived="true"][isHovered="false"][isCurrentOpened="false"] {
|
||||
background: rgba(255,255,255,0.20);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
QLabel#AppBackgroundActiveLabel {
|
||||
qproperty-openIndicatorIcon:url(:/images/resources/dark/images/open-indicator.png);
|
||||
qproperty-openingIndicatorIcon:url(:/images/resources/dark/images/opening-indicator.png);
|
||||
}
|
||||
|
||||
/******************************Item Preview***********************/
|
||||
QPushButton#PreviewCloseButton {
|
||||
border-image: url(:/images/resources/dark/images/close_normal.png);
|
||||
}
|
||||
|
||||
QPushButton#PreviewCloseButton:hover {
|
||||
border-image: url(:/images/resources/dark/images/close_hover.png);
|
||||
}
|
||||
|
||||
QPushButton#PreviewCloseButton:pressed {
|
||||
border-image: url(:/images/resources/dark/images/close_press.png);
|
||||
}
|
||||
|
||||
QFrame#WindowPreview[isHover="true"] {
|
||||
border-radius: 3px;
|
||||
border-width: 3px;
|
||||
border-style: solid;
|
||||
border-color: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
QLabel#AppPreviewFrameTitle {
|
||||
font-size: 10px;
|
||||
color: #FFFFFF;
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
|
||||
/********************************Plugin Setting********************/
|
||||
QLabel#PluginSettingTitle {
|
||||
color:#b4b4b4;
|
||||
}
|
||||
|
||||
QLabel#PluginSettingLineTitle {
|
||||
color:#b4b4b4;
|
||||
}
|
||||
|
||||
QWidget#PluginsSettingFrame {
|
||||
background-color: rgba(0,0,0,0.9);
|
||||
border-radius: 3;
|
||||
}
|
||||
|
||||
QPushButton#PluginSettingCloseButton{
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_normal.png);
|
||||
}
|
||||
|
||||
QPushButton#PluginSettingCloseButton:hover{
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_hover.png);
|
||||
}
|
||||
|
||||
QPushButton#PluginSettingCloseButton:pressed{
|
||||
border-image: url(:/images/resources/dark/images/setting_close_small_press.png);
|
||||
}
|
||||
|
@ -1,48 +0,0 @@
|
||||
#include "closebutton.h"
|
||||
|
||||
CloseButton::CloseButton(QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
QPixmap iconPixmap(28,28);
|
||||
iconPixmap.load(ICON_NORMAL_PATH);
|
||||
this->setPixmap(iconPixmap);
|
||||
this->setAlignment(Qt::AlignCenter);
|
||||
}
|
||||
|
||||
void CloseButton::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
QPixmap iconPixmap;
|
||||
iconPixmap.load(ICON_PRESS_PATH);
|
||||
this->setPixmap(iconPixmap);
|
||||
emit pressed();
|
||||
isPressed = true;
|
||||
}
|
||||
|
||||
void CloseButton::mouseReleaseEvent(QMouseEvent *ev)
|
||||
{
|
||||
QPixmap iconPixmap;
|
||||
iconPixmap.load(ICON_NORMAL_PATH);
|
||||
this->setPixmap(iconPixmap);
|
||||
emit released();
|
||||
if (isPressed)
|
||||
{
|
||||
emit clicked();
|
||||
isPressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CloseButton::enterEvent(QEvent *)
|
||||
{
|
||||
QPixmap iconPixmap;
|
||||
iconPixmap.load(ICON_HOVER_PATH);
|
||||
this->setPixmap(iconPixmap);
|
||||
emit hovered();
|
||||
}
|
||||
|
||||
void CloseButton::leaveEvent(QEvent *)
|
||||
{
|
||||
QPixmap iconPixmap;
|
||||
iconPixmap.load(ICON_NORMAL_PATH);
|
||||
this->setPixmap(iconPixmap);
|
||||
emit exited();
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
#ifndef CLOSEBUTTON_H
|
||||
#define CLOSEBUTTON_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
|
||||
class CloseButton : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CloseButton(QWidget *parent = 0);
|
||||
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
void mouseReleaseEvent(QMouseEvent *ev);
|
||||
void enterEvent(QEvent *);
|
||||
void leaveEvent(QEvent *);
|
||||
signals:
|
||||
void clicked();
|
||||
void hovered();
|
||||
void exited();
|
||||
void pressed();
|
||||
void released();
|
||||
|
||||
private:
|
||||
void setIcon(const QString &path);
|
||||
|
||||
private:
|
||||
bool isPressed = false;
|
||||
const QString ICON_NORMAL_PATH = "://Resources/images/close_normal.png";
|
||||
const QString ICON_HOVER_PATH = "://Resources/images/close_hover.png";
|
||||
const QString ICON_PRESS_PATH = "://Resources/images/close_press.png";
|
||||
};
|
||||
|
||||
#endif // CLOSEBUTTON_H
|
@ -1,51 +0,0 @@
|
||||
#include "dockitemdelegate.h"
|
||||
|
||||
DockItemDelegate::DockItemDelegate(QObject *parent) : QItemDelegate(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QWidget * DockItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
AppItem * editor = new AppItem(parent);
|
||||
editor->resize(50,50);
|
||||
|
||||
return editor;
|
||||
}
|
||||
|
||||
void DockItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
QJsonObject dataObj = index.model()->data(index, Qt::DisplayRole).toJsonValue().toObject();
|
||||
|
||||
if (dataObj.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AppItem *appItem = static_cast<AppItem*>(editor);
|
||||
if (dataObj.contains("itemIconPath"))
|
||||
appItem->setIcon(dataObj.value("itemIconPath").toString());
|
||||
if (dataObj.contains("itemTitle"))
|
||||
appItem->setTitle(dataObj.value("itemTitle").toString());
|
||||
}
|
||||
|
||||
void DockItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
|
||||
AppItem *appItem = static_cast<AppItem*>(editor);
|
||||
// appItem->interpretText();
|
||||
// int value = appItem->value();
|
||||
|
||||
// model->setData(index, value);
|
||||
}
|
||||
|
||||
void DockItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
editor->setGeometry(option.rect);
|
||||
}
|
||||
|
||||
DockItemDelegate::~DockItemDelegate()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
#ifndef DOCKITEMDELEGATE_H
|
||||
#define DOCKITEMDELEGATE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QJsonObject>
|
||||
#include <QItemDelegate>
|
||||
#include <QStyleOptionViewItem>
|
||||
#include <QModelIndex>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDebug>
|
||||
#include "appitem.h"
|
||||
|
||||
class DockItemDelegate : public QItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DockItemDelegate(QObject *parent = 0);
|
||||
~DockItemDelegate();
|
||||
|
||||
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,const QModelIndex &index) const;
|
||||
void setEditorData(QWidget * editor, const QModelIndex & index) const;
|
||||
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const;
|
||||
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
};
|
||||
|
||||
#endif // DOCKITEMDELEGATE_H
|
@ -3,8 +3,8 @@
|
||||
AppManager::AppManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_entryManager = new DBusEntryManager(this);
|
||||
connect(m_entryManager, SIGNAL(Added(QDBusObjectPath)),this, SLOT(slotEntryAdded(QDBusObjectPath)));
|
||||
connect(m_entryManager, SIGNAL(Removed(QString)), this, SLOT(slotEntryRemoved(QString)));
|
||||
connect(m_entryManager, &DBusEntryManager::Added, this, &AppManager::onEntryAdded);
|
||||
connect(m_entryManager, &DBusEntryManager::Removed, this, &AppManager::onEntryRemoved);
|
||||
}
|
||||
|
||||
void AppManager::updateEntries()
|
||||
@ -17,22 +17,21 @@ void AppManager::updateEntries()
|
||||
for (int i = 0; i < entryList.count(); i ++)
|
||||
{
|
||||
DBusEntryProxyer *dep = new DBusEntryProxyer(entryList.at(i).path());
|
||||
if (dep->isValid() && dep->type() == "App" && dep->data().value("title") != "dde-dock")
|
||||
if (dep->isValid() && dep->type() == "App")
|
||||
{
|
||||
AppItem *item = new AppItem();
|
||||
item->setEntryProxyer(dep);
|
||||
m_initItemList.insert(item->getItemId(), item);
|
||||
// emit entryAdded(item);
|
||||
}
|
||||
}
|
||||
|
||||
sortItemList();
|
||||
}
|
||||
|
||||
void AppManager::slotEntryAdded(const QDBusObjectPath &path)
|
||||
void AppManager::onEntryAdded(const QDBusObjectPath &path)
|
||||
{
|
||||
DBusEntryProxyer *entryProxyer = new DBusEntryProxyer(path.path());
|
||||
if (entryProxyer->isValid() && entryProxyer->type() == "App" && entryProxyer->data().value("title") != "dde-dock")
|
||||
if (entryProxyer->isValid() && entryProxyer->type() == "App")
|
||||
{
|
||||
qWarning() << "entry add:" << path.path();
|
||||
AppItem *item = new AppItem();
|
||||
@ -41,7 +40,7 @@ void AppManager::slotEntryAdded(const QDBusObjectPath &path)
|
||||
}
|
||||
}
|
||||
|
||||
void AppManager::slotEntryRemoved(const QString &id)
|
||||
void AppManager::onEntryRemoved(const QString &id)
|
||||
{
|
||||
qWarning() << "entry remove:" << id;
|
||||
emit entryRemoved(id);
|
||||
@ -49,7 +48,7 @@ void AppManager::slotEntryRemoved(const QString &id)
|
||||
|
||||
void AppManager::sortItemList()
|
||||
{
|
||||
QStringList dockedList = m_ddam->DockedAppList().value();
|
||||
QStringList dockedList = m_dockAppManager->DockedAppList().value();
|
||||
QStringList ids = m_initItemList.keys();
|
||||
foreach (QString id, dockedList) { //For docked items
|
||||
int index = ids.indexOf(id);
|
@ -3,11 +3,11 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include "DBus/dbusentrymanager.h"
|
||||
#include "DBus/dbusentryproxyer.h"
|
||||
#include "DBus/dbusdockedappmanager.h"
|
||||
#include "Widgets/appitem.h"
|
||||
#include "Widgets/launcheritem.h"
|
||||
#include "dbus/dbusentrymanager.h"
|
||||
#include "dbus/dbusentryproxyer.h"
|
||||
#include "dbus/dbusdockedappmanager.h"
|
||||
#include "widgets/appitem.h"
|
||||
#include "widgets/launcheritem.h"
|
||||
|
||||
class AppManager : public QObject
|
||||
{
|
||||
@ -20,17 +20,15 @@ signals:
|
||||
void entryAdded(AbstractDockItem *item);
|
||||
void entryRemoved(const QString &id);
|
||||
|
||||
private slots:
|
||||
void slotEntryAdded(const QDBusObjectPath &path);
|
||||
void slotEntryRemoved(const QString &id);
|
||||
|
||||
private:
|
||||
void sortItemList(); //Sort and append item to dock
|
||||
void onEntryRemoved(const QString &id);
|
||||
void onEntryAdded(const QDBusObjectPath &path);
|
||||
|
||||
private:
|
||||
QMap<QString, AbstractDockItem *> m_initItemList; //Juse for initialization <id, item>
|
||||
DBusEntryManager *m_entryManager = NULL;
|
||||
DBusDockedAppManager *m_ddam = new DBusDockedAppManager(this);
|
||||
DBusDockedAppManager *m_dockAppManager = new DBusDockedAppManager(this);
|
||||
QMap<QString, AbstractDockItem *> m_initItemList; //Juse for initialization <id, item>
|
||||
};
|
||||
|
||||
#endif // APPMANAGER_H
|
@ -6,13 +6,13 @@ DockModeData::DockModeData(QObject *parent) :
|
||||
initDDS();
|
||||
}
|
||||
|
||||
DockModeData * DockModeData::dockModeData = NULL;
|
||||
DockModeData * DockModeData::m_dockModeData = NULL;
|
||||
DockModeData * DockModeData::instance()
|
||||
{
|
||||
if (dockModeData == NULL)
|
||||
dockModeData = new DockModeData();
|
||||
if (m_dockModeData == NULL)
|
||||
m_dockModeData = new DockModeData();
|
||||
|
||||
return dockModeData;
|
||||
return m_dockModeData;
|
||||
}
|
||||
|
||||
Dock::DockMode DockModeData::getDockMode()
|
||||
@ -22,7 +22,7 @@ Dock::DockMode DockModeData::getDockMode()
|
||||
|
||||
void DockModeData::setDockMode(Dock::DockMode value)
|
||||
{
|
||||
m_dds->SetDisplayMode(value);
|
||||
m_dockSetting->SetDisplayMode(value);
|
||||
}
|
||||
|
||||
Dock::HideMode DockModeData::getHideMode()
|
||||
@ -32,9 +32,9 @@ Dock::HideMode DockModeData::getHideMode()
|
||||
|
||||
void DockModeData::setHideMode(Dock::HideMode value)
|
||||
{
|
||||
m_dds->SetHideMode(value);
|
||||
m_dhsm->UpdateState();
|
||||
QTimer::singleShot(100, m_dhsm, SLOT(UpdateState()));
|
||||
m_dockSetting->SetHideMode(value);
|
||||
m_hideStateManager->UpdateState();
|
||||
QTimer::singleShot(100, m_hideStateManager, SLOT(UpdateState()));
|
||||
}
|
||||
|
||||
int DockModeData::getDockHeight()
|
||||
@ -187,7 +187,7 @@ int DockModeData::getAppletsIconSize()
|
||||
}
|
||||
}
|
||||
|
||||
void DockModeData::slotDockModeChanged(int mode)
|
||||
void DockModeData::onDockModeChanged(int mode)
|
||||
{
|
||||
Dock::DockMode tmpMode = Dock::DockMode(mode);
|
||||
Dock::DockMode oldmode = m_currentMode;
|
||||
@ -196,7 +196,7 @@ void DockModeData::slotDockModeChanged(int mode)
|
||||
emit dockModeChanged(tmpMode,oldmode);
|
||||
}
|
||||
|
||||
void DockModeData::slotHideModeChanged(int mode)
|
||||
void DockModeData::onHideModeChanged(int mode)
|
||||
{
|
||||
Dock::HideMode tmpMode = Dock::HideMode(mode);
|
||||
Dock::HideMode oldMode = m_hideMode;
|
||||
@ -207,12 +207,12 @@ void DockModeData::slotHideModeChanged(int mode)
|
||||
|
||||
void DockModeData::initDDS()
|
||||
{
|
||||
m_dds = new DBusDockSetting(this);
|
||||
connect(m_dds,&DBusDockSetting::DisplayModeChanged,this,&DockModeData::slotDockModeChanged);
|
||||
connect(m_dds,&DBusDockSetting::HideModeChanged,this,&DockModeData::slotHideModeChanged);
|
||||
m_dockSetting = new DBusDockSetting(this);
|
||||
connect(m_dockSetting,&DBusDockSetting::DisplayModeChanged,this,&DockModeData::onDockModeChanged);
|
||||
connect(m_dockSetting,&DBusDockSetting::HideModeChanged,this,&DockModeData::onHideModeChanged);
|
||||
|
||||
m_currentMode = Dock::DockMode(m_dds->GetDisplayMode().value());
|
||||
m_hideMode = Dock::HideMode(m_dds->GetHideMode().value());
|
||||
m_currentMode = Dock::DockMode(m_dockSetting->GetDisplayMode().value());
|
||||
m_hideMode = Dock::HideMode(m_dockSetting->GetHideMode().value());
|
||||
|
||||
emit dockModeChanged(m_currentMode,m_currentMode);
|
||||
emit hideModeChanged(m_hideMode,m_hideMode);
|
@ -5,9 +5,9 @@
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
#include "DBus/dbusdocksetting.h"
|
||||
#include "DBus/dbushidestatemanager.h"
|
||||
#include "dockconstants.h"
|
||||
#include "dbus/dbusdocksetting.h"
|
||||
#include "dbus/dbushidestatemanager.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class DockModeData : public QObject
|
||||
{
|
||||
@ -36,22 +36,21 @@ signals:
|
||||
void dockModeChanged(Dock::DockMode newMode,Dock::DockMode oldMode);
|
||||
void hideModeChanged(Dock::HideMode newMode,Dock::HideMode oldMode);
|
||||
|
||||
private slots:
|
||||
void slotDockModeChanged(int mode);
|
||||
void slotHideModeChanged(int mode);
|
||||
|
||||
private:
|
||||
explicit DockModeData(QObject *parent = 0);
|
||||
|
||||
void initDDS();
|
||||
void onDockModeChanged(int mode);
|
||||
void onHideModeChanged(int mode);
|
||||
|
||||
private:
|
||||
static DockModeData * dockModeData;
|
||||
static DockModeData * m_dockModeData;
|
||||
|
||||
Dock::DockMode m_currentMode = Dock::EfficientMode;
|
||||
Dock::HideMode m_hideMode = Dock::KeepShowing;
|
||||
|
||||
DBusDockSetting *m_dds = NULL;
|
||||
DBusHideStateManager *m_dhsm = new DBusHideStateManager(this);
|
||||
DBusDockSetting *m_dockSetting = NULL;
|
||||
DBusHideStateManager *m_hideStateManager = new DBusHideStateManager(this);
|
||||
};
|
||||
|
||||
#endif // DOCKMODEDATA_H
|
@ -3,9 +3,9 @@
|
||||
#include <QPluginLoader>
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
#include "dockpluginmanager.h"
|
||||
#include "dockpluginproxy.h"
|
||||
#include "dockplugininterface.h"
|
||||
#include "dockpluginmanager.h"
|
||||
#include "interfaces/dockplugininterface.h"
|
||||
|
||||
DockPluginManager::DockPluginManager(QObject *parent) :
|
||||
QObject(parent)
|
@ -5,10 +5,10 @@
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
|
||||
#include "dockconstants.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "Panel/pluginssettingframe.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
#include "widgets/abstractdockitem.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "pluginssettingframe.h"
|
||||
|
||||
class QFileSystemWatcher;
|
||||
class DockPluginProxy;
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "dockpluginproxy.h"
|
||||
#include "pluginitemwrapper.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
|
||||
DockPluginProxy::DockPluginProxy(QPluginLoader * loader, DockPluginInterface * plugin) :
|
||||
QObject(),
|
@ -1,9 +1,9 @@
|
||||
#ifndef DOCKPLUGINPROXY_H
|
||||
#define DOCKPLUGINPROXY_H
|
||||
|
||||
#include "dockplugininterface.h"
|
||||
#include "dockpluginproxyinterface.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include "widgets/abstractdockitem.h"
|
||||
#include "interfaces/dockplugininterface.h"
|
||||
#include "interfaces/dockpluginproxyinterface.h"
|
||||
|
||||
class QPluginLoader;
|
||||
class DockPluginProxy : public QObject, public DockPluginProxyInterface
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "abstractdockitem.h"
|
||||
#include "dockplugininterface.h"
|
||||
#include "widgets/abstractdockitem.h"
|
||||
#include "interfaces/dockplugininterface.h"
|
||||
|
||||
class QMouseEvent;
|
||||
class PluginItemWrapper : public AbstractDockItem
|
@ -8,6 +8,7 @@
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
|
||||
#include <libdui/dswitchbutton.h>
|
||||
#include <libdui/dseparatorhorizontal.h>
|
||||
|
@ -19,7 +19,7 @@ enum HideMode {
|
||||
const int APP_PREVIEW_WIDTH = 160;
|
||||
const int APP_PREVIEW_HEIGHT = 100;
|
||||
const int APP_PREVIEW_MARGIN = 6 ; //20 - 28 / 2
|
||||
const int APP_PREVIEW_CLOSEBUTTON_SIZE = 28;
|
||||
const int APP_PREVIEW_CLOSEBUTTON_SIZE = 26;
|
||||
|
||||
const int APP_ITEM_FASHION_HEIGHT = 70;
|
||||
const int APP_ITEM_FASHION_NORMAL_WIDTH = 48;
|
@ -30,7 +30,7 @@ int main(int argc, char *argv[])
|
||||
a.setApplicationDisplayName("Dock");
|
||||
|
||||
if (QDBusConnection::sessionBus().registerService(DBUS_NAME)) {
|
||||
QFile file("://Resources/qss/default.qss");
|
||||
QFile file("://qss/resources/dark/qss/dde-dock.qss");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QString styleSheet = QLatin1String(file.readAll());
|
||||
qApp->setStyleSheet(styleSheet);
|
||||
|
@ -9,10 +9,10 @@
|
||||
#include <QState>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QDBusConnection>
|
||||
#include "DBus/dbushidestatemanager.h"
|
||||
#include "DBus/dbusdocksetting.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "Panel/panel.h"
|
||||
#include "dbus/dbushidestatemanager.h"
|
||||
#include "dbus/dbusdocksetting.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "panel/panel.h"
|
||||
|
||||
const QString DBUS_PATH = "/com/deepin/dde/dock";
|
||||
const QString DBUS_NAME = "com.deepin.dde.dock";
|
||||
|
@ -1,9 +1,10 @@
|
||||
#include "panel.h"
|
||||
#include "dockpluginproxy.h"
|
||||
#include "dockpluginmanager.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include "panel.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "controller/plugins/dockpluginproxy.h"
|
||||
#include "controller/plugins/dockpluginmanager.h"
|
||||
|
||||
Panel::Panel(QWidget *parent)
|
||||
: QLabel(parent),m_parentWidget(parent)
|
||||
{
|
@ -6,13 +6,13 @@
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
|
||||
#include "DBus/dbushidestatemanager.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "Controller/appmanager.h"
|
||||
#include "Widgets/appitem.h"
|
||||
#include "Widgets/docklayout.h"
|
||||
#include "Widgets/screenmask.h"
|
||||
#include "Widgets/reflectioneffect.h"
|
||||
#include "dbus/dbushidestatemanager.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "controller/appmanager.h"
|
||||
#include "widgets/appitem.h"
|
||||
#include "widgets/docklayout.h"
|
||||
#include "widgets/screenmask.h"
|
||||
#include "widgets/reflectioneffect.h"
|
||||
#include "panelmenu.h"
|
||||
|
||||
class Panel : public QLabel
|
@ -24,7 +24,7 @@ void PanelMenu::showMenu(int x, int y)
|
||||
m_menuInterfacePath = op.path();
|
||||
DBusMenu *m_menu = new DBusMenu(m_menuInterfacePath,this);
|
||||
connect(m_menu,&DBusMenu::MenuUnregistered,m_menu,&DBusMenu::deleteLater);
|
||||
connect(m_menu,&DBusMenu::ItemInvoked,this,&PanelMenu::slotItemInvoked);
|
||||
connect(m_menu,&DBusMenu::ItemInvoked,this,&PanelMenu::onItemInvoked);
|
||||
|
||||
QJsonObject targetObj;
|
||||
targetObj.insert("x",QJsonValue(x));
|
||||
@ -51,7 +51,7 @@ void PanelMenu::showMenu(int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
void PanelMenu::slotItemInvoked(const QString &itemId, bool result)
|
||||
void PanelMenu::onItemInvoked(const QString &itemId, bool result)
|
||||
{
|
||||
if (itemId.split(":").length() < 1)
|
||||
return;
|
@ -7,10 +7,11 @@
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QDebug>
|
||||
#include "DBus/dbusmenumanager.h"
|
||||
#include "DBus/dbusmenu.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "../dockconstants.h"
|
||||
|
||||
#include "dbus/dbusmenumanager.h"
|
||||
#include "dbus/dbusmenu.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class PanelMenu : public QObject
|
||||
{
|
||||
@ -33,12 +34,10 @@ public:
|
||||
static PanelMenu * instance();
|
||||
|
||||
void showMenu(int x,int y);
|
||||
|
||||
signals:
|
||||
void settingPlugin();
|
||||
|
||||
private slots:
|
||||
void slotItemInvoked(const QString &itemId,bool result);
|
||||
|
||||
private:
|
||||
explicit PanelMenu(QObject *parent = 0);
|
||||
|
||||
@ -49,15 +48,17 @@ private:
|
||||
void changeToKeepHidden();
|
||||
void changeToSmartHide();
|
||||
|
||||
QJsonObject createItemObj(const QString &itemName,OperationType type);
|
||||
QJsonObject createRadioItemObj(const QString &itemName,OperationType type,MenuGroup group,bool check);
|
||||
void onItemInvoked(const QString &itemId, bool result);
|
||||
|
||||
QJsonObject createItemObj(const QString &itemName, OperationType type);
|
||||
QJsonObject createRadioItemObj(const QString &itemName, OperationType type, MenuGroup group, bool check);
|
||||
|
||||
private:
|
||||
static PanelMenu * m_panelMenu;
|
||||
DockModeData *dockCons = DockModeData::instance();
|
||||
QString m_menuInterfacePath = "";
|
||||
DBusMenuManager *m_menuManager = NULL;
|
||||
DBusDockSetting m_dockSetting;
|
||||
DBusMenuManager *m_menuManager = NULL;
|
||||
DockModeData *dockCons = DockModeData::instance();
|
||||
|
||||
};
|
||||
|
@ -1,14 +1,4 @@
|
||||
#include <QWidget>
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
#include <QtDBus>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
|
||||
#include "abstractdockitem.h"
|
||||
#include "Widgets/arrowrectangle.h"
|
||||
#include "DBus/dbusmenu.h"
|
||||
#include "DBus/dbusmenumanager.h"
|
||||
|
||||
ItemTitleLabel::ItemTitleLabel(QWidget *parent) :
|
||||
QLabel(parent)
|
@ -1,10 +1,20 @@
|
||||
#ifndef ABSTRACTDOCKITEM_H
|
||||
#define ABSTRACTDOCKITEM_H
|
||||
|
||||
#include "Widgets/previewarrowrectangle.h"
|
||||
#include "Widgets/highlighteffect.h"
|
||||
#include "dockconstants.h"
|
||||
#include <QDebug>
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
#include <QtDBus>
|
||||
#include <QWidget>
|
||||
#include <QJsonValue>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "dbus/dbusmenu.h"
|
||||
#include "highlighteffect.h"
|
||||
#include "dbus/dbusmenumanager.h"
|
||||
#include "previewarrowrectangle.h"
|
||||
#include "widgets/arrowrectangle.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class ItemTitleLabel : public QLabel
|
||||
{
|
||||
@ -14,8 +24,6 @@ public:
|
||||
void setTitle(QString title);
|
||||
};
|
||||
|
||||
class DBusMenu;
|
||||
class DBusMenuManager;
|
||||
class AbstractDockItem : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -23,37 +31,32 @@ public:
|
||||
explicit AbstractDockItem(QWidget *parent = 0);
|
||||
virtual ~AbstractDockItem();
|
||||
|
||||
virtual QString getItemId();
|
||||
virtual QString getTitle();
|
||||
virtual QString getItemId();
|
||||
virtual QString getMenuContent();
|
||||
virtual QWidget * getApplet();
|
||||
|
||||
virtual bool moveable();
|
||||
virtual bool actived();
|
||||
|
||||
void resize(int width,int height);
|
||||
void resize(const QSize &size);
|
||||
|
||||
QPoint getNextPos();
|
||||
void setNextPos(const QPoint &value);
|
||||
void setNextPos(int x, int y);
|
||||
void move(const QPoint &value);
|
||||
void move(int x, int y);
|
||||
virtual void invokeMenuItem(QString menuItemId, bool checked);
|
||||
virtual void moveWithAnimation(QPoint targetPos, int duration = 100){}
|
||||
|
||||
void setNextPos(int x, int y);
|
||||
void setNextPos(const QPoint &value);
|
||||
void move(int x, int y);
|
||||
void move(const QPoint &value);
|
||||
void resize(const QSize &size);
|
||||
void resize(int width,int height);
|
||||
void showMenu();
|
||||
void cancelHide();
|
||||
void showPreview();
|
||||
void resizePreview();
|
||||
void hidePreview(int interval = 150);
|
||||
void setParent(QWidget * parent);
|
||||
|
||||
int globalX();
|
||||
int globalY();
|
||||
QPoint globalPos();
|
||||
|
||||
void showPreview();
|
||||
void hidePreview(int interval = 150);
|
||||
void cancelHide();
|
||||
void resizePreview();
|
||||
|
||||
void showMenu();
|
||||
virtual QString getMenuContent();
|
||||
virtual void invokeMenuItem(QString menuItemId, bool checked);
|
||||
|
||||
void setParent(QWidget * parent);
|
||||
QPoint getNextPos();
|
||||
|
||||
signals:
|
||||
void dragStart();
|
||||
@ -66,8 +69,8 @@ signals:
|
||||
void widthChanged();
|
||||
void posChanged();
|
||||
void frameUpdate();
|
||||
void moveAnimationFinished();
|
||||
void previewHidden();
|
||||
void moveAnimationFinished();
|
||||
|
||||
protected:
|
||||
|
||||
@ -85,6 +88,7 @@ protected:
|
||||
|
||||
void initHighlight();
|
||||
void initTitleLabel();
|
||||
|
||||
private:
|
||||
const int TITLE_HEIGHT = 20;
|
||||
};
|
@ -4,6 +4,7 @@
|
||||
ActiveLabel::ActiveLabel(QWidget *parent)
|
||||
:QLabel(parent)
|
||||
{
|
||||
setObjectName("AppBackgroundActiveLabel");
|
||||
setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
|
||||
}
|
||||
|
||||
@ -15,10 +16,9 @@ void ActiveLabel::showActiveWithAnimation()
|
||||
setFixedSize(28, 13);
|
||||
emit sizeChange();
|
||||
setVisible(true);
|
||||
m_iconPath = ":/Resources/images/opening-indicator.png";
|
||||
m_iconPath = m_openingIndicatorIcon;
|
||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "opacity");
|
||||
animation->setDuration(500);
|
||||
// animation->setLoopCount(4);
|
||||
animation->setStartValue(0);
|
||||
animation->setEndValue(1);
|
||||
animation->start();
|
||||
@ -49,7 +49,7 @@ void ActiveLabel::show()
|
||||
QLabel::show();
|
||||
setFixedSize(24, 5);
|
||||
setOpacity(1);
|
||||
m_iconPath = ":/Resources/images/open-indicator.png";
|
||||
m_iconPath = m_openIndicatorIcon;
|
||||
repaint();
|
||||
emit sizeChange();
|
||||
}
|
||||
@ -79,6 +79,26 @@ void ActiveLabel::paintEvent(QPaintEvent *event)
|
||||
|
||||
painter.end();
|
||||
}
|
||||
QString ActiveLabel::openingIndicatorIcon() const
|
||||
{
|
||||
return m_openingIndicatorIcon;
|
||||
}
|
||||
|
||||
void ActiveLabel::setOpeningIndicatorIcon(const QString &openingIndicatorIcon)
|
||||
{
|
||||
m_openingIndicatorIcon = openingIndicatorIcon;
|
||||
}
|
||||
|
||||
QString ActiveLabel::openIndicatorIcon() const
|
||||
{
|
||||
return m_openIndicatorIcon;
|
||||
}
|
||||
|
||||
void ActiveLabel::setOpenIndicatorIcon(const QString &openIndicatorIcon)
|
||||
{
|
||||
m_openIndicatorIcon = openIndicatorIcon;
|
||||
}
|
||||
|
||||
|
||||
AppBackground::AppBackground(QWidget *parent) :
|
||||
QLabel(parent)
|
@ -1,19 +1,23 @@
|
||||
#ifndef APPBACKGROUND_H
|
||||
#define APPBACKGROUND_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QLabel>
|
||||
#include <QStyle>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
#include <QDebug>
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
#include "controller/dockmodedata.h"
|
||||
|
||||
class ActiveLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(double opacity READ opacity WRITE setOpacity)
|
||||
Q_PROPERTY(QString openIndicatorIcon READ openIndicatorIcon WRITE setOpenIndicatorIcon)
|
||||
Q_PROPERTY(QString openingIndicatorIcon READ openingIndicatorIcon WRITE setOpeningIndicatorIcon)
|
||||
|
||||
public:
|
||||
explicit ActiveLabel(QWidget *parent = 0);
|
||||
void showActiveWithAnimation();
|
||||
@ -22,6 +26,12 @@ public:
|
||||
double opacity() const;
|
||||
void setOpacity(double opacity);
|
||||
|
||||
QString openIndicatorIcon() const;
|
||||
void setOpenIndicatorIcon(const QString &openIndicatorIcon);
|
||||
|
||||
QString openingIndicatorIcon() const;
|
||||
void setOpeningIndicatorIcon(const QString &openingIndicatorIcon);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
@ -32,6 +42,8 @@ signals:
|
||||
private:
|
||||
int m_loopCount = 0;
|
||||
double m_opacity = 0;
|
||||
QString m_openIndicatorIcon = "";
|
||||
QString m_openingIndicatorIcon = "";
|
||||
QString m_iconPath = "";
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ void AppIcon::setIcon(const QString &iconPath)
|
||||
} else {
|
||||
// try to read the iconPath as a icon name.
|
||||
QString path = getThemeIconPath(iconPath);
|
||||
if (path.endsWith("svg")) {
|
||||
if (path.endsWith(".svg")) {
|
||||
QSvgRenderer renderer(path);
|
||||
pixmap.fill(Qt::transparent);
|
||||
|
@ -1,13 +1,14 @@
|
||||
#ifndef APPICON_H
|
||||
#define APPICON_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QLabel>
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
#include <QMouseEvent>
|
||||
#include <Controller/dockmodedata.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include "controller/dockmodedata.h"
|
||||
|
||||
class AppIcon : public QLabel
|
||||
{
|
@ -1,31 +1,30 @@
|
||||
#ifndef APPITEM_H
|
||||
#define APPITEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QMouseEvent>
|
||||
#include <QMimeData>
|
||||
#include <QMap>
|
||||
#include <QList>
|
||||
#include <QDrag>
|
||||
#include <QRectF>
|
||||
#include <QDrag>
|
||||
#include <QMimeData>
|
||||
#include <QPixmap>
|
||||
#include <QImage>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QJsonDocument>
|
||||
#include <QPixmap>
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
#include <QMimeData>
|
||||
#include <QPushButton>
|
||||
#include <QJsonObject>
|
||||
#include "DBus/dbusentryproxyer.h"
|
||||
#include "DBus/dbusclientmanager.h"
|
||||
#include "DBus/dbusmenu.h"
|
||||
#include "DBus/dbusmenumanager.h"
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QJsonDocument>
|
||||
|
||||
#include "appicon.h"
|
||||
#include "appbackground.h"
|
||||
#include "../dockconstants.h"
|
||||
#include "apppreviews.h"
|
||||
#include "appbackground.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include "dbus/dbusmenu.h"
|
||||
#include "dbus/dbusmenumanager.h"
|
||||
#include "dbus/dbusentryproxyer.h"
|
||||
#include "dbus/dbusclientmanager.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
struct AppItemData {
|
||||
QString id;
|
@ -1,5 +1,4 @@
|
||||
#include "apppreviews.h"
|
||||
#include "abstractdockitem.h"
|
||||
|
||||
AppPreviewFrame::AppPreviewFrame(const QString &title, int xid, QWidget *parent) :
|
||||
QWidget(parent),xidValue(xid)
|
||||
@ -55,12 +54,13 @@ void AppPreviewFrame::leaveEvent(QEvent *)
|
||||
|
||||
void AppPreviewFrame::addCloseButton()
|
||||
{
|
||||
m_cb = new CloseButton(this);
|
||||
m_cb->hide();
|
||||
connect(m_cb,&CloseButton::clicked,[=]{close(this->xidValue);});
|
||||
m_cb = new QPushButton(this);
|
||||
m_cb->setObjectName("PreviewCloseButton");
|
||||
m_cb->resize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
m_cb->move(width() - m_cb->width(), 0);
|
||||
m_cb->hide();
|
||||
|
||||
m_cb->move(width() - m_cb->width()/* / 2*/,0/*- m_cb->width() / 2*/);
|
||||
connect(m_cb,&QPushButton::clicked,[=]{close(this->xidValue);});
|
||||
}
|
||||
|
||||
void AppPreviewFrame::showCloseButton()
|
@ -1,14 +1,16 @@
|
||||
#ifndef APPPREVIEWS_H
|
||||
#define APPPREVIEWS_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
#include "DBus/dbusclientmanager.h"
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include "windowpreview.h"
|
||||
#include "closebutton.h"
|
||||
#include "../dockconstants.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include "dbus/dbusclientmanager.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class AppPreviewFrame : public QWidget
|
||||
{
|
||||
@ -36,7 +38,7 @@ private:
|
||||
|
||||
private:
|
||||
WindowPreview * m_preview = NULL;
|
||||
CloseButton *m_cb = NULL;
|
||||
QPushButton *m_cb = NULL;
|
||||
int xidValue;
|
||||
const int BUTTON_SIZE = Dock::APP_PREVIEW_CLOSEBUTTON_SIZE;
|
||||
const int TITLE_HEIGHT = 25;
|
@ -1,15 +1,15 @@
|
||||
#ifndef ARROWRECTANGLE_H
|
||||
#define ARROWRECTANGLE_H
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QTextLine>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
class ArrowRectangle : public QWidget
|
||||
{
|
@ -1,16 +1,17 @@
|
||||
#ifndef DOCKLAYOUT_H
|
||||
#define DOCKLAYOUT_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QList>
|
||||
#include <QCursor>
|
||||
#include <QJsonDocument>
|
||||
#include <QWidget>
|
||||
#include <QJsonObject>
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "DBus/dbusdockedappmanager.h"
|
||||
#include <QJsonDocument>
|
||||
#include <QPropertyAnimation>
|
||||
|
||||
#include "appitem.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "dbus/dbusdockedappmanager.h"
|
||||
|
||||
class DockLayout : public QWidget
|
||||
{
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDebug>
|
||||
|
||||
@ -33,9 +33,6 @@ public:
|
||||
int columnCount(const QModelIndex &parent) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::EditRole) const;
|
||||
bool insertRows(int row, int count, const QModelIndex &parent);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
QJsonArray dataArray;
|
@ -1,7 +1,3 @@
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QBitmap>
|
||||
|
||||
#include "highlighteffect.h"
|
||||
|
||||
HighlightEffect::HighlightEffect(QWidget * source, QWidget *parent) :
|
@ -1,7 +1,10 @@
|
||||
#ifndef HIGHLIGHTEFFECT_H
|
||||
#define HIGHLIGHTEFFECT_H
|
||||
|
||||
#include <QColor>
|
||||
#include <QWidget>
|
||||
#include <QBitmap>
|
||||
#include <QPainter>
|
||||
|
||||
class HighlightEffect : public QWidget
|
||||
{
|
@ -1,16 +1,17 @@
|
||||
#ifndef LAUNCHERITEM_H
|
||||
#define LAUNCHERITEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QProcess>
|
||||
#include <QDebug>
|
||||
#include "Controller/dockmodedata.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include <QWidget>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
||||
#include "appicon.h"
|
||||
#include "arrowrectangle.h"
|
||||
#include "../dockconstants.h"
|
||||
#include "abstractdockitem.h"
|
||||
#include "controller/dockmodedata.h"
|
||||
#include "interfaces/dockconstants.h"
|
||||
|
||||
class LauncherItem : public AbstractDockItem
|
||||
{
|
@ -1,9 +1,10 @@
|
||||
#ifndef PREVIEWARROWRECTANGLE_H
|
||||
#define PREVIEWARROWRECTANGLE_H
|
||||
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QTimer>
|
||||
|
||||
#include "arrowrectangle.h"
|
||||
|
||||
class MirrorLabel : public QLabel
|
@ -1,5 +1,3 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "reflectioneffect.h"
|
||||
|
||||
ReflectionEffect::ReflectionEffect(QWidget * source, QWidget *parent) :
|
@ -2,6 +2,7 @@
|
||||
#define REFLECTIONEFFECT_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
|
||||
class QPaintEvent;
|
||||
class ReflectionEffect : public QWidget
|