├── .clog.toml
├── .gitignore
├── CHANGELOG.md
├── CMakeLists.txt
├── LICENSE
├── README.md
├── com.deepin.dde.topbar.polkit.service
├── com.deepin.dde.topbar.service
├── debian
├── changelog
├── compat
├── control
└── rules
├── deepin-logo.svg
├── deepin-topbar.desktop
├── deepin-topbar.svg
├── src
├── CMakeLists.txt
├── dbus
│ ├── com.deepin.daemon.Audio.Sink.xml
│ ├── com.deepin.daemon.Audio.SinkInput.xml
│ ├── com.deepin.daemon.Audio.xml
│ ├── com.deepin.daemon.Power.xml
│ ├── com.deepin.dde.Wallpaper.xml
│ ├── com_deepin_dde_wallpaper.cpp
│ ├── com_deepin_dde_wallpaper.h
│ ├── dbusaccount.cpp
│ ├── dbusaccount.h
│ ├── dbusaudio.cpp
│ ├── dbusaudio.h
│ ├── dbusinterface.cpp
│ ├── dbusinterface.h
│ ├── dbusmediaplayer2.cpp
│ ├── dbusmediaplayer2.h
│ ├── dbussink.cpp
│ ├── dbussink.h
│ ├── dbussinkinput.cpp
│ ├── dbussinkinput.h
│ └── org.mpris.MediaPlayer2.xml
├── frame
│ ├── dbusservice.cpp
│ ├── dbusservice.h
│ ├── deepin-topbar.qrc
│ ├── item
│ │ ├── contentmodule.cpp
│ │ ├── contentmodule.h
│ │ ├── item.cpp
│ │ ├── item.h
│ │ ├── pluginsitem.cpp
│ │ ├── pluginsitem.h
│ │ ├── stretchitem.cpp
│ │ └── stretchitem.h
│ ├── main.cpp
│ ├── maindbusservice.cpp
│ ├── maindbusservice.h
│ ├── mainframe.cpp
│ ├── mainframe.h
│ ├── mainpanel.cpp
│ ├── mainpanel.h
│ ├── settings.cpp
│ ├── settings.h
│ ├── settings.json
│ └── utils
│ │ ├── event_monitor.cpp
│ │ ├── event_monitor.h
│ │ ├── global.cpp
│ │ ├── global.h
│ │ ├── themeappicon.cpp
│ │ └── themeappicon.h
├── interfaces
│ ├── moduleiteminterface.h
│ ├── pluginproxyinterface.h
│ └── pluginsiteminterface.h
├── modules
│ ├── account
│ │ ├── accountplugin.cpp
│ │ ├── accountplugin.h
│ │ ├── accountwidget.cpp
│ │ └── accountwidget.h
│ ├── indicator
│ │ ├── View
│ │ │ ├── appstoreaction.cpp
│ │ │ ├── appstoreaction.h
│ │ │ ├── entry.cpp
│ │ │ ├── entry.h
│ │ │ ├── indicatorwidget.cpp
│ │ │ ├── indicatorwidget.h
│ │ │ ├── positionwidget.cpp
│ │ │ ├── positionwidget.h
│ │ │ ├── systemlogo.cpp
│ │ │ └── systemlogo.h
│ │ ├── indicator.qrc
│ │ ├── indicatormodel.cpp
│ │ ├── indicatormodel.h
│ │ ├── indicatorplugin.cpp
│ │ ├── indicatorplugin.h
│ │ ├── indicatorworker.cpp
│ │ ├── indicatorworker.h
│ │ └── theme
│ │ │ ├── dark
│ │ │ ├── IndicatorWidget.theme
│ │ │ └── SystemLogo.theme
│ │ │ └── light
│ │ │ ├── IndicatorWidget.theme
│ │ │ ├── PositionWidget.theme
│ │ │ └── SystemLogo.theme
│ ├── network
│ │ ├── item
│ │ │ └── applet
│ │ │ │ ├── accesspoint.cpp
│ │ │ │ ├── accesspoint.h
│ │ │ │ ├── refreshaction.cpp
│ │ │ │ └── refreshaction.h
│ │ ├── network.qrc
│ │ ├── networkcontrolpanel.cpp
│ │ ├── networkcontrolpanel.h
│ │ ├── networkdelegate.cpp
│ │ ├── networkdelegate.h
│ │ ├── networklistmodel.cpp
│ │ ├── networklistmodel.h
│ │ ├── networklistview.cpp
│ │ ├── networklistview.h
│ │ ├── networkplugin.cpp
│ │ ├── networkplugin.h
│ │ └── resources
│ │ │ ├── wired
│ │ │ ├── wired-connected-small.svg
│ │ │ ├── wired-connected.svg
│ │ │ ├── wired-disconnected-small.svg
│ │ │ ├── wired-disconnected.svg
│ │ │ ├── wired-error-small.svg
│ │ │ └── wired-unaccessable-small.svg
│ │ │ └── wireless
│ │ │ ├── disconnect.png
│ │ │ ├── disconnect_pressed.png
│ │ │ ├── security.svg
│ │ │ ├── selected.png
│ │ │ ├── spinner14
│ │ │ ├── Spinner01.png
│ │ │ ├── Spinner02.png
│ │ │ ├── Spinner03.png
│ │ │ ├── Spinner04.png
│ │ │ ├── Spinner05.png
│ │ │ ├── Spinner06.png
│ │ │ ├── Spinner07.png
│ │ │ ├── Spinner08.png
│ │ │ ├── Spinner09.png
│ │ │ ├── Spinner10.png
│ │ │ ├── Spinner11.png
│ │ │ ├── Spinner12.png
│ │ │ ├── Spinner13.png
│ │ │ ├── Spinner14.png
│ │ │ ├── Spinner15.png
│ │ │ ├── Spinner16.png
│ │ │ ├── Spinner17.png
│ │ │ ├── Spinner18.png
│ │ │ ├── Spinner19.png
│ │ │ ├── Spinner20.png
│ │ │ ├── Spinner21.png
│ │ │ ├── Spinner22.png
│ │ │ ├── Spinner23.png
│ │ │ ├── Spinner24.png
│ │ │ ├── Spinner25.png
│ │ │ ├── Spinner26.png
│ │ │ ├── Spinner27.png
│ │ │ ├── Spinner28.png
│ │ │ ├── Spinner29.png
│ │ │ ├── Spinner30.png
│ │ │ ├── Spinner31.png
│ │ │ ├── Spinner32.png
│ │ │ ├── Spinner33.png
│ │ │ ├── Spinner34.png
│ │ │ ├── Spinner35.png
│ │ │ ├── Spinner36.png
│ │ │ ├── Spinner37.png
│ │ │ ├── Spinner38.png
│ │ │ ├── Spinner39.png
│ │ │ ├── Spinner40.png
│ │ │ ├── Spinner41.png
│ │ │ ├── Spinner42.png
│ │ │ ├── Spinner43.png
│ │ │ ├── Spinner44.png
│ │ │ ├── Spinner45.png
│ │ │ ├── Spinner46.png
│ │ │ ├── Spinner47.png
│ │ │ ├── Spinner48.png
│ │ │ ├── Spinner49.png
│ │ │ ├── Spinner50.png
│ │ │ ├── Spinner51.png
│ │ │ ├── Spinner52.png
│ │ │ ├── Spinner53.png
│ │ │ ├── Spinner54.png
│ │ │ ├── Spinner55.png
│ │ │ ├── Spinner56.png
│ │ │ ├── Spinner57.png
│ │ │ ├── Spinner58.png
│ │ │ ├── Spinner59.png
│ │ │ ├── Spinner60.png
│ │ │ ├── Spinner61.png
│ │ │ ├── Spinner62.png
│ │ │ ├── Spinner63.png
│ │ │ ├── Spinner64.png
│ │ │ ├── Spinner65.png
│ │ │ ├── Spinner66.png
│ │ │ ├── Spinner67.png
│ │ │ ├── Spinner68.png
│ │ │ ├── Spinner69.png
│ │ │ ├── Spinner70.png
│ │ │ ├── Spinner71.png
│ │ │ ├── Spinner72.png
│ │ │ ├── Spinner73.png
│ │ │ ├── Spinner74.png
│ │ │ ├── Spinner75.png
│ │ │ ├── Spinner76.png
│ │ │ ├── Spinner77.png
│ │ │ ├── Spinner78.png
│ │ │ ├── Spinner79.png
│ │ │ ├── Spinner80.png
│ │ │ ├── Spinner81.png
│ │ │ ├── Spinner82.png
│ │ │ ├── Spinner83.png
│ │ │ ├── Spinner84.png
│ │ │ ├── Spinner85.png
│ │ │ ├── Spinner86.png
│ │ │ ├── Spinner87.png
│ │ │ ├── Spinner88.png
│ │ │ ├── Spinner89.png
│ │ │ └── Spinner90.png
│ │ │ ├── wireless-0-symbolic.svg
│ │ │ ├── wireless-0.svg
│ │ │ ├── wireless-2-symbolic.svg
│ │ │ ├── wireless-2.svg
│ │ │ ├── wireless-4-symbolic.svg
│ │ │ ├── wireless-4.svg
│ │ │ ├── wireless-6-symbolic.svg
│ │ │ ├── wireless-6.svg
│ │ │ ├── wireless-8-symbolic.svg
│ │ │ ├── wireless-8.svg
│ │ │ ├── wireless-background.svg
│ │ │ ├── wireless-disconnect-symbolic.svg
│ │ │ └── wireless-disconnect.svg
│ ├── notify
│ │ ├── images
│ │ │ ├── notify_close_hover.svg
│ │ │ ├── notify_close_normal.svg
│ │ │ ├── notify_close_press.svg
│ │ │ ├── split_hover.svg
│ │ │ ├── split_normal.svg
│ │ │ └── split_press.svg
│ │ ├── notify.qrc
│ │ ├── notifydelegate.cpp
│ │ ├── notifydelegate.h
│ │ ├── notifymodel.cpp
│ │ ├── notifymodel.h
│ │ ├── notifyplugin.cpp
│ │ ├── notifyplugin.h
│ │ ├── notifyview.cpp
│ │ ├── notifyview.h
│ │ ├── notifywidget.cpp
│ │ └── notifywidget.h
│ ├── power
│ │ ├── Icons
│ │ │ ├── battery-charging-status.svg
│ │ │ ├── battery.svg
│ │ │ ├── full-battery.svg
│ │ │ ├── half-battery.svg
│ │ │ └── low-battery.svg
│ │ ├── power.qrc
│ │ ├── powerplugin.cpp
│ │ ├── powerplugin.h
│ │ ├── powerwidget.cpp
│ │ ├── powerwidget.h
│ │ ├── powerwidgetaction.cpp
│ │ └── powerwidgetaction.h
│ ├── search
│ │ ├── searchbutton.cpp
│ │ ├── searchbutton.h
│ │ ├── searchmodule.cpp
│ │ └── searchmodule.h
│ ├── sound
│ │ ├── componments
│ │ │ ├── horizontalseparator.cpp
│ │ │ ├── horizontalseparator.h
│ │ │ ├── mediacontrol.cpp
│ │ │ ├── mediacontrol.h
│ │ │ ├── volumeslider.cpp
│ │ │ └── volumeslider.h
│ │ ├── resources
│ │ │ ├── image
│ │ │ │ ├── empty.svg
│ │ │ │ ├── full.svg
│ │ │ │ ├── half.svg
│ │ │ │ ├── low.svg
│ │ │ │ ├── mute.svg
│ │ │ │ ├── slider_bg.png
│ │ │ │ └── slider_round.png
│ │ │ └── sound.qrc
│ │ ├── sinkinputwidget.cpp
│ │ ├── sinkinputwidget.h
│ │ ├── soundapplet.cpp
│ │ ├── soundapplet.h
│ │ ├── sounditem.cpp
│ │ ├── sounditem.h
│ │ ├── soundplugin.cpp
│ │ └── soundplugin.h
│ ├── system-tray
│ │ ├── abstracttraywidget.cpp
│ │ ├── abstracttraywidget.h
│ │ ├── dbus
│ │ │ ├── com.deepin.dde.TrayManager.xml
│ │ │ ├── dbustraymanager.cpp
│ │ │ ├── dbustraymanager.h
│ │ │ └── sni
│ │ │ │ ├── dbusstructures.cpp
│ │ │ │ ├── dbusstructures.h
│ │ │ │ ├── statusnotifieritem_interface.cpp
│ │ │ │ ├── statusnotifieritem_interface.h
│ │ │ │ ├── statusnotifierwatcheradapter.cpp
│ │ │ │ └── statusnotifierwatcheradapter.h
│ │ ├── resources
│ │ │ └── trayicon.svg
│ │ ├── sni
│ │ │ ├── statusnotifierwatcher.cpp
│ │ │ └── statusnotifierwatcher.h
│ │ ├── snitraywidget.cpp
│ │ ├── snitraywidget.h
│ │ ├── system-tray.qrc
│ │ ├── systemtrayplugin.cpp
│ │ ├── systemtrayplugin.h
│ │ ├── tipswidget.cpp
│ │ ├── tipswidget.h
│ │ ├── traypanel.cpp
│ │ ├── traypanel.h
│ │ ├── xwindowtraywidget.cpp
│ │ └── xwindowtraywidget.h
│ ├── systeminfo
│ │ ├── DBus
│ │ │ ├── org.freedesktop.NetworkManager.ActiveConnection.xml
│ │ │ ├── org.freedesktop.NetworkManager.Device.xml
│ │ │ ├── org.freedesktop.NetworkManager.xml
│ │ │ ├── org_freedesktop_networkmanager.cpp
│ │ │ ├── org_freedesktop_networkmanager.h
│ │ │ ├── org_freedesktop_networkmanager_activeconnection.cpp
│ │ │ ├── org_freedesktop_networkmanager_activeconnection.h
│ │ │ ├── org_freedesktop_networkmanager_device.cpp
│ │ │ └── org_freedesktop_networkmanager_device.h
│ │ ├── resources
│ │ │ ├── icon_cpu_dark.svg
│ │ │ ├── icon_memory_dark.svg
│ │ │ ├── left_down.svg
│ │ │ ├── right_top.svg
│ │ │ └── systeminfo.qrc
│ │ ├── systeminfomodel.cpp
│ │ ├── systeminfomodel.h
│ │ ├── systeminfoplugin.cpp
│ │ ├── systeminfoplugin.h
│ │ ├── systeminfopopupwidget.cpp
│ │ ├── systeminfopopupwidget.h
│ │ ├── systeminfothread.cpp
│ │ ├── systeminfothread.h
│ │ ├── systeminfowidget.cpp
│ │ └── systeminfowidget.h
│ ├── timewidget
│ │ ├── datetimeplugin.cpp
│ │ ├── datetimeplugin.h
│ │ ├── datetimewidget.cpp
│ │ └── datetimewidget.h
│ └── wallpaper
│ │ ├── wallpapermodel.cpp
│ │ ├── wallpapermodel.h
│ │ ├── wallpaperplugin.cpp
│ │ ├── wallpaperplugin.h
│ │ ├── wallpapersettings.cpp
│ │ ├── wallpapersettings.h
│ │ ├── wallpaperwidget.cpp
│ │ ├── wallpaperwidget.h
│ │ ├── wallpaperworker.cpp
│ │ └── wallpaperworker.h
└── widgets
│ ├── dactionbutton.cpp
│ ├── dactionbutton.h
│ ├── dactionlabel.cpp
│ ├── dactionlabel.h
│ ├── dwidgetaction.cpp
│ ├── dwidgetaction.h
│ ├── fontlabel.cpp
│ ├── fontlabel.h
│ ├── itempopupwindow.cpp
│ ├── itempopupwindow.h
│ ├── segoe-mdl2-assets.ttf
│ ├── switchbutton.cpp
│ ├── switchbutton.h
│ ├── switchitem.cpp
│ ├── switchitem.h
│ └── widgets.qrc
├── translate_generation.sh
└── translations
├── deepin-topbar_en_US.ts
├── deepin-topbar_es_ES.ts
├── deepin-topbar_fr_FR.ts
├── deepin-topbar_id_ID.ts
├── deepin-topbar_it_IT.ts
├── deepin-topbar_ja_JP.ts
├── deepin-topbar_pl_PL.ts
├── deepin-topbar_pt_BR.ts
├── deepin-topbar_ru_RU.ts
├── deepin-topbar_tr_TR.ts
└── deepin-topbar_zh_CN.ts
/.clog.toml:
--------------------------------------------------------------------------------
1 | [clog]
2 | repository = "https://github.com/kirigayakazushin/deepin-topbar"
3 | from-latest-tag = true
4 |
5 | changelog = "CHANGELOG.md"
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 | Makefile
6 |
7 | # Compiled Dynamic libraries
8 | *.so
9 | *.dylib
10 | plugins/*.so
11 | plugins/*.so.*
12 |
13 | # Compiled Static libraries
14 | *.lai
15 | *.la
16 | *.a
17 |
18 | build*/
19 | *.pro.user*
20 | *.DS_Store
21 | *.core
22 | *.autosave
23 | # qm file is auto generate from .ts file
24 | *.qm
25 |
26 | # vim tmp file
27 | *.swp
28 |
29 | # binary file
30 | deepin-topbar
31 |
32 | *.debug
33 |
34 | frame/moc_*
35 | plugins/moc_*
36 | plugins/*/moc*
37 |
38 | moc_*
39 | qrc_*
40 | build/
41 | .vscode/
42 | *.user
43 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.7)
2 |
3 | project(deepin-topbar)
4 |
5 | # Install settings
6 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
7 | set(CMAKE_INSTALL_PREFIX /usr)
8 | endif ()
9 |
10 | add_subdirectory(src)
11 |
12 | if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
13 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast")
14 |
15 | # generate qm
16 | execute_process(COMMAND bash "translate_generation.sh"
17 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
18 | endif ()
19 |
20 | ## qm files
21 | file(GLOB QM_FILES "translations/*.qm")
22 | install(FILES ${QM_FILES}
23 | DESTINATION share/deepin-topbar/translations)
24 |
25 | ## services files
26 | install(FILES com.deepin.dde.topbar.service
27 | DESTINATION share/dbus-1/services)
28 |
29 | ## polkit
30 | install(FILES com.deepin.dde.topbar.polkit.service
31 | DESTINATION share/polkit-1/actions)
32 |
33 | ## icon
34 | install(FILES deepin-topbar.svg deepin-logo.svg
35 | DESTINATION share/icons/hicolor/scalable/apps)
36 |
37 | # desktop
38 | install(FILES deepin-topbar.desktop
39 | DESTINATION share/applications/)
40 |
--------------------------------------------------------------------------------
/com.deepin.dde.topbar.polkit.service:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | Deepin
7 |
8 | dde
9 |
10 | yes
11 | yes
12 | yes
13 |
14 | This operation requires authorization!
15 | /usr/bin/cpupower
16 | true
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/com.deepin.dde.topbar.service:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=com.deepin.dde.topbar
3 | Exec=/usr/bin/deepin-topbar
4 |
--------------------------------------------------------------------------------
/debian/changelog:
--------------------------------------------------------------------------------
1 | deepin-topbar (0.1-1) unstable; urgency=low
2 |
3 | * Initial release.
4 |
5 | -- Deepin Packages Builder Mon, 13 Feb 2017 16:32:34 +0800
6 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: deepin-topbar
2 | Section: base
3 | Priority: optional
4 | Maintainer: kirigaya
5 | Build-Depends:
6 | debhelper (>= 9),
7 | pkg-config,
8 | dpkg-dev,
9 | qttools5-dev-tools,
10 | expect,
11 | cmake,
12 | qt5-default,
13 | qtbase5-dev,
14 | libdtkwidget-dev,
15 | libdtkcore-dev,
16 | libdtkcore-bin,
17 | libxcb-ewmh-dev,
18 | libxcb-util0-dev,
19 | libdframeworkdbus-dev,
20 | libgsettings-qt-dev,
21 | libxcb-image0-dev,
22 | libxcb-icccm4-dev,
23 | libxcb-composite0-dev,
24 | libqt5svg5-dev,
25 | libxtst-dev,
26 | libgsettings-qt-dev,
27 | libdbusmenu-qt5-dev,
28 | libdde-network-utils-dev,
29 | libprocps-dev
30 | Standards-Version: 0.1-1
31 | Homepage: https://github.com/haruyukilxz/deepin-topbar
32 |
33 | Package: deepin-topbar
34 | Architecture: any
35 | Depends:
36 | ${shlibs:Depends},
37 | ${misc:Depends}
38 | Conflicts: dde-topbar
39 | Replaces: dde-topbar
40 | Description: topbar for deepin.
41 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | %:
4 | dh $@ --parallel
5 |
6 | override_dh_auto_configure:
7 | dh_auto_configure -- -DENABLE_RATOTE=NO
8 |
--------------------------------------------------------------------------------
/deepin-topbar.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Comment=Deepin Desktop Environment Topbar
3 | Exec=/usr/bin/deepin-topbar
4 | Icon=deepin-topbar
5 | Name=Topbar
6 | StartupNotify=false
7 | Terminal=false
8 | Type=Application
9 |
--------------------------------------------------------------------------------
/src/dbus/com.deepin.daemon.Audio.Sink.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
33 |
34 |
--------------------------------------------------------------------------------
/src/dbus/com.deepin.daemon.Audio.SinkInput.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/dbus/com.deepin.daemon.Audio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/dbus/com.deepin.daemon.Power.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/dbus/com.deepin.dde.Wallpaper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/dbus/com_deepin_dde_wallpaper.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp-fix version 0.8
3 | * Command line was: qdbusxml2cpp-fix -c Wallpaper -p generated/com_deepin_dde_wallpaper /home/kirigaya/projects/Deepin/dde-qt-dbus-factory/xml/com.deepin.dde.Wallpaper.xml
4 | *
5 | * qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "com_deepin_dde_wallpaper.h"
13 |
14 | /*
15 | * Implementation of interface class __Wallpaper
16 | */
17 |
18 | __Wallpaper::__Wallpaper(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
19 | : DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
20 | {
21 | }
22 |
23 | __Wallpaper::~__Wallpaper()
24 | {
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/src/dbus/dbusaccount.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 Deepin Technology Co., Ltd.
3 | *
4 | * This program is free software; you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation; either version 3 of the License, or
7 | * (at your option) any later version.
8 | **/
9 |
10 | /*
11 | * This file was generated by qdbusxml2cpp version 0.8
12 | * Command line was: qdbusxml2cpp -c DBusAccount -p dbusaccount com.deepin.daemon.Accounts.xml
13 | *
14 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
15 | *
16 | * This is an auto-generated file.
17 | * This file may have been hand-edited. Look for HAND-EDIT comments
18 | * before re-generating it.
19 | */
20 |
21 | #include "dbusaccount.h"
22 |
23 | /*
24 | * Implementation of interface class DBusAccount
25 | */
26 |
27 | DBusAccount::DBusAccount(QObject *parent)
28 | : QDBusAbstractInterface(staticService(), staticInterfacePath(), staticInterfaceName(), QDBusConnection::systemBus(), parent)
29 | {
30 | QDBusConnection::systemBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
31 | }
32 |
33 | DBusAccount::~DBusAccount()
34 | {
35 | QDBusConnection::systemBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/src/dbus/dbusaudio.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -c DBusAudio -p dbusaudio com.deepin.daemon.Audio.xml
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbusaudio.h"
13 |
14 | /*
15 | * Implementation of interface class DBusAudio
16 | */
17 |
18 | DBusAudio::DBusAudio(QObject *parent)
19 | : QDBusAbstractInterface("com.deepin.daemon.Audio", "/com/deepin/daemon/Audio", staticInterfaceName(), QDBusConnection::sessionBus(), parent)
20 | {
21 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
22 | }
23 |
24 | DBusAudio::~DBusAudio()
25 | {
26 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/src/dbus/dbusinterface.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp-fix version 0.8
3 | * Command line was: qdbusxml2cpp-fix -c DBusInterface -p dbusinterface org.freedesktop.DBus.xml
4 | *
5 | * qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbusinterface.h"
13 |
14 | /*
15 | * Implementation of interface class DBusInterface
16 | */
17 |
18 | DBusInterface::DBusInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
20 | {
21 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
22 | }
23 |
24 | DBusInterface::~DBusInterface()
25 | {
26 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/src/dbus/dbusmediaplayer2.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -c DBusMediaPlayer2 -p dbusmediaplayer2 org.mpris.MediaPlayer2.xml
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbusmediaplayer2.h"
13 |
14 | /*
15 | * Implementation of interface class DBusMediaPlayer2
16 | */
17 |
18 | DBusMediaPlayer2::DBusMediaPlayer2(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
20 | {
21 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
22 | }
23 |
24 | DBusMediaPlayer2::~DBusMediaPlayer2()
25 | {
26 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/src/dbus/dbussink.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -c DBusSink -p dbussink com.deepin.daemon.Audio.Sink.xml
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbussink.h"
13 |
14 | /*
15 | * Implementation of interface class DBusSink
16 | */
17 |
18 | DBusSink::DBusSink(const QString &path, QObject *parent)
19 | : QDBusAbstractInterface("com.deepin.daemon.Audio", path, staticInterfaceName(), QDBusConnection::sessionBus(), parent)
20 | {
21 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
22 | }
23 |
24 | DBusSink::~DBusSink()
25 | {
26 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/src/dbus/dbussinkinput.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -c DBusSinkInput -p dbussinkinput com.deepin.daemon.Audio.SinkInput.xml
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbussinkinput.h"
13 |
14 | /*
15 | * Implementation of interface class DBusSinkInput
16 | */
17 |
18 | DBusSinkInput::DBusSinkInput(const QString &path, QObject *parent)
19 | : QDBusAbstractInterface("com.deepin.daemon.Audio", path, staticInterfaceName(), QDBusConnection::sessionBus(), parent)
20 | {
21 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
22 | }
23 |
24 | DBusSinkInput::~DBusSinkInput()
25 | {
26 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/src/frame/dbusservice.cpp:
--------------------------------------------------------------------------------
1 | #include "dbusservice.h"
2 |
3 | DBusService::DBusService(MainFrame *parent)
4 | : QDBusAbstractAdaptor(parent)
5 | , m_mainFrame(parent)
6 | {
7 |
8 | }
9 |
10 | MainFrame *DBusService::parent() const
11 | {
12 | return m_mainFrame;
13 | }
14 |
15 | void DBusService::ShowSetting()
16 | {
17 | m_mainFrame->showSetting();
18 | }
19 |
--------------------------------------------------------------------------------
/src/frame/dbusservice.h:
--------------------------------------------------------------------------------
1 | #ifndef DBUSSERVICE_H
2 | #define DBUSSERVICE_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "mainframe.h"
9 |
10 | class DBusService : public QDBusAbstractAdaptor
11 | {
12 | Q_OBJECT
13 | Q_CLASSINFO("D-Bus Interface", "com.deepin.dde.topbar")
14 | public:
15 | explicit DBusService(MainFrame *parent);
16 |
17 | inline MainFrame *parent() const;
18 |
19 | public slots:
20 | void ShowSetting();
21 |
22 | private:
23 | MainFrame *m_mainFrame;
24 | };
25 |
26 | #endif // DBUSSERVICE_H
27 |
--------------------------------------------------------------------------------
/src/frame/deepin-topbar.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | settings.json
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/frame/item/contentmodule.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "contentmodule.h"
20 | #include "frame/utils/global.h"
21 |
22 | ContentModule::ContentModule(QWidget *parent) : QFrame(parent)
23 | {
24 | setObjectName("ContentModule");
25 |
26 | setFixedHeight(TOPHEIGHT);
27 | }
28 |
--------------------------------------------------------------------------------
/src/frame/item/contentmodule.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef CONTENTMODULE_H
20 | #define CONTENTMODULE_H
21 |
22 | #include
23 |
24 | class ContentModule : public QFrame
25 | {
26 | Q_OBJECT
27 | public:
28 | explicit ContentModule(QWidget *parent = nullptr);
29 |
30 | signals:
31 |
32 | public slots:
33 | };
34 |
35 | #endif // CONTENTMODULE_H
36 |
--------------------------------------------------------------------------------
/src/frame/item/item.cpp:
--------------------------------------------------------------------------------
1 | #include "item.h"
2 | #include
3 |
4 | using namespace dtb;
5 |
6 | std::unique_ptr Item::PopupWindow(nullptr);
7 |
8 | Item::Item(QWidget *parent)
9 | : QWidget(parent)
10 | {
11 | if (!PopupWindow.get()) {
12 | ItemPopupWindow *arrowRectangle = new ItemPopupWindow(nullptr);
13 | PopupWindow.reset(arrowRectangle);
14 | }
15 | }
16 |
17 | PluginsItemInterface *Item::itemInter()
18 | {
19 | return nullptr;
20 | }
21 |
22 | QWidget *Item::contextMenu() const
23 | {
24 | return nullptr;
25 | }
26 |
27 | void Item::hidePopupWindow()
28 | {
29 | if (PopupWindow.get()) {
30 | PopupWindow->hide();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/frame/item/item.h:
--------------------------------------------------------------------------------
1 | #ifndef ITEM_H
2 | #define ITEM_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "widgets/itempopupwindow.h"
6 | #include
7 | #include
8 |
9 | namespace dtb {
10 | class Item : public QWidget
11 | {
12 | Q_OBJECT
13 | public:
14 | explicit Item(QWidget *parent = 0);
15 |
16 | virtual const QString name() const {return QString();}
17 | virtual PluginsItemInterface *itemInter();
18 | virtual QWidget* contextMenu() const;
19 | void hidePopupWindow();
20 |
21 | protected:
22 | static std::unique_ptr PopupWindow;
23 | };
24 | }
25 |
26 | #endif // ITEM_H
27 |
--------------------------------------------------------------------------------
/src/frame/item/pluginsitem.h:
--------------------------------------------------------------------------------
1 | #ifndef PLUGINSITEM_H
2 | #define PLUGINSITEM_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "item.h"
6 | #include
7 |
8 | namespace dtb {
9 | class PluginsItem : public Item
10 | {
11 | Q_OBJECT
12 | public:
13 | explicit PluginsItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent = 0);
14 | ~PluginsItem();
15 |
16 | const QString name() const Q_DECL_OVERRIDE;
17 | QMenu* contextMenu() const Q_DECL_OVERRIDE;
18 | void detachPluginWidget();
19 |
20 | private:
21 | PluginsItemInterface *itemInter() Q_DECL_OVERRIDE;
22 |
23 | signals:
24 | void requestRefershWindowVisible() const;
25 |
26 | protected:
27 | void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
28 |
29 | protected slots:
30 | void showTips();
31 |
32 | private:
33 | PluginsItemInterface * m_pluginInter;
34 | QWidget *m_centralWidget;
35 | QString m_itemKey;
36 | };
37 | }
38 |
39 | #endif // PLUGINSITEM_H
40 |
--------------------------------------------------------------------------------
/src/frame/item/stretchitem.cpp:
--------------------------------------------------------------------------------
1 | #include "stretchitem.h"
2 |
3 | using namespace dtb;
4 |
5 | StretchItem::StretchItem(QWidget *parent) : Item(parent)
6 | {
7 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
8 | }
9 |
10 | void StretchItem::mousePressEvent(QMouseEvent *e)
11 | {
12 | QWidget::mousePressEvent(e);
13 | }
14 |
--------------------------------------------------------------------------------
/src/frame/item/stretchitem.h:
--------------------------------------------------------------------------------
1 | #ifndef STRETCHITEM_H
2 | #define STRETCHITEM_H
3 |
4 | #include "item.h"
5 |
6 | namespace dtb {
7 | class StretchItem : public Item
8 | {
9 | Q_OBJECT
10 | public:
11 | explicit StretchItem(QWidget *parent = 0);
12 |
13 | protected:
14 | void mousePressEvent(QMouseEvent *e);
15 | };
16 | }
17 |
18 | #endif // STRETCHITEM_H
19 |
--------------------------------------------------------------------------------
/src/frame/main.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 |
4 | #include "dbusservice.h"
5 | #include "mainframe.h"
6 |
7 | DWIDGET_USE_NAMESPACE
8 |
9 | int main(int argc, char *argv[])
10 | {
11 | if (QString(getenv("XDG_CURRENT_DESKTOP")) != QStringLiteral("Deepin")) {
12 | qDebug() << "I only run the Deepin Desktop!";
13 | return -1;
14 | }
15 |
16 | DApplication::loadDXcbPlugin();
17 | DApplication a(argc, argv);
18 |
19 | if (a.setSingleInstance("deepin-topbar")) {
20 | a.setApplicationName("deepin-topbar");
21 | a.setOrganizationName("deepin");
22 |
23 | QTranslator translator;
24 | translator.load("/usr/share/deepin-topbar/translations/deepin-topbar_" +
25 | QLocale::system().name());
26 | a.installTranslator(&translator);
27 |
28 | MainFrame *mainFrame = new MainFrame;
29 |
30 | DBusService *dbus = new DBusService(mainFrame);
31 | Q_UNUSED(dbus);
32 |
33 | QDBusConnection::sessionBus().registerService("com.deepin.dde.topbar");
34 | QDBusConnection::sessionBus().registerObject("/com/deepin/dde/topbar",
35 | "com.deepin.dde.topbar", mainFrame);
36 |
37 | return a.exec();
38 | }
39 | return 0;
40 | }
41 |
--------------------------------------------------------------------------------
/src/frame/maindbusservice.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "maindbusservice.h"
20 | #include "mainframe.h"
21 |
22 | MainDBusService::MainDBusService(MainFrame *parent)
23 | : QDBusAbstractAdaptor(parent)
24 | , m_parent(parent)
25 | {
26 |
27 | }
28 |
29 | void MainDBusService::loadPlugin(const QString &pluginpath)
30 | {
31 | m_parent->loadPlugin(pluginpath);
32 | }
33 |
--------------------------------------------------------------------------------
/src/frame/maindbusservice.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef MAINDBUSSERVICE_H
20 | #define MAINDBUSSERVICE_H
21 |
22 | #include
23 | #include
24 |
25 |
26 | class MainFrame;
27 | class MainDBusService : public QDBusAbstractAdaptor
28 | {
29 | Q_OBJECT
30 | Q_CLASSINFO("D-Bus Interface", "com.deepin.deepin.Topbar")
31 | public:
32 | explicit MainDBusService(MainFrame *parent = nullptr);
33 |
34 | public slots:
35 | void loadPlugin(const QString &pluginpath);
36 |
37 | private:
38 | MainFrame *m_parent;
39 | };
40 |
41 | #endif // MAINDBUSSERVICE_H
42 |
--------------------------------------------------------------------------------
/src/frame/mainpanel.h:
--------------------------------------------------------------------------------
1 | #ifndef MAINPANEL_H
2 | #define MAINPANEL_H
3 |
4 | #include "interfaces/pluginproxyinterface.h"
5 | #include "item/pluginsitem.h"
6 | #include "item/item.h"
7 | #include
8 | #include
9 | #include
10 |
11 | namespace dtb {
12 | class Settings;
13 | class MainFrame;
14 | class MainPanel : public QWidget, public PluginProxyInterface
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit MainPanel(QWidget *parent = nullptr);
19 | void initUI();
20 | void initConnect();
21 |
22 | void addItem(PluginsItemInterface * const module, const QString &itemKey) Q_DECL_OVERRIDE;
23 | void removeItem(PluginsItemInterface * const module, const QString &itemKey) Q_DECL_OVERRIDE;
24 |
25 | bool saveConfig(const QString &itemKey, const QJsonObject &json) Q_DECL_OVERRIDE;
26 | const QJsonObject loadConfig(const QString &itemKey) Q_DECL_OVERRIDE;
27 |
28 | void hidePopupWindow() Q_DECL_OVERRIDE;
29 | void showSettingDialog();
30 |
31 | private slots:
32 | void loadModules();
33 | void loadModule(PluginsItemInterface * const module);
34 | void reload();
35 |
36 | private:
37 | QHBoxLayout *m_mainLayout;
38 | QMap> m_moduleMap;
39 | QGSettings *m_gsettings;
40 | bool m_isLight;
41 | DefaultColor m_defaultColor;
42 | QStringList m_blackList;
43 | Settings *m_settings;
44 | };
45 | }
46 |
47 | #endif // MAINPANEL_H
48 |
--------------------------------------------------------------------------------
/src/frame/settings.cpp:
--------------------------------------------------------------------------------
1 | #include "settings.h"
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | using namespace dtb;
9 |
10 | static Settings * _settings = nullptr;
11 |
12 | Settings &Settings::InStance()
13 | {
14 | if (!_settings) {
15 | _settings = new Settings;
16 | }
17 |
18 | return *_settings;
19 | }
20 |
21 | Settings::Settings(QObject *parent)
22 | : QObject(parent)
23 | {
24 | m_configPath = QString("%1/%2/%3/config.conf")
25 | .arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
26 | .arg(qApp->organizationName())
27 | .arg(qApp->applicationName());
28 | qDebug() << "configPath" << m_configPath;
29 | auto backend = new DTK_CORE_NAMESPACE::QSettingBackend(m_configPath);
30 |
31 | m_settings = DTK_CORE_NAMESPACE::DSettings::fromJsonFile(":/settings.json");
32 | m_settings->setBackend(backend);
33 |
34 | connect(m_settings, &DTK_CORE_NAMESPACE::DSettings::valueChanged, this, &Settings::valueChanged);
35 | }
36 |
--------------------------------------------------------------------------------
/src/frame/settings.h:
--------------------------------------------------------------------------------
1 | #ifndef SETTINGS_H
2 | #define SETTINGS_H
3 |
4 | #include
5 | #include
6 |
7 | namespace dtb {
8 | class Settings : public QObject
9 | {
10 | Q_OBJECT
11 | public:
12 | static Settings &InStance();
13 |
14 | inline QPointer settings() { return m_settings; }
15 |
16 | Q_SIGNALS:
17 | void valueChanged(const QString &key, const QVariant &value);
18 |
19 | private:
20 | Settings(QObject *parent = nullptr);
21 | QString m_configPath;
22 | QPointer m_settings;
23 | };
24 | }
25 |
26 | #endif // SETTINGS_H
27 |
--------------------------------------------------------------------------------
/src/frame/utils/global.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "global.h"
20 |
21 | Global::Global(QObject *parent) : QObject(parent)
22 | {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/frame/utils/global.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef GLOBAL_H
20 | #define GLOBAL_H
21 |
22 | #include
23 |
24 | #define TOPHEIGHT 26
25 | #define FRAMEHEIGHT 35
26 | #define FONTSIZE 13
27 |
28 | static const QStringList Module_list = {"systeminfo",
29 | "system-tray",
30 | "sound",
31 | "power",
32 | "network",
33 | "datetime",
34 | "search",
35 | "notify"
36 | };
37 |
38 | class Global : public QObject
39 | {
40 | Q_OBJECT
41 | public:
42 | explicit Global(QObject *parent = nullptr);
43 |
44 | signals:
45 |
46 | public slots:
47 | };
48 |
49 | #endif // GLOBAL_H
50 |
--------------------------------------------------------------------------------
/src/frame/utils/themeappicon.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: sbw
5 | *
6 | * Maintainer: sbw
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #ifndef THEMEAPPICON_H
23 | #define THEMEAPPICON_H
24 |
25 | #include
26 |
27 | class ThemeAppIcon : public QObject
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit ThemeAppIcon(QObject *parent = 0);
32 | ~ThemeAppIcon();
33 |
34 | static const QPixmap getIcon(const QString iconName, const int size);
35 | };
36 |
37 | #endif // THEMEAPPICON_H
38 |
--------------------------------------------------------------------------------
/src/interfaces/moduleiteminterface.h:
--------------------------------------------------------------------------------
1 | #ifndef MODULEITEMINTERFACE_H
2 | #define MODULEITEMINTERFACE_H
3 |
4 | #include "pluginproxyinterface.h"
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | ///
11 | /// \brief The ModuleItemInterface class
12 | /// the topbar plugins item interface, all topbar plugins should
13 | /// inheirt this class and override all pure virtual function.
14 | ///
15 |
16 | namespace dtb {
17 |
18 | class ModuleItemInterface
19 | {
20 | public:
21 |
22 | ModuleItemInterface() {}
23 |
24 | ///
25 | /// \brief ~ModuleItemInterface
26 | /// DON'T try to delete m_proxyInter.
27 | ///
28 | virtual ~ModuleItemInterface() {}
29 |
30 | ///
31 | /// \brief pluginName
32 | /// tell topbar the unique plugin id
33 | /// \return
34 | ///
35 | virtual const QString pluginName() const = 0;
36 | ///
37 | /// \brief init
38 | /// init your plugins, you need to save proxyInter to m_proxyInter
39 | /// member variable. but you shouldn't free this pointer.
40 | /// \param proxyInter
41 | /// DON'T try to delete this pointer.
42 | ///
43 | virtual void init(PluginProxyInterface *proxyInter) { m_proxyInter = proxyInter;}
44 | ///
45 | /// \brief itemWidget
46 | /// your plugin item widget, each item should have a unique key.
47 | /// \param itemKey
48 | /// your widget' unqiue key.
49 | /// \return
50 | ///
51 | virtual QWidget *itemWidget(const QString &itemKey) = 0;
52 |
53 | virtual QMenu* itemContextMenu(const QString &itemKey) { Q_UNUSED(itemKey); return new QMenu();}
54 |
55 | protected:
56 | ///
57 | /// \brief m_proxyInter
58 | /// NEVER delete this object.
59 | ///
60 | PluginProxyInterface *m_proxyInter;
61 | };
62 | }
63 |
64 | #endif // ModuleItemInterface_H
65 |
--------------------------------------------------------------------------------
/src/interfaces/pluginproxyinterface.h:
--------------------------------------------------------------------------------
1 | #ifndef PLUGINPROXYINTERFACE_H
2 | #define PLUGINPROXYINTERFACE_H
3 |
4 | #include
5 | #include
6 |
7 | namespace dtb {
8 |
9 | class PluginsItemInterface;
10 | class PluginProxyInterface
11 | {
12 | public:
13 | enum DefaultColor {
14 | Light,
15 | Dark
16 | };
17 |
18 | virtual void addItem(PluginsItemInterface * const module, const QString &itemKey) = 0;
19 |
20 | virtual void removeItem(PluginsItemInterface * const module, const QString &itemKey) = 0;
21 |
22 | virtual bool saveConfig(const QString &itemKey, const QJsonObject &json) { Q_UNUSED(itemKey); Q_UNUSED(json); return false;}
23 |
24 | virtual const QJsonObject loadConfig(const QString &itemKey) { Q_UNUSED(itemKey); return QJsonObject();}
25 |
26 | virtual void hidePopupWindow() = 0;
27 | };
28 |
29 | }
30 | #endif // PLUGINPROXYINTERFACE_H
31 |
--------------------------------------------------------------------------------
/src/modules/account/accountplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "accountplugin.h"
2 | #include "accountwidget.h"
3 |
4 | namespace dtb {
5 | namespace account {
6 | AccountPlugin::AccountPlugin(QObject *parent)
7 | : QObject(parent)
8 | {
9 | m_Account = new AccountWidget;
10 | }
11 |
12 | const QString AccountPlugin::pluginName() const
13 | {
14 | return "account";
15 | }
16 |
17 | void AccountPlugin::init(PluginProxyInterface *proxyInter)
18 | {
19 | m_proxyInter = proxyInter;
20 |
21 | m_proxyInter->addItem(this, "");
22 | }
23 |
24 | QWidget *AccountPlugin::itemWidget(const QString &itemKey)
25 | {
26 | Q_UNUSED(itemKey);
27 |
28 | return m_Account;
29 | }
30 |
31 | QMenu *AccountPlugin::itemContextMenu(const QString &itemKey)
32 | {
33 | Q_UNUSED(itemKey);
34 |
35 | return m_Account->menu();
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/modules/account/accountplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef AccountPLUGIN_H
2 | #define AccountPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include
6 |
7 | namespace dtb {
8 | namespace account {
9 |
10 | class AccountWidget;
11 |
12 | class AccountPlugin : public QObject, public PluginsItemInterface
13 | {
14 | Q_OBJECT
15 | public:
16 | explicit AccountPlugin(QObject *parent = 0);
17 |
18 | const QString pluginName() const Q_DECL_OVERRIDE;
19 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
20 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
21 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
22 |
23 | private:
24 | PluginProxyInterface *m_proxyInter;
25 | AccountWidget *m_Account;
26 | };
27 | }
28 | }
29 |
30 | #endif // AccountPLUGIN_H
31 |
--------------------------------------------------------------------------------
/src/modules/account/accountwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef AccountWIDGET_H
2 | #define AccountWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | using DBusLogined = com::deepin::daemon::Logined;
11 | using DBusUser = com::deepin::daemon::accounts::User;
12 |
13 | namespace dtb {
14 | namespace account {
15 | class AccountWidget : public ContentModule
16 | {
17 | Q_OBJECT
18 | public:
19 | explicit AccountWidget(QWidget *parent = 0);
20 | ~AccountWidget();
21 |
22 | inline QMenu *menu() { return m_menu;}
23 |
24 | private slots:
25 | void iconUpdate(const QString &file);
26 | void handleShutdownAction(const QString &action);
27 | void handleLockAction();
28 |
29 | private:
30 | void initMenu();
31 |
32 | private:
33 | QLabel *m_accountIcon;
34 | DBusLogined *m_dbusLogined;
35 | DBusUser *m_dbusUser;
36 | QMenu *m_menu;
37 | };
38 | }
39 | }
40 |
41 | #endif // AccountWIDGET_H
42 |
--------------------------------------------------------------------------------
/src/modules/indicator/View/appstoreaction.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef APPSTOREACTION_H
20 | #define APPSTOREACTION_H
21 |
22 | #include
23 |
24 | class QLabel;
25 |
26 | namespace dtb {
27 | namespace indicator {
28 | class IndicatorModel;
29 | class AppstoreAction : public QWidget
30 | {
31 | Q_OBJECT
32 | public:
33 | explicit AppstoreAction(QWidget *parent = nullptr);
34 |
35 | void setModel(IndicatorModel *model);
36 |
37 | protected:
38 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
39 |
40 | private slots:
41 | void onUpdatesChanged(const QStringList &list);
42 |
43 | private:
44 | IndicatorModel *m_model;
45 | QLabel *m_updateLbl;
46 | bool m_enter;
47 | };
48 | }
49 | }
50 |
51 | #endif // APPSTOREACTION_H
52 |
--------------------------------------------------------------------------------
/src/modules/indicator/View/entry.cpp:
--------------------------------------------------------------------------------
1 | #include "entry.h"
2 |
3 | #include
4 | #include
5 |
6 | namespace dtb {
7 | namespace indicator {
8 |
9 | Entry::Entry(QWidget *parent) : QFrame(parent)
10 | {
11 | setObjectName("Entry");
12 |
13 | setWindowFlags(Qt::WindowDoesNotAcceptFocus);
14 | setAttribute(Qt::WA_TranslucentBackground);
15 |
16 | m_title = new QLabel;
17 |
18 | QHBoxLayout *mainLayout = new QHBoxLayout;
19 | mainLayout->setMargin(0);
20 | mainLayout->setSpacing(0);
21 | mainLayout->setContentsMargins(10, 0, 10, 0);
22 |
23 | mainLayout->addWidget(m_title, 0, Qt::AlignVCenter | Qt::AlignLeft);
24 |
25 | setLayout(mainLayout);
26 | }
27 |
28 | void Entry::setText(const QString &text)
29 | {
30 | m_title->setText(text);
31 | }
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/modules/indicator/View/entry.h:
--------------------------------------------------------------------------------
1 | #ifndef ENTRY_H
2 | #define ENTRY_H
3 |
4 | #include
5 | #include
6 |
7 | namespace dtb {
8 | namespace indicator {
9 |
10 | class Entry : public QFrame
11 | {
12 | Q_OBJECT
13 | public:
14 | explicit Entry(QWidget *parent = 0);
15 |
16 | void setText(const QString &text);
17 |
18 | private:
19 | QLabel *m_title;
20 | };
21 | }
22 | }
23 | #endif // ENTRY_H
24 |
--------------------------------------------------------------------------------
/src/modules/indicator/View/indicatorwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef INDICATORWIDGET_H
2 | #define INDICATORWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 | #include "entry.h"
6 | #include
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | using Systeminfo = com::deepin::daemon::SystemInfo;
13 | using DockInter = com::deepin::dde::daemon::Dock;
14 | using DockEntry = com::deepin::dde::daemon::dock::Entry;
15 |
16 | namespace dtb {
17 | namespace indicator {
18 | class IndicatorWidget : public ContentModule
19 | {
20 | Q_OBJECT
21 | public:
22 | explicit IndicatorWidget(QWidget *parent = nullptr);
23 | ~IndicatorWidget();
24 | void initUI();
25 |
26 | signals:
27 | void requestBackgroundChanged(const QColor &color);
28 |
29 | public slots:
30 | void forceQuit();
31 |
32 | private slots:
33 | void getAllEntry();
34 | void addEntry(const QDBusObjectPath &entryPath, const int index);
35 | void removeEntry(const QString &entryID);
36 | void refreshActiveWindow();
37 |
38 | private:
39 | DockInter *m_dockInter;
40 | QList m_entryList;
41 | Entry *m_entry;
42 | DockEntry *m_activeWindow;
43 | Systeminfo *m_systeminfo;
44 | QString m_systemVersion;
45 | };
46 | }
47 | }
48 |
49 | #endif // INDICATORWIDGET_H
50 |
--------------------------------------------------------------------------------
/src/modules/indicator/View/positionwidget.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef POSITIONWIDGET_H
20 | #define POSITIONWIDGET_H
21 |
22 | #include "frame/item/contentmodule.h"
23 |
24 | class QMenu;
25 |
26 | namespace dtb {
27 | namespace indicator {
28 | class PositionWidget : public ContentModule {
29 | Q_OBJECT
30 | public:
31 | explicit PositionWidget(QWidget *parent = nullptr);
32 |
33 | enum Action {
34 | Home,
35 | Desktop,
36 | Document,
37 | Photo,
38 | Video,
39 | };
40 |
41 | QMenu *menu()
42 | {
43 | return m_menu;
44 | }
45 |
46 | signals:
47 | void requestHidePopupWindow();
48 |
49 | private:
50 | void handleAction(const int &action);
51 |
52 | private:
53 | QMenu *m_menu;
54 | };
55 | } // namespace indicator
56 | } // namespace dtb
57 |
58 | #endif // POSITIONWIDGET_H
59 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicator.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | theme/light/IndicatorWidget.theme
5 | theme/light/SystemLogo.theme
6 | theme/light/PositionWidget.theme
7 |
8 |
9 | theme/dark/IndicatorWidget.theme
10 | theme/dark/SystemLogo.theme
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicatormodel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "indicatormodel.h"
20 | #include
21 |
22 | using namespace dtb;
23 | using namespace dtb::indicator;
24 |
25 | IndicatorModel::IndicatorModel(QObject *parent) : QObject(parent)
26 | {
27 |
28 | }
29 |
30 | QStringList IndicatorModel::appslist() const
31 | {
32 | return m_appslist;
33 | }
34 |
35 | void IndicatorModel::setAppslist(const QStringList &appslist)
36 | {
37 | if (m_appslist == appslist)
38 | return;
39 |
40 | m_appslist = appslist;
41 |
42 | emit appsListChanged(appslist);
43 | }
44 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicatormodel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef INDICATORMODEL_H
20 | #define INDICATORMODEL_H
21 |
22 | #include
23 |
24 | namespace dtb {
25 | namespace indicator {
26 | class IndicatorModel : public QObject
27 | {
28 | Q_OBJECT
29 | public:
30 | explicit IndicatorModel(QObject *parent = nullptr);
31 |
32 | QStringList appslist() const;
33 | void setAppslist(const QStringList &appslist);
34 |
35 | signals:
36 | void appsListChanged(const QStringList &list);
37 |
38 |
39 | private:
40 | QStringList m_appslist;
41 | };
42 | }
43 | }
44 |
45 | #endif // INDICATORMODEL_H
46 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicatorplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef INDICATORPLUGIN_H
2 | #define INDICATORPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "View/indicatorwidget.h"
6 | #include "View/systemlogo.h"
7 | #include "View/positionwidget.h"
8 | #include "indicatormodel.h"
9 | #include "indicatorworker.h"
10 | #include
11 | #include
12 | #include
13 |
14 | DWIDGET_USE_NAMESPACE
15 |
16 | namespace dtb {
17 | namespace indicator {
18 |
19 | class IndicatorPlugin : public QObject, public PluginsItemInterface
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | IndicatorPlugin(QObject *parent = 0);
25 |
26 | const QString pluginName() const Q_DECL_OVERRIDE;
27 |
28 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
29 |
30 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
31 |
32 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
33 |
34 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
35 |
36 | private:
37 | PluginProxyInterface *m_proxyInter;
38 | IndicatorWidget *m_centralWidget;
39 | SystemLogo *m_logo;
40 | IndicatorModel *m_model;
41 | IndicatorWorker *m_worker;
42 | DThemeManager *m_themeManager;
43 | PositionWidget *m_positionLbl;
44 | };
45 | }
46 | }
47 |
48 |
49 | #endif // INDICATORPLUGIN_H
50 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicatorworker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "indicatorworker.h"
20 | #include "indicatormodel.h"
21 |
22 | using namespace dtb;
23 | using namespace dtb::indicator;
24 |
25 | IndicatorWorker::IndicatorWorker(IndicatorModel *model, QObject *parent)
26 | : QObject(parent)
27 | , m_model(model)
28 | , m_updateInter(new UpdateInter("com.deepin.lastore", "/com/deepin/lastore", QDBusConnection::systemBus(), this))
29 | {
30 | m_updateInter->setSync(false);
31 |
32 | connect(m_updateInter, &UpdateInter::UpdatableAppsChanged, m_model, &IndicatorModel::setAppslist, Qt::UniqueConnection);
33 |
34 | m_updateInter->updatableApps();
35 | }
36 |
--------------------------------------------------------------------------------
/src/modules/indicator/indicatorworker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef INDICATORWORKER_H
20 | #define INDICATORWORKER_H
21 |
22 | #include
23 |
24 | #include
25 |
26 | using UpdateInter=com::deepin::lastore::Updater;
27 |
28 | namespace dtb {
29 | namespace indicator {
30 |
31 | class IndicatorModel;
32 | class IndicatorWorker : public QObject
33 | {
34 | Q_OBJECT
35 | public:
36 | explicit IndicatorWorker(IndicatorModel* model, QObject *parent = nullptr);
37 |
38 | private:
39 | IndicatorModel *m_model;
40 | UpdateInter* m_updateInter;
41 | };
42 | }
43 | }
44 |
45 | #endif // INDICATORWORKER_H
46 |
--------------------------------------------------------------------------------
/src/modules/indicator/theme/dark/IndicatorWidget.theme:
--------------------------------------------------------------------------------
1 | #Entry QLabel {
2 | font-size: 13.5pt;
3 | font-weight: 500;
4 | color: #D3D3D3;
5 | }
6 |
--------------------------------------------------------------------------------
/src/modules/indicator/theme/dark/SystemLogo.theme:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/indicator/theme/dark/SystemLogo.theme
--------------------------------------------------------------------------------
/src/modules/indicator/theme/light/IndicatorWidget.theme:
--------------------------------------------------------------------------------
1 | dtb--indicator--Entry QLabel {
2 | font-size: 11pt;
3 | font-weight: 500;
4 | color: white;
5 | }
6 |
--------------------------------------------------------------------------------
/src/modules/indicator/theme/light/PositionWidget.theme:
--------------------------------------------------------------------------------
1 | dtb--indicator--PositionWidget QLabel {
2 | font-size: 11pt;
3 | font-weight: 500;
4 | color: black;
5 | }
6 |
--------------------------------------------------------------------------------
/src/modules/indicator/theme/light/SystemLogo.theme:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/indicator/theme/light/SystemLogo.theme
--------------------------------------------------------------------------------
/src/modules/network/item/applet/accesspoint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: sbw
5 | *
6 | * Maintainer: sbw
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #ifndef ACCESSPOINT_H
23 | #define ACCESSPOINT_H
24 |
25 | #include
26 | #include
27 |
28 | class AccessPoint : public QObject
29 | {
30 | Q_OBJECT
31 |
32 | public:
33 | explicit AccessPoint(const QJsonObject &apInfo);
34 | explicit AccessPoint(const QString &info);
35 | explicit AccessPoint();
36 | AccessPoint(const AccessPoint &ap);
37 | bool operator==(const AccessPoint &ap) const;
38 | bool operator>(const AccessPoint &ap) const;
39 | AccessPoint &operator=(const AccessPoint &ap);
40 |
41 | const QString ssid() const;
42 | const QString path() const;
43 | int strength() const;
44 | bool secured() const;
45 |
46 | private:
47 | void loadApInfo(const QJsonObject &apInfo);
48 |
49 | private:
50 | int m_strength;
51 | bool m_secured;
52 | bool m_securedInEap;
53 | QString m_path;
54 | QString m_ssid;
55 | };
56 |
57 | #endif // ACCESSPOINT_H
58 |
--------------------------------------------------------------------------------
/src/modules/network/item/applet/refreshaction.cpp:
--------------------------------------------------------------------------------
1 | #include "refreshaction.h"
2 |
3 | using namespace dtb;
4 | using namespace dtb::network;
5 |
6 | RefreshAction::RefreshAction(QWidget *parent)
7 | : QLabel(parent)
8 | {
9 | setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
10 | setContentsMargins(15, 0, 0, 0);
11 | setIsRefresh(false);
12 | }
13 |
14 | void RefreshAction::setIsRefresh(const bool refresh)
15 | {
16 | setText(tr("List state: %1").arg(refresh ? tr("Refreshing...") : tr("No refresh")));
17 | }
18 |
--------------------------------------------------------------------------------
/src/modules/network/item/applet/refreshaction.h:
--------------------------------------------------------------------------------
1 | #ifndef REFRESHACTION_H
2 | #define REFRESHACTION_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace network {
8 | class RefreshAction : public QLabel
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit RefreshAction(QWidget *parent = nullptr);
13 | void setIsRefresh(const bool refresh);
14 |
15 | signals:
16 | void refresh();
17 | };
18 | }
19 | }
20 |
21 | #endif // REFRESHACTION_H
22 |
--------------------------------------------------------------------------------
/src/modules/network/networkcontrolpanel.cpp:
--------------------------------------------------------------------------------
1 | #include "networkcontrolpanel.h"
2 | #include "networklistmodel.h"
3 | #include "networklistview.h"
4 |
5 | using namespace dtb;
6 | using namespace dtb::network;
7 |
8 | NetworkControlPanel::NetworkControlPanel(QWidget *parent)
9 | : QWidget(parent)
10 | , m_layout(new QVBoxLayout)
11 | , m_listView(new NetworkListView)
12 | {
13 | m_layout->setMargin(0);
14 | m_layout->setSpacing(0);
15 |
16 | m_layout->addWidget(m_listView);
17 |
18 | m_listView->setFixedSize(400, 600);
19 |
20 | setLayout(m_layout);
21 | }
22 |
23 | void NetworkControlPanel::setModel(NetworkListModel * const model)
24 | {
25 | m_listModel = model;
26 | m_listView->setModel(model);
27 |
28 | connect(m_listView, &NetworkListView::entered, model, &NetworkListModel::setHoverIndex);
29 | }
30 |
--------------------------------------------------------------------------------
/src/modules/network/networkcontrolpanel.h:
--------------------------------------------------------------------------------
1 | #ifndef NETWORKCONTROLPANEL_H
2 | #define NETWORKCONTROLPANEL_H
3 |
4 | #include
5 | #include
6 |
7 | namespace dtb {
8 | namespace network {
9 | class NetworkListView;
10 | class NetworkListModel;
11 | class NetworkControlPanel : public QWidget
12 | {
13 | Q_OBJECT
14 | public:
15 | explicit NetworkControlPanel(QWidget *parent = nullptr);
16 |
17 | void setModel(NetworkListModel * const model);
18 |
19 | signals:
20 |
21 | public slots:
22 |
23 | private:
24 | QVBoxLayout *m_layout;
25 | NetworkListView *m_listView;
26 | NetworkListModel *m_listModel;
27 | };
28 | }
29 | }
30 |
31 | #endif // NETWORKCONTROLPANEL_H
32 |
--------------------------------------------------------------------------------
/src/modules/network/networkdelegate.h:
--------------------------------------------------------------------------------
1 | #ifndef NETWORKDELEGATE_H
2 | #define NETWORKDELEGATE_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace network {
8 | class NetworkDelegate : public QAbstractItemDelegate
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit NetworkDelegate(QObject *parent = nullptr);
13 |
14 | virtual void paint(QPainter *painter,
15 | const QStyleOptionViewItem &option,
16 | const QModelIndex &index) const;
17 |
18 | virtual QSize sizeHint(const QStyleOptionViewItem &option,
19 | const QModelIndex &index) const;
20 | };
21 | }
22 | }
23 |
24 | #endif // NETWORKDELEGATE_H
25 |
--------------------------------------------------------------------------------
/src/modules/network/networklistmodel.h:
--------------------------------------------------------------------------------
1 | #ifndef NETWORKLISTMODEL_H
2 | #define NETWORKLISTMODEL_H
3 |
4 | #include "item/applet/accesspoint.h"
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace dtb {
13 | namespace network {
14 | class NetworkListModel : public QAbstractListModel
15 | {
16 | Q_OBJECT
17 | public:
18 | explicit NetworkListModel(QObject *parent = nullptr);
19 | void setDeviceList(const QMap list);
20 |
21 | enum ListRole {
22 | NameRole = Qt::DisplayRole,
23 | SizeRole = Qt::SizeHintRole,
24 | HoverRole,
25 | IconRole,
26 | SecurityRole,
27 | };
28 |
29 | void setHoverIndex(const QModelIndex &index);
30 |
31 | protected:
32 | int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
33 | QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
34 |
35 | private:
36 | void onActivateConnectChanged();
37 | void deviceStateChanged();
38 | void APAdded(const QJsonObject &obj);
39 | void APRemoved(const QJsonObject &obj);
40 | void APPropertiesChanged(const QJsonObject &apInfo);
41 | bool isSecurity(const QModelIndex &index) const;
42 | const QString icon(const QModelIndex &index) const;
43 |
44 | private:
45 | QMap m_wiredList;
46 | QMap m_wirelessList;
47 | QMap> m_apMap;
48 | dde::network::WirelessDevice *m_currentWirelessDevice;
49 | QModelIndex m_hoverIndex;
50 | };
51 | }
52 | }
53 | #endif // NETWORKLISTMODEL_H
54 |
--------------------------------------------------------------------------------
/src/modules/network/networklistview.cpp:
--------------------------------------------------------------------------------
1 | #include "networklistview.h"
2 | #include "networkdelegate.h"
3 |
4 | using namespace dtb;
5 | using namespace dtb::network;
6 |
7 | NetworkListView::NetworkListView(QWidget *parent)
8 | : QListView(parent)
9 | {
10 | setMouseTracking(true);
11 | setItemDelegate(new NetworkDelegate);
12 | }
13 |
--------------------------------------------------------------------------------
/src/modules/network/networklistview.h:
--------------------------------------------------------------------------------
1 | #ifndef NETWORKLISTVIEW_H
2 | #define NETWORKLISTVIEW_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace network {
8 | class NetworkListView : public QListView
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit NetworkListView(QWidget *parent = nullptr);
13 |
14 | signals:
15 |
16 | public slots:
17 | };
18 | }
19 | }
20 |
21 | #endif // NETWORKLISTVIEW_H
22 |
--------------------------------------------------------------------------------
/src/modules/network/networkplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef NETWORKPLUGIN_H
2 | #define NETWORKPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 |
6 | #include "networklistview.h"
7 | #include "networkcontrolpanel.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 |
15 | namespace dtb {
16 | namespace network {
17 | class NetworkListModel;
18 | class NetworkPlugin : public QObject, public PluginsItemInterface
19 | {
20 | Q_OBJECT
21 | public:
22 | NetworkPlugin();
23 |
24 | const QString pluginName() const Q_DECL_OVERRIDE;
25 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
26 |
27 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
28 | QWidget* itemPopupWindow(const QString &itemKey) Q_DECL_OVERRIDE;
29 |
30 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
31 |
32 | private slots:
33 | void refreshWiredItemVisible();
34 | void onDeviceListChanged(const QList devices);
35 |
36 | private:
37 | PluginProxyInterface *m_proxyInter;
38 | QTimer *m_delayRefreshTimer;
39 | dde::network::NetworkModel *m_networkModel;
40 | dde::network::NetworkWorker *m_networkWorker;
41 | QMap m_itemsMap;
42 | QLabel *m_networkWidget;
43 | NetworkListModel *m_listModel;
44 | NetworkControlPanel *m_controlPanel;
45 | };
46 | }
47 | }
48 |
49 | #endif // NETWORKPLUGIN_H
50 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wired/wired-connected-small.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wired/wired-disconnected-small.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/disconnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/disconnect.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/disconnect_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/disconnect_pressed.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/security.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/selected.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner01.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner02.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner03.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner04.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner05.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner06.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner07.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner08.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner09.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner10.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner11.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner12.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner13.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner14.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner15.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner16.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner17.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner18.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner19.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner20.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner21.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner22.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner23.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner24.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner25.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner26.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner27.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner28.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner29.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner30.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner31.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner32.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner33.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner34.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner35.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner36.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner37.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner38.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner39.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner40.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner41.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner42.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner43.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner44.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner45.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner46.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner47.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner48.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner49.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner50.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner51.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner52.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner53.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner54.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner55.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner56.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner57.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner58.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner59.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner60.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner61.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner61.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner62.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner62.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner63.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner63.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner64.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner65.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner65.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner66.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner66.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner67.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner67.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner68.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner68.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner69.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner69.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner70.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner71.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner72.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner73.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner73.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner74.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner74.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner75.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner75.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner76.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner77.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner77.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner78.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner78.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner79.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner79.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner80.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner81.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner81.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner82.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner82.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner83.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner83.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner84.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner84.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner85.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner85.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner86.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner86.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner87.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner88.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner88.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner89.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner89.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/spinner14/Spinner90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/network/resources/wireless/spinner14/Spinner90.png
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-0-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-0.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-2-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-2.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-4-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-4.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-6-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
28 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-6.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-8-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
30 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-8.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-disconnect-symbolic.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/src/modules/network/resources/wireless/wireless-disconnect.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/notify/images/notify_close_hover.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/modules/notify/images/notify_close_normal.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/modules/notify/images/notify_close_press.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/modules/notify/images/split_hover.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/notify/images/split_normal.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/notify/images/split_press.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/notify/notify.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | images/notify_close_hover.svg
4 | images/notify_close_normal.svg
5 | images/notify_close_press.svg
6 | images/split_press.svg
7 | images/split_hover.svg
8 | images/split_normal.svg
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/modules/notify/notifyplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "notifyplugin.h"
2 | #include "notifywidget.h"
3 |
4 | #include
5 | #include
6 |
7 | using namespace dtb;
8 | using namespace dtb::notify;
9 |
10 | DWIDGET_USE_NAMESPACE
11 |
12 | NotifyPlugin::NotifyPlugin()
13 | {
14 | m_notify = new NotifyWidget;
15 | m_notify->setFixedSize(360, 720 / qApp->devicePixelRatio());
16 | m_notifyBtn = new QLabel;
17 | m_notifyBtn->setPixmap(DHiDPIHelper::loadNxPixmap(":/images/split_press.svg"));
18 | }
19 |
20 | const QString NotifyPlugin::pluginName() const
21 | {
22 | return "Notify";
23 | }
24 |
25 | void NotifyPlugin::init(PluginProxyInterface *proxyInter)
26 | {
27 | m_proxyInter = proxyInter;
28 |
29 | m_proxyInter->addItem(this, "");
30 | }
31 |
32 | QWidget *NotifyPlugin::itemWidget(const QString &itemKey)
33 | {
34 | Q_UNUSED(itemKey);
35 |
36 | return m_notifyBtn;
37 | }
38 |
39 | QWidget *NotifyPlugin::itemPopupWindow(const QString &itemKey)
40 | {
41 | Q_UNUSED(itemKey);
42 |
43 | return m_notify;
44 | }
45 |
46 | void NotifyPlugin::setDefaultColor(PluginProxyInterface::DefaultColor color)
47 | {
48 | Q_UNUSED(color);
49 | }
50 |
--------------------------------------------------------------------------------
/src/modules/notify/notifyplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef NOTIFYPLUGIN_H
2 | #define NOTIFYPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 |
6 | #include
7 | #include
8 |
9 | class NotifyWidget;
10 |
11 | namespace dtb {
12 | namespace notify {
13 |
14 | class NotifyPlugin : public QObject, public PluginsItemInterface
15 | {
16 | Q_OBJECT
17 | public:
18 | NotifyPlugin();
19 |
20 | const QString pluginName() const Q_DECL_OVERRIDE;
21 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
22 |
23 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
24 | QWidget* itemPopupWindow(const QString &itemKey) Q_DECL_OVERRIDE;
25 |
26 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
27 |
28 | private:
29 | PluginProxyInterface *m_proxyInter;
30 | NotifyWidget *m_notify;
31 | QLabel *m_notifyBtn;
32 | };
33 | }
34 | }
35 |
36 | #endif // NOTIFYPLUGIN_H
37 |
--------------------------------------------------------------------------------
/src/modules/notify/notifyview.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: listenerri <190771752ri@gmail.com>
5 | *
6 | * Maintainer: listenerri <190771752ri@gmail.com>
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #ifndef NOTIFYVIEW_H
23 | #define NOTIFYVIEW_H
24 |
25 | #include
26 |
27 | class NotifyView : public QListView
28 | {
29 | Q_OBJECT
30 |
31 | public:
32 | NotifyView(QWidget *parent = Q_NULLPTR);
33 |
34 | const QModelIndex ¤tHoverIndex() const;
35 |
36 | Q_SIGNALS:
37 | void currentHoverChanged(const QModelIndex &previous, const QModelIndex ¤t);
38 |
39 | protected:
40 | void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
41 | void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
42 |
43 | private Q_SLOTS:
44 | void onCurrentHoverChanged(const QModelIndex &previous, const QModelIndex ¤t);
45 | void onItemEntered(const QModelIndex &index);
46 |
47 | private:
48 | QModelIndex m_indexPrevious;
49 | QModelIndex m_indexCurrent;
50 | };
51 |
52 | #endif // NOTIFYVIEW_H
53 |
--------------------------------------------------------------------------------
/src/modules/notify/notifywidget.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: listenerri <190771752ri@gmail.com>
5 | *
6 | * Maintainer: listenerri <190771752ri@gmail.com>
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #ifndef NOTIFYWIDGET_H
23 | #define NOTIFYWIDGET_H
24 |
25 | #include "notifymodel.h"
26 | #include "notifydelegate.h"
27 | #include "notifyview.h"
28 |
29 | #include
30 | #include
31 | #include
32 |
33 | DWIDGET_USE_NAMESPACE
34 |
35 | class NotifyWidget : public QWidget
36 | {
37 | Q_OBJECT
38 | public:
39 | explicit NotifyWidget(QWidget *parent = nullptr);
40 |
41 | private Q_SLOTS:
42 | void showRemoveAnim(const QModelIndex &index);
43 | void showClearAllAnim();
44 | void onNotifyClearStateChanged(bool isClear);
45 | void onRemoveBtnClicked();
46 | void onRemoveAnimFinished(const QModelIndex &index);
47 |
48 | private:
49 | DImageButton *m_clearAllButton;
50 | NotifyView *m_notifyView;
51 | NotifyModel *m_notifyModel;
52 | NotifyDelegate *m_notifyDelegate;
53 | QLabel *m_noNotify;
54 | };
55 |
56 | #endif // NOTIFYWIDGET_H
57 |
--------------------------------------------------------------------------------
/src/modules/power/power.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | Icons/battery-charging-status.svg
4 | Icons/battery.svg
5 | Icons/low-battery.svg
6 | Icons/full-battery.svg
7 | Icons/half-battery.svg
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/modules/power/powerplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "powerplugin.h"
2 | #include "powerwidgetaction.h"
3 |
4 | using namespace dtb;
5 | using namespace dtb::power;
6 |
7 | PowerPlugin::PowerPlugin(QObject *parent) : QObject(parent) {
8 | m_centralWidget = new PowerWidget;
9 | }
10 |
11 | PowerPlugin::~PowerPlugin() {
12 | m_centralWidget->deleteLater();
13 | }
14 |
15 | const QString PowerPlugin::pluginName() const {
16 | return QString("Power");
17 | }
18 |
19 | void PowerPlugin::init(PluginProxyInterface *proxyInter) {
20 | m_proxyInter = proxyInter;
21 |
22 | m_proxyInter->addItem(this, "");
23 |
24 | connect(m_centralWidget, &PowerWidget::requestHidePopupWindow, this, [=] {
25 | m_proxyInter->hidePopupWindow();
26 | });
27 | }
28 |
29 | QWidget *PowerPlugin::itemWidget(const QString &itemKey) {
30 | Q_UNUSED(itemKey);
31 |
32 | return m_centralWidget;
33 | }
34 |
35 | QMenu *PowerPlugin::itemContextMenu(const QString &itemKey)
36 | {
37 | Q_UNUSED(itemKey);
38 |
39 | return m_centralWidget->menu();
40 | }
41 |
42 | void PowerPlugin::setDefaultColor(PluginProxyInterface::DefaultColor color)
43 | {
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/modules/power/powerplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef POWERPLUGIN_H
2 | #define POWERPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "powerwidget.h"
6 | #include
7 |
8 | namespace dtb {
9 | namespace power {
10 |
11 | class PowerPlugin : public QObject, public PluginsItemInterface
12 | {
13 | Q_OBJECT
14 | public:
15 | PowerPlugin(QObject *parent = 0);
16 | ~PowerPlugin();
17 |
18 | const QString pluginName() const Q_DECL_OVERRIDE;
19 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
20 |
21 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
22 |
23 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
24 |
25 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
26 |
27 | private:
28 | PluginProxyInterface *m_proxyInter;
29 | PowerWidget *m_centralWidget;
30 | };
31 | }
32 | }
33 |
34 | #endif // POWERPLUGIN_H
35 |
--------------------------------------------------------------------------------
/src/modules/power/powerwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef POWERWIDGET_H
2 | #define POWERWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | using SystemPowerInter = com::deepin::system::Power;
13 | using PowerInter = com::deepin::daemon::Power;
14 |
15 | namespace dtb {
16 |
17 | namespace widgets {
18 | class FontLabel;
19 | }
20 |
21 | namespace power {
22 |
23 | // from https://upower.freedesktop.org/docs/Device.html#Device:State
24 | enum BatteryState
25 | {
26 | UNKNOWN = 0,
27 | CHARGING = 1,
28 | DISCHARGING = 2,
29 | EMPTY = 3,
30 | FULLY_CHARGED = 4,
31 | PENDING_CHARGE = 5,
32 | PENDING_DISCHARGE = 6
33 | };
34 |
35 | class PowerWidgetAction;
36 |
37 | class PowerWidget : public ContentModule
38 | {
39 | Q_OBJECT
40 | public:
41 | explicit PowerWidget(QWidget *parent = nullptr);
42 |
43 | inline QMenu *menu() { return m_menu;}
44 |
45 | signals:
46 | void requestHidePopupWindow();
47 | void requestEnableLastTime(const bool enabled);
48 |
49 | public slots:
50 | void updateBatteryIcon();
51 | void onActionHandle(const QString &action);
52 | void setEnableLastTime(const bool enable);
53 | void refreshTipsData();
54 |
55 | private:
56 | void initMenu();
57 |
58 | private:
59 | PowerWidgetAction *m_powerActionWidget;
60 | QLabel *m_batteryIcon;
61 | QLabel *m_battery;
62 | PowerInter* m_powerInter;
63 | SystemPowerInter *m_systemPowerInter;
64 | QMenu *m_menu;
65 | QAction *m_sourceAction;
66 | bool m_showLastTime;
67 | };
68 | }
69 | }
70 |
71 | #endif // POWERWIDGET_H
72 |
--------------------------------------------------------------------------------
/src/modules/power/powerwidgetaction.cpp:
--------------------------------------------------------------------------------
1 | #include "powerwidgetaction.h"
2 | #include "widgets/switchitem.h"
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | using namespace dtb::widgets;
14 |
15 | namespace dtb {
16 | namespace power {
17 | PowerWidgetAction::PowerWidgetAction(QWidget *parent)
18 | : QWidget(parent)
19 | {
20 | initUI();
21 | }
22 |
23 | void PowerWidgetAction::initUI()
24 | {
25 | m_mainLayout = new QVBoxLayout;
26 | m_mainLayout->setMargin(0);
27 | m_mainLayout->setSpacing(0);
28 |
29 |
30 | setLayout(m_mainLayout);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/modules/power/powerwidgetaction.h:
--------------------------------------------------------------------------------
1 | #ifndef POWERWIDGETACTION_H
2 | #define POWERWIDGETACTION_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | namespace dtb {
11 | namespace power {
12 | class PowerWidgetAction : public QWidget
13 | {
14 | Q_OBJECT
15 | public:
16 | explicit PowerWidgetAction(QWidget *parent = nullptr);
17 |
18 | private:
19 | void initUI();
20 |
21 | private:
22 | QVBoxLayout *m_mainLayout;
23 | };
24 | }
25 | }
26 |
27 | #endif // POWERWIDGETACTION_H
28 |
--------------------------------------------------------------------------------
/src/modules/search/searchbutton.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef SEARCHBUTTON_H
20 | #define SEARCHBUTTON_H
21 |
22 | #include "../../frame/item/contentmodule.h"
23 |
24 | #include
25 |
26 | namespace dtb {
27 | namespace search {
28 | class SearchButton : public ContentModule
29 | {
30 | Q_OBJECT
31 | public:
32 | explicit SearchButton(QFrame *parent = nullptr);
33 |
34 | protected:
35 | void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
36 | void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
37 |
38 | private slots:
39 | void onDirectoryChanged();
40 |
41 | private:
42 | QFileSystemWatcher *m_fileWatcher;
43 | };
44 | }
45 | }
46 |
47 | #endif // SEARCHBUTTON_H
48 |
--------------------------------------------------------------------------------
/src/modules/search/searchmodule.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "searchmodule.h"
20 | #include "../../frame/utils/global.h"
21 |
22 | using namespace dtb;
23 | using namespace dtb::search;
24 |
25 | SearchModule::SearchModule(QObject *parent)
26 | : QObject(parent)
27 | , m_btn(new SearchButton)
28 | {
29 |
30 | }
31 |
32 | const QString SearchModule::pluginName() const
33 | {
34 | return QString("Search");
35 | }
36 |
37 | void SearchModule::init(PluginProxyInterface *proxyInter)
38 | {
39 | m_proxyInter = proxyInter;
40 |
41 | m_proxyInter->addItem(this, pluginName());
42 | }
43 |
44 | QWidget *SearchModule::itemWidget(const QString &itemKey)
45 | {
46 | Q_UNUSED(itemKey);
47 |
48 | return m_btn;
49 | }
50 |
51 | void SearchModule::setDefaultColor(PluginProxyInterface::DefaultColor color)
52 | {
53 | Q_UNUSED(color);
54 | }
55 |
--------------------------------------------------------------------------------
/src/modules/search/searchmodule.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef SEARCHMODULE_H
20 | #define SEARCHMODULE_H
21 |
22 | #include "interfaces/pluginsiteminterface.h"
23 | #include "searchbutton.h"
24 |
25 | #include
26 |
27 | namespace dtb {
28 | namespace search {
29 | class SearchModule : public QObject, public PluginsItemInterface
30 | {
31 | Q_OBJECT
32 | public:
33 | explicit SearchModule(QObject *parent = nullptr);
34 |
35 | const QString pluginName() const Q_DECL_OVERRIDE;
36 |
37 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
38 |
39 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
40 |
41 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
42 |
43 | private:
44 | SearchButton *m_btn;
45 | };
46 | }
47 | }
48 | #endif // SEARCHMODULE_H
49 |
--------------------------------------------------------------------------------
/src/modules/sound/componments/horizontalseparator.cpp:
--------------------------------------------------------------------------------
1 | #include "horizontalseparator.h"
2 |
3 | #include
4 |
5 | using namespace dtb;
6 | using namespace dtb::sound;
7 |
8 | HorizontalSeparator::HorizontalSeparator(QWidget *parent)
9 | : QWidget(parent)
10 | {
11 | setFixedHeight(1);
12 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
13 | }
14 |
15 | void HorizontalSeparator::paintEvent(QPaintEvent *e)
16 | {
17 | QWidget::paintEvent(e);
18 |
19 | QPainter painter(this);
20 | painter.fillRect(rect(), QColor(255, 255, 255, 255 * 0.1));
21 | }
22 |
--------------------------------------------------------------------------------
/src/modules/sound/componments/horizontalseparator.h:
--------------------------------------------------------------------------------
1 | #ifndef HORIZONTALSEPARATOR_H
2 | #define HORIZONTALSEPARATOR_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace sound {
8 | class HorizontalSeparator : public QWidget
9 | {
10 | Q_OBJECT
11 |
12 | public:
13 | explicit HorizontalSeparator(QWidget *parent = 0);
14 |
15 | protected:
16 | void paintEvent(QPaintEvent *e);
17 | };
18 | }
19 | }
20 |
21 | #endif // HORIZONTALSEPARATOR_H
22 |
--------------------------------------------------------------------------------
/src/modules/sound/componments/mediacontrol.h:
--------------------------------------------------------------------------------
1 | #ifndef MEDIACONTROL_H
2 | #define MEDIACONTROL_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | DWIDGET_USE_NAMESPACE
9 |
10 | namespace dtb {
11 | namespace widgets {
12 | class FontLabel;
13 | }
14 |
15 | namespace sound {
16 | class MediaControl : public QFrame
17 | {
18 | Q_OBJECT
19 | public:
20 | explicit MediaControl(QWidget *parent = 0);
21 |
22 | enum PlayState {
23 | Play,
24 | Pause,
25 | Stop,
26 | Last,
27 | Previous
28 | };
29 |
30 | QWidget *createWidget(QWidget *parent);
31 |
32 | signals:
33 | void requestPrevious();
34 | void requestLast();
35 | void requestPause();
36 |
37 | public slots:
38 | void setPlayState(PlayState state);
39 |
40 | protected:
41 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
42 |
43 | private:
44 | widgets::FontLabel *m_lastBtn;
45 | widgets::FontLabel *m_previousBtn;
46 | widgets::FontLabel *m_pauseBtn;
47 | PlayState m_playState;
48 | };
49 | }
50 | }
51 |
52 | #endif // MEDIACONTROL_H
53 |
--------------------------------------------------------------------------------
/src/modules/sound/componments/volumeslider.h:
--------------------------------------------------------------------------------
1 | #ifndef VOLUMESLIDER_H
2 | #define VOLUMESLIDER_H
3 |
4 | #include
5 | #include
6 |
7 | namespace dtb {
8 | namespace sound {
9 | class VolumeSlider : public QSlider
10 | {
11 | Q_OBJECT
12 |
13 | public:
14 | explicit VolumeSlider(QWidget *parent = 0);
15 |
16 | void setValue(const int value);
17 |
18 | signals:
19 | void requestPlaySoundEffect() const;
20 |
21 | protected:
22 | void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
23 | void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
24 | void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
25 | void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
26 |
27 | private slots:
28 | void onTimeout();
29 |
30 | private:
31 | bool m_pressed;
32 | QTimer *m_timer;
33 | };
34 | }
35 | }
36 |
37 | #endif // VOLUMESLIDER_H
38 |
--------------------------------------------------------------------------------
/src/modules/sound/resources/image/slider_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/sound/resources/image/slider_bg.png
--------------------------------------------------------------------------------
/src/modules/sound/resources/image/slider_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/modules/sound/resources/image/slider_round.png
--------------------------------------------------------------------------------
/src/modules/sound/resources/sound.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | image/slider_bg.png
4 | image/slider_round.png
5 | image/full.svg
6 | image/half.svg
7 | image/low.svg
8 | image/mute.svg
9 | image/empty.svg
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/modules/sound/sinkinputwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef SINKINPUTWIDGET_H
2 | #define SINKINPUTWIDGET_H
3 |
4 | #include "dbus/dbussinkinput.h"
5 | #include "componments/volumeslider.h"
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 | namespace dtb {
13 | namespace sound {
14 | class SinkInputWidget : public QWidget
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | explicit SinkInputWidget(const QString &inputPath, QWidget *parent = 0);
20 |
21 | private slots:
22 | void setVolume(const int value);
23 | void setMute();
24 | void setMuteIcon();
25 | void onPlaySoundEffect();
26 |
27 | private:
28 | DBusSinkInput *m_inputInter;
29 |
30 | Dtk::Widget::DImageButton *m_volumeIcon;
31 | VolumeSlider *m_volumeSlider;
32 | };
33 |
34 | }
35 | }
36 |
37 | #endif // SINKINPUTWIDGET_H
38 |
--------------------------------------------------------------------------------
/src/modules/sound/soundapplet.h:
--------------------------------------------------------------------------------
1 | #ifndef SOUNDAPPLET_H
2 | #define SOUNDAPPLET_H
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | class DBusAudio;
14 | class DBusSink;
15 |
16 | namespace dtb {
17 |
18 | namespace widgets {
19 | class FontLabel;
20 | }
21 |
22 | namespace sound {
23 | class VolumeSlider;
24 | class SinkInputWidget;
25 | class SoundApplet : public QScrollArea
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | explicit SoundApplet(QWidget *parent = 0);
31 |
32 | int volumeValue() const;
33 | VolumeSlider *mainSlider();
34 |
35 | void showAni();
36 | void hideAni();
37 |
38 | signals:
39 | void volumeChanged(const int value) const;
40 | void defaultSinkChanged(DBusSink *sink) const;
41 | void requestHidePopup() const;
42 | void addNew(SinkInputWidget *w);
43 | void removeAll();
44 |
45 | private slots:
46 | void defaultSinkChanged();
47 | void onVolumeChanged();
48 | void volumeSliderValueChanged();
49 | void sinkInputsChanged();
50 | void toggleMute();
51 | void delayLoad();
52 | void onPlaySoundEffect();
53 |
54 | protected:
55 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
56 |
57 | private:
58 | QWidget *m_centralWidget;
59 | widgets::FontLabel *m_volumeBtn;
60 | VolumeSlider *m_volumeSlider;
61 | QVBoxLayout *m_centralLayout;
62 |
63 | DBusAudio *m_audioInter;
64 | DBusSink *m_defSinkInter;
65 | QGSettings *m_gsetting;
66 | QList m_inputList;
67 | };
68 | }
69 | }
70 |
71 |
72 | #endif // SOUNDAPPLET_H
73 |
--------------------------------------------------------------------------------
/src/modules/sound/soundplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "soundplugin.h"
2 |
3 | using namespace dtb;
4 | using namespace dtb::sound;
5 | using namespace dtb::widgets;
6 |
7 | SoundPlugin::SoundPlugin()
8 | {
9 | }
10 |
11 | const QString SoundPlugin::pluginName() const
12 | {
13 | return "Sound";
14 | }
15 |
16 | void SoundPlugin::init(PluginProxyInterface *proxyInter)
17 | {
18 | m_soundItem = new SoundItem;
19 |
20 | m_proxyInter = proxyInter;
21 |
22 | m_proxyInter->addItem(this, "");
23 |
24 | connect(m_soundItem, &SoundItem::requestHidePopupWindow, this, [=] {
25 | m_proxyInter->hidePopupWindow();
26 | });
27 | }
28 |
29 | QWidget *SoundPlugin::itemWidget(const QString &itemKey)
30 | {
31 | Q_UNUSED(itemKey);
32 |
33 | return m_soundItem;
34 | }
35 |
36 | QMenu *SoundPlugin::itemContextMenu(const QString &itemKey)
37 | {
38 | Q_UNUSED(itemKey);
39 |
40 | return m_soundItem->isSoundItem(QCursor::pos()) ? m_soundItem->menu() : nullptr;
41 | }
42 |
43 | void SoundPlugin::setDefaultColor(PluginProxyInterface::DefaultColor color)
44 | {
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/modules/sound/soundplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef SoundPLUGIN_H
2 | #define SoundPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "sounditem.h"
6 | #include
7 |
8 | namespace dtb {
9 | namespace sound {
10 |
11 | class SoundPlugin : public QObject, public PluginsItemInterface
12 | {
13 | Q_OBJECT
14 | public:
15 | SoundPlugin();
16 |
17 | const QString pluginName() const Q_DECL_OVERRIDE;
18 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
19 |
20 |
21 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
22 |
23 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
24 |
25 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
26 |
27 | private:
28 | PluginProxyInterface *m_proxyInter;
29 | SoundItem *m_soundItem;
30 | };
31 | }
32 | }
33 |
34 | #endif // SoundPLUGIN_H
35 |
--------------------------------------------------------------------------------
/src/modules/system-tray/abstracttraywidget.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: sbw
5 | *
6 | * Maintainer: sbw
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #include "abstracttraywidget.h"
23 |
24 | #include
25 | #include
26 |
27 | AbstractTrayWidget::AbstractTrayWidget(QWidget *parent, Qt::WindowFlags f):
28 | QWidget(parent, f)
29 | {
30 |
31 | }
32 |
33 | AbstractTrayWidget::~AbstractTrayWidget()
34 | {
35 |
36 | }
37 |
38 | void AbstractTrayWidget::mouseReleaseEvent(QMouseEvent *e)
39 | {
40 | const QPoint point(e->pos() - rect().center());
41 | if (point.manhattanLength() > 24)
42 | return;
43 |
44 | e->accept();
45 |
46 | QPoint globalPos = QCursor::pos();
47 | uint8_t buttonIndex = XCB_BUTTON_INDEX_1;
48 |
49 | switch (e->button()) {
50 | case Qt:: MiddleButton:
51 | buttonIndex = XCB_BUTTON_INDEX_2;
52 | break;
53 | case Qt::RightButton:
54 | buttonIndex = XCB_BUTTON_INDEX_3;
55 | break;
56 | default:
57 | break;
58 | }
59 |
60 | sendClick(buttonIndex, globalPos.x(), globalPos.y());
61 | }
62 |
--------------------------------------------------------------------------------
/src/modules/system-tray/abstracttraywidget.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: sbw
5 | *
6 | * Maintainer: sbw
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #pragma once
23 |
24 | #include
25 |
26 | class QDBusMessage;
27 | class AbstractTrayWidget: public QWidget
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit AbstractTrayWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
32 | virtual ~AbstractTrayWidget();
33 |
34 | virtual void setActive(const bool active) = 0;
35 | virtual void updateIcon() = 0;
36 | virtual void sendClick(uint8_t, int, int) = 0;
37 | virtual const QImage trayImage() = 0;
38 |
39 | Q_SIGNALS:
40 | void iconChanged();
41 |
42 | protected:
43 | void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
44 | };
45 |
46 |
--------------------------------------------------------------------------------
/src/modules/system-tray/dbus/com.deepin.dde.TrayManager.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/modules/system-tray/dbus/dbustraymanager.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -c DBusTrayManager -p dbustraymanager com.deepin.dde.TrayManager.xml
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies).
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "dbustraymanager.h"
13 |
14 | /*
15 | * Implementation of interface class DBusTrayManager
16 | */
17 |
18 | DBusTrayManager::DBusTrayManager(QObject *parent)
19 | : QDBusAbstractInterface("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager", staticInterfaceName(), QDBusConnection::sessionBus(), parent)
20 | {
21 | qRegisterMetaType("TrayList");
22 | qDBusRegisterMetaType();
23 |
24 | QDBusConnection::sessionBus().connect(this->service(), this->path(), "org.freedesktop.DBus.Properties", "PropertiesChanged","sa{sv}as", this, SLOT(__propertyChanged__(QDBusMessage)));
25 | }
26 |
27 | DBusTrayManager::~DBusTrayManager()
28 | {
29 | QDBusConnection::sessionBus().disconnect(service(), path(), "org.freedesktop.DBus.Properties", "PropertiesChanged", "sa{sv}as", this, SLOT(propertyChanged(QDBusMessage)));
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/src/modules/system-tray/dbus/sni/dbusstructures.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2011 Canonical Ltd.
3 | * Copyright 2014 Dmitry Shachnev
4 | *
5 | * Maintainer: listenerri
6 | *
7 | * This program is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU Lesser General Public License as published by
9 | * the Free Software Foundation, version 3 of the License.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public License
17 | * along with this program. If not, see .
18 | *
19 | * Based on sni-qt code by Aurelien Gateau .
20 | */
21 |
22 | #ifndef DBUSSTRUCTURES_H
23 | #define DBUSSTRUCTURES_H
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 |
32 | struct DBusImage
33 | {
34 | int width;
35 | int height;
36 | QByteArray pixels;
37 | };
38 | Q_DECLARE_METATYPE(DBusImage)
39 |
40 | typedef QList DBusImageList;
41 | Q_DECLARE_METATYPE(DBusImageList)
42 |
43 | struct DBusToolTip
44 | {
45 | QString iconName;
46 | DBusImageList iconPixmap;
47 | QString title;
48 | QString description;
49 | };
50 | Q_DECLARE_METATYPE(DBusToolTip)
51 |
52 | QDBusArgument &operator<<(QDBusArgument&, const DBusImage&);
53 | const QDBusArgument &operator>>(const QDBusArgument&, DBusImage&);
54 |
55 | QDBusArgument &operator<<(QDBusArgument&, const DBusToolTip&);
56 | const QDBusArgument &operator>>(const QDBusArgument&, DBusToolTip&);
57 |
58 | void registerMetaTypes();
59 |
60 | #endif /* DBUSSTRUCTURES_H */
61 |
--------------------------------------------------------------------------------
/src/modules/system-tray/dbus/sni/statusnotifieritem_interface.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp item-inter.xml -a statusnotifieritemadapter -p statusnotifieritemproxy
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "statusnotifieritem_interface.h"
13 |
14 | StatusNotifierItemInterface::StatusNotifierItemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
15 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
16 | {
17 | registerMetaTypes();
18 | }
19 |
20 | StatusNotifierItemInterface::~StatusNotifierItemInterface()
21 | {
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/modules/system-tray/sni/statusnotifierwatcher.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
3 | *
4 | * Author: listenerri
5 | *
6 | * Maintainer: listenerri
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | #include "statusnotifierwatcher.h"
23 |
24 | StatusNotifierWatcherInterface::StatusNotifierWatcherInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
25 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
26 | {
27 | }
28 |
29 | StatusNotifierWatcherInterface::~StatusNotifierWatcherInterface()
30 | {
31 | }
32 |
--------------------------------------------------------------------------------
/src/modules/system-tray/system-tray.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | resources/trayicon.svg
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/modules/system-tray/systemtrayplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMTRAYPLUGIN_H
2 | #define SYSTEMTRAYPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "tipswidget.h"
6 | #include "dbus/dbustraymanager.h"
7 | #include "xwindowtraywidget.h"
8 | #include "sni/statusnotifierwatcher.h"
9 |
10 | #include
11 | #include
12 |
13 | namespace dtb {
14 | namespace systemtray {
15 |
16 | class SystemTrayPlugin : public QObject, public PluginsItemInterface
17 | {
18 | Q_OBJECT
19 | public:
20 | explicit SystemTrayPlugin(QObject *parent = 0);
21 |
22 | const QString pluginName() const;
23 | void init(PluginProxyInterface *proxyInter);
24 |
25 | QWidget *itemWidget(const QString &itemKey);
26 |
27 | bool itemAllowContainer(const QString &itemKey);
28 | int itemSortKey(const QString &itemKey);
29 |
30 | void setDefaultColor(PluginProxyInterface::DefaultColor color);
31 |
32 | private:
33 | void updateTipsContent();
34 | const QString getWindowClass(quint32 winId);
35 |
36 | private slots:
37 | void trayListChanged();
38 | void trayAdded(const QString &itemKey);
39 | void trayRemoved(const QString &itemKey);
40 | void trayChanged(quint32 winId);
41 | // void switchToMode(const Dock::DisplayMode mode);
42 | void sniItemsChanged();
43 | void sniItemIconChanged();
44 |
45 | private:
46 | DBusTrayManager *m_trayInter;
47 | QMap m_trayList;
48 |
49 | TrayApplet *m_trayApplet;
50 | QLabel *m_tipsLabel;
51 | org::kde::StatusNotifierWatcher *m_sniWatcher;
52 | QString m_sniHostService;
53 | };
54 | }
55 | }
56 |
57 | #endif // SYSTEMTRAYPLUGIN_H
58 |
--------------------------------------------------------------------------------
/src/modules/system-tray/tipswidget.cpp:
--------------------------------------------------------------------------------
1 | #include "tipswidget.h"
2 | #include "xwindowtraywidget.h"
3 | #include
4 |
5 | TrayApplet::TrayApplet(QWidget *parent)
6 | : ContentModule(parent),
7 | m_mainLayout(new QHBoxLayout)
8 | {
9 | m_mainLayout->setMargin(0);
10 | m_mainLayout->setSpacing(0);
11 |
12 | setLayout(m_mainLayout);
13 | }
14 |
15 | void TrayApplet::clear()
16 | {
17 | QLayoutItem *item = nullptr;
18 | while ((item = m_mainLayout->takeAt(0)) != nullptr)
19 | {
20 | if (item->widget())
21 | item->widget()->setParent(nullptr);
22 | delete item;
23 | }
24 | }
25 |
26 | void TrayApplet::addWidget(AbstractTrayWidget *widget)
27 | {
28 | widget->setParent(this);
29 | widget->setVisible(true);
30 | widget->setFixedSize(TrayWidgetWidth, TrayWidgetHeight);
31 | m_mainLayout->addWidget(widget, 0, Qt::AlignCenter);
32 | }
33 |
34 | void TrayApplet::addWidgets(QList widgets)
35 | {
36 | for (AbstractTrayWidget *w : widgets)
37 | addWidget(w);
38 | }
39 |
40 | void TrayApplet::trayWidgetRemoved(AbstractTrayWidget *widget)
41 | {
42 | m_mainLayout->removeWidget(widget);
43 | }
44 |
--------------------------------------------------------------------------------
/src/modules/system-tray/tipswidget.h:
--------------------------------------------------------------------------------
1 | #ifndef TIPSWIDGET_H
2 | #define TIPSWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 |
6 | #include
7 | #include
8 |
9 | #define TrayWidgetWidth 26
10 | #define TrayWidgetHeight 26
11 |
12 | class AbstractTrayWidget;
13 | class TrayApplet : public ContentModule
14 | {
15 | Q_OBJECT
16 |
17 | public:
18 | explicit TrayApplet(QWidget *parent = 0);
19 |
20 | void clear();
21 | void addWidget(AbstractTrayWidget *widget);
22 | void addWidgets(QList widgets);
23 | void trayWidgetRemoved(AbstractTrayWidget *widget);
24 |
25 | private:
26 | QBoxLayout *m_mainLayout;
27 | };
28 |
29 | #endif // TIPSWIDGET_H
30 |
--------------------------------------------------------------------------------
/src/modules/system-tray/traypanel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "traypanel.h"
20 |
21 | TrayPanel::TrayPanel(QWidget *parent) : QWidget(parent)
22 | {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/modules/system-tray/traypanel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef TRAYPANEL_H
20 | #define TRAYPANEL_H
21 |
22 | #include
23 |
24 | class TrayPanel : public QWidget
25 | {
26 | Q_OBJECT
27 | public:
28 | explicit TrayPanel(QWidget *parent = nullptr);
29 |
30 | signals:
31 |
32 | public slots:
33 | };
34 |
35 | #endif // TRAYPANEL_H
--------------------------------------------------------------------------------
/src/modules/systeminfo/DBus/org.freedesktop.NetworkManager.ActiveConnection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/DBus/org.freedesktop.NetworkManager.Device.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/DBus/org.freedesktop.NetworkManager.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/DBus/org_freedesktop_networkmanager_device.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp-fix version 0.8
3 | * Command line was: qdbusxml2cpp-fix -c Device -p generated/org_freedesktop_networkmanager_device /home/kazushin/WorkSpace/Deepin/dde-qt-dbus-factory/xml/org.freedesktop.NetworkManager.Device.xml
4 | *
5 | * qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
6 | *
7 | * This is an auto-generated file.
8 | * This file may have been hand-edited. Look for HAND-EDIT comments
9 | * before re-generating it.
10 | */
11 |
12 | #include "org_freedesktop_networkmanager_device.h"
13 |
14 | /*
15 | * Implementation of interface class __Device
16 | */
17 |
18 | __Device::__Device(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
19 | : DBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
20 | {
21 | connect(this, &__Device::propertyChanged, this, &__Device::onPropertyChanged);
22 |
23 | }
24 |
25 | __Device::~__Device()
26 | {
27 | }
28 |
29 | void __Device::onPropertyChanged(const QString &propName, const QVariant &value)
30 | {
31 | if (propName == QStringLiteral("Interface"))
32 | {
33 | const QString Interface = qvariant_cast(value);
34 | if (m_Interface != Interface)
35 | {
36 | m_Interface = Interface;
37 | emit InterfaceChanged(m_Interface);
38 | }
39 | return;
40 | }
41 |
42 | qWarning() << "property not handle: " << propName;
43 | return;
44 | }
45 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/resources/icon_cpu_dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/resources/icon_memory_dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/resources/systeminfo.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | left_down.svg
4 | right_top.svg
5 | icon_cpu_dark.svg
6 | icon_memory_dark.svg
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfomodel.cpp:
--------------------------------------------------------------------------------
1 | #include "systeminfomodel.h"
2 |
3 | using namespace dtb;
4 | using namespace dtb::systeminfo;
5 |
6 | SystemInfoModel::SystemInfoModel(QObject *parent) : QObject(parent)
7 | {
8 |
9 | }
10 |
11 | void SystemInfoModel::setCputime(int cputime)
12 | {
13 | m_cputime = cputime;
14 |
15 | emit cputimeChanged(cputime);
16 | }
17 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfomodel.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMINFOMODEL_H
2 | #define SYSTEMINFOMODEL_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace systeminfo {
8 | class SystemInfoModel : public QObject
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit SystemInfoModel(QObject *parent = 0);
13 |
14 | int cputime() const { return m_cputime;}
15 | void setCputime(int cputime);
16 |
17 | signals:
18 | void networkSpeedChanged(const quint64 tx, const quint64 rx);
19 | void cputimeChanged(int cputime);
20 | void memChanged(int mem, int swap);
21 | private:
22 | int m_cputime;
23 | };
24 | }
25 | }
26 |
27 |
28 | #endif // SYSTEMINFOMODEL_H
29 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfoplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "systeminfoplugin.h"
2 | #include "systeminfothread.h"
3 | #include "systeminfomodel.h"
4 |
5 | #include
6 |
7 | using namespace dtb;
8 | using namespace dtb::systeminfo;
9 |
10 | SystemInfoPlugin::SystemInfoPlugin()
11 | {
12 | m_systeminfo = new SystemInfoWidget;
13 | m_systemModel = new SystemInfoModel;
14 | m_systemWorker = new SysteminfoThread(m_systemModel);
15 | m_systeminfo->setModel(m_systemModel);
16 | }
17 |
18 | const QString SystemInfoPlugin::pluginName() const
19 | {
20 | return "SystemInfo";
21 | }
22 |
23 | void SystemInfoPlugin::init(PluginProxyInterface *proxyInter)
24 | {
25 | m_proxyInter = proxyInter;
26 |
27 | QDBusInterface dbusInter("org.freedesktop.NetworkManager",
28 | "/org/freedesktop/NetworkManager",
29 | "org.freedesktop.NetworkManager",
30 | QDBusConnection::systemBus(), this);
31 |
32 | if (dbusInter.isValid()) {
33 | m_proxyInter->addItem(this, "");
34 | m_systemWorker->start();
35 | }
36 | }
37 |
38 | QWidget *SystemInfoPlugin::itemWidget(const QString &itemKey)
39 | {
40 | Q_UNUSED(itemKey);
41 |
42 | return m_systeminfo;
43 | }
44 |
45 | void SystemInfoPlugin::setDefaultColor(PluginProxyInterface::DefaultColor color)
46 | {
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfoplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMINFOPLUGIN_H
2 | #define SYSTEMINFOPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "systeminfopopupwidget.h"
6 | #include "systeminfowidget.h"
7 | #include
8 |
9 | namespace dtb {
10 | namespace systeminfo {
11 | class SystemInfoModel;
12 | class SysteminfoThread;
13 | class SystemInfoPlugin : public QObject, public PluginsItemInterface
14 | {
15 | Q_OBJECT
16 | public:
17 | SystemInfoPlugin();
18 |
19 | const QString pluginName() const Q_DECL_OVERRIDE;
20 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
21 |
22 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
23 |
24 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
25 |
26 | private:
27 | PluginProxyInterface *m_proxyInter;
28 | SystemInfoPopupWidget *m_popupWidget;
29 | SystemInfoWidget *m_systeminfo;
30 | SystemInfoModel *m_systemModel;
31 | SysteminfoThread *m_systemWorker;
32 | };
33 | }
34 | }
35 |
36 | #endif // SYSTEMINFOPLUGIN_H
37 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfopopupwidget.cpp:
--------------------------------------------------------------------------------
1 | #include "systeminfopopupwidget.h"
2 | #include
3 |
4 | SystemInfoPopupWidget::SystemInfoPopupWidget(QWidget *parent) : QWidget(parent)
5 | {
6 | resize(300, 100);
7 |
8 | QVBoxLayout *layout = new QVBoxLayout;
9 |
10 | setLayout(layout);
11 |
12 | m_showAni = new QPropertyAnimation(this, "size", this);
13 | m_showAni->setDuration(300);
14 | m_showAni->setStartValue(QSize(width(), 30));
15 | m_showAni->setEndValue(size());
16 | m_showAni->setEasingCurve(QEasingCurve::InOutCubic);
17 |
18 | m_hideAni = new QPropertyAnimation(this, "size", this);
19 | m_hideAni->setDuration(300);
20 | m_hideAni->setStartValue(size());
21 | m_hideAni->setEndValue(QSize(width(), 30));
22 | m_hideAni->setEasingCurve(QEasingCurve::InOutCubic);
23 |
24 | connect(m_hideAni, &QPropertyAnimation::finished, this, &SystemInfoPopupWidget::requestHidePopup);
25 |
26 |
27 | //load SystemInfo
28 | }
29 |
30 | void SystemInfoPopupWidget::showAni()
31 | {
32 | m_showAni->start();
33 | }
34 |
35 | void SystemInfoPopupWidget::hideAni()
36 | {
37 | m_hideAni->start();
38 | }
39 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfopopupwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMINFOPOPUPWIDGET_H
2 | #define SYSTEMINFOPOPUPWIDGET_H
3 |
4 | #include
5 | #include
6 |
7 | class SystemInfoPopupWidget : public QWidget
8 | {
9 | Q_OBJECT
10 | public:
11 | explicit SystemInfoPopupWidget(QWidget *parent = 0);
12 |
13 | signals:
14 | void requestHidePopup() const;
15 |
16 | public slots:
17 | void showAni();
18 | void hideAni();
19 |
20 | private:
21 | QPropertyAnimation *m_showAni;
22 | QPropertyAnimation *m_hideAni;
23 | };
24 |
25 | #endif // SYSTEMINFOPOPUPWIDGET_H
26 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfothread.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMINFOTHREAD_H
2 | #define SYSTEMINFOTHREAD_H
3 |
4 | #include "systeminfomodel.h"
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | namespace dtb {
11 | namespace systeminfo {
12 | class SysteminfoThread : public QThread
13 | {
14 | Q_OBJECT
15 | public:
16 | explicit SysteminfoThread(SystemInfoModel *model, QObject *parent = 0);
17 |
18 | protected:
19 | void run() Q_DECL_OVERRIDE;
20 |
21 | private slots:
22 | void onNetworkPropertyChanged(QVariantMap m);
23 | void onConnectChanged(const QDBusObjectPath &path);
24 | void onActiveChanged(const QVariant &value);
25 | void onGetDeviceName(const QVariant &device);
26 |
27 | private:
28 | void getCpuTime(unsigned long long &workTime, unsigned long long &totalTime);
29 |
30 | private:
31 | SystemInfoModel *m_model;
32 | QFile *m_rx;
33 | QFile *m_tx;
34 | quint64 old_tx;
35 | quint64 old_rx;
36 | QFile *m_statFile;
37 | };
38 | }
39 | }
40 |
41 | #endif // SYSTEMINFOTHREAD_H
42 |
--------------------------------------------------------------------------------
/src/modules/systeminfo/systeminfowidget.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSTEMINFOWIDGET_H
2 | #define SYSTEMINFOWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 |
6 | #include
7 | #include
8 |
9 | namespace dtb {
10 | namespace systeminfo {
11 | class SystemInfoModel;
12 | class SystemInfoWidget : public ContentModule
13 | {
14 | Q_OBJECT
15 | public:
16 | explicit SystemInfoWidget(QWidget *parent = 0);
17 |
18 | void setModel(SystemInfoModel *model);
19 |
20 | private:
21 | const QString converSpeed(const int value);
22 | const QString formatPercent(int percent);
23 | private:
24 | SystemInfoModel *m_model;
25 | QLabel *m_rx;
26 | QLabel *m_tx;
27 | QLabel *m_cpu;
28 | QLabel *m_mem;
29 | QLabel *m_swap;
30 | };
31 | }
32 | }
33 |
34 | #endif // SYSTEMINFOWIDGET_H
35 |
--------------------------------------------------------------------------------
/src/modules/timewidget/datetimeplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef TIMEWIDGET_H
2 | #define TIMEWIDGET_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "datetimewidget.h"
6 |
7 | #include
8 |
9 | namespace dtb {
10 | namespace widgets {
11 | class SwitchItem;
12 | }
13 | namespace datetime {
14 |
15 | class DateTimePlugin : public QObject, public PluginsItemInterface
16 | {
17 | Q_OBJECT
18 | public:
19 | DateTimePlugin(QWidget *parent = 0);
20 | ~DateTimePlugin();
21 |
22 | struct MenuModel {
23 | bool is24;
24 | QString format;
25 |
26 | void setModel(const QJsonObject &obj) {
27 | is24 = obj["Is24"].toBool();
28 | format = obj["Format"].toString();
29 | }
30 |
31 | const QJsonObject value() {
32 | QJsonObject obj;
33 |
34 | obj["Is24"] = is24;
35 | obj["Format"] = format;
36 |
37 | return obj;
38 | }
39 | };
40 |
41 | const QString pluginName() const override;
42 | void init(PluginProxyInterface *proxyInter) override;
43 |
44 | QWidget *itemWidget(const QString &itemKey) override;
45 |
46 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
47 |
48 | void setDefaultColor(PluginProxyInterface::DefaultColor color) Q_DECL_OVERRIDE;
49 |
50 | private slots:
51 | void saveConfig();
52 | void invokedMenuItem(QAction *);
53 |
54 | private:
55 | PluginProxyInterface *m_proxyInter;
56 | Plugin::DateTime::DateTimeWidget *m_centralWidget;
57 | MenuModel m_settings;
58 | QMenu *m_menu;
59 | widgets::SwitchItem *m_switchItem;
60 | };
61 | }
62 | }
63 |
64 | #endif // TIMEWIDGET_H
65 |
--------------------------------------------------------------------------------
/src/modules/timewidget/datetimewidget.cpp:
--------------------------------------------------------------------------------
1 | #include "datetimewidget.h"
2 | #include
3 | #include
4 | #include
5 |
6 | namespace Plugin {
7 | namespace DateTime {
8 | DateTimeWidget::DateTimeWidget(QWidget *parent)
9 | : ContentModule(parent)
10 | {
11 | setStyleSheet("QLabel {color: #d3d3d3; font-size: 11pt;}");
12 |
13 | m_dateTime = new QDateTime;
14 | QTimer *timer = new QTimer(this);
15 | timer->setInterval(1000);
16 | connect(timer, &QTimer::timeout, this, &DateTimeWidget::updateTime);
17 | timer->start();
18 |
19 | m_timeLbl = new QLabel;
20 | m_timeLbl->setAlignment(Qt::AlignVCenter);
21 |
22 | QHBoxLayout *layout = new QHBoxLayout;
23 |
24 | layout->setMargin(0);
25 | layout->setSpacing(0);
26 | layout->setContentsMargins(10, 0, 10, 0);
27 |
28 | layout->addWidget(m_timeLbl, 0, Qt::AlignCenter);
29 |
30 | setLayout(layout);
31 |
32 | m_format = "yyyy-MM-dd hh:mm";
33 | }
34 |
35 | DateTimeWidget::~DateTimeWidget() {
36 | delete m_dateTime;
37 | }
38 |
39 | void DateTimeWidget::updateTime() {
40 | m_timeLbl->setText(m_dateTime->currentDateTime().toString(m_format + (m_24HourFormat ? "" : " A")));
41 | }
42 |
43 | void DateTimeWidget::set24HourFormat(bool is24HourFormat)
44 | {
45 | if (m_24HourFormat == is24HourFormat)
46 | return;
47 |
48 | m_24HourFormat = is24HourFormat;
49 |
50 | updateTime();
51 | }
52 |
53 | void DateTimeWidget::setFormat(const QString &value)
54 | {
55 | if (!value.isEmpty())
56 | m_format = value;
57 |
58 | updateTime();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/modules/timewidget/datetimewidget.h:
--------------------------------------------------------------------------------
1 | #ifndef DATETIMEWIDGET_H
2 | #define DATETIMEWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | namespace Plugin {
11 | namespace DateTime {
12 | class DateTimeWidget : public ContentModule
13 | {
14 | Q_OBJECT
15 | public:
16 | explicit DateTimeWidget(QWidget *parent = 0);
17 | ~DateTimeWidget();
18 |
19 | public slots:
20 | void set24HourFormat(bool is24HourFormat);
21 | void setFormat(const QString &value);
22 |
23 | private slots:
24 | void updateTime();
25 |
26 | private:
27 | QDateTime *m_dateTime;
28 | bool m_24HourFormat;
29 | QString m_format;
30 | QLabel *m_timeLbl;
31 | };
32 | }
33 | }
34 |
35 | #endif // DATETIMEWIDGET_H
36 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpapermodel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "wallpapermodel.h"
20 |
21 | using namespace dtb;
22 | using namespace dtb::wallpaper;
23 |
24 | WallpaperModel::WallpaperModel(QObject *parent) : QObject(parent)
25 | {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpapermodel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef WALLPAPERMODEL_H
20 | #define WALLPAPERMODEL_H
21 |
22 | #include
23 |
24 | namespace dtb {
25 | namespace wallpaper {
26 | class WallpaperModel : public QObject
27 | {
28 | Q_OBJECT
29 | public:
30 | explicit WallpaperModel(QObject *parent = nullptr);
31 |
32 | signals:
33 |
34 | public slots:
35 | };
36 | }
37 | }
38 |
39 | #endif // WALLPAPERMODEL_H
40 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpaperplugin.cpp:
--------------------------------------------------------------------------------
1 | #include "wallpaperplugin.h"
2 | #include "wallpaperworker.h"
3 | #include "wallpapermodel.h"
4 |
5 | using namespace dtb;
6 | using namespace dtb::wallpaper;
7 |
8 | WallpaperPlugin::WallpaperPlugin(QObject *parent)
9 | : QObject(parent)
10 | , m_proxyInter(nullptr)
11 | , m_wallpaper(new WallpaperWidget)
12 | , m_model(new WallpaperModel)
13 | , m_worker(new WallpaperWorker(m_model))
14 | {
15 | }
16 |
17 | const QString WallpaperPlugin::pluginName() const
18 | {
19 | return "wallpaper";
20 | }
21 |
22 | void WallpaperPlugin::init(PluginProxyInterface *proxyInter)
23 | {
24 | m_proxyInter = proxyInter;
25 |
26 | m_wallpaper->setModel(m_model);
27 |
28 | m_model->moveToThread(qApp->thread());
29 | m_worker->moveToThread(qApp->thread());
30 |
31 | connect(m_wallpaper, &WallpaperWidget::requestSetWallpapers, m_worker, &WallpaperWorker::setWallpaperList);
32 |
33 | m_proxyInter->addItem(this, "");
34 | }
35 |
36 | QWidget *WallpaperPlugin::itemWidget(const QString &itemKey)
37 | {
38 | Q_UNUSED(itemKey);
39 |
40 | return m_wallpaper;
41 | }
42 |
43 | QMenu *WallpaperPlugin::itemContextMenu(const QString &itemKey)
44 | {
45 | Q_UNUSED(itemKey);
46 |
47 | return m_wallpaper->menu();
48 | }
49 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpaperplugin.h:
--------------------------------------------------------------------------------
1 | #ifndef WallpaperPLUGIN_H
2 | #define WallpaperPLUGIN_H
3 |
4 | #include "interfaces/pluginsiteminterface.h"
5 | #include "wallpaperwidget.h"
6 | #include
7 |
8 | namespace dtb {
9 | namespace wallpaper {
10 |
11 | class WallpaperWorker;
12 | class WallpaperModel;
13 |
14 | class WallpaperPlugin : public QObject, public PluginsItemInterface
15 | {
16 | Q_OBJECT
17 | public:
18 | WallpaperPlugin(QObject *parent = nullptr);
19 |
20 | const QString pluginName() const Q_DECL_OVERRIDE;
21 | void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE;
22 |
23 | QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE;
24 |
25 | QMenu* itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE;
26 |
27 | private:
28 | PluginProxyInterface *m_proxyInter;
29 | WallpaperWidget *m_wallpaper;
30 | WallpaperModel *m_model;
31 | WallpaperWorker *m_worker;
32 | };
33 | }
34 | }
35 |
36 | #endif // WallpaperPLUGIN_H
37 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpapersettings.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef WALLPAPERSETTINGS_H
20 | #define WALLPAPERSETTINGS_H
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | namespace dtb {
27 | namespace wallpaper {
28 | class WallpaperSettings : public QWidget
29 | {
30 | Q_OBJECT
31 | public:
32 | explicit WallpaperSettings(QWidget *parent = nullptr);
33 |
34 | signals:
35 | void requestFinished(const QJsonObject &value);
36 |
37 | private:
38 | void addOne();
39 | void removeOne();
40 | void clean();
41 | void finished();
42 |
43 | private:
44 | QVBoxLayout *m_layout;
45 | QListWidget *m_listView;
46 | QStringList m_list;
47 | };
48 | }
49 | }
50 |
51 | #endif // WALLPAPERSETTINGS_H
52 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpaperwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef WallpaperWIDGET_H
2 | #define WallpaperWIDGET_H
3 |
4 | #include "frame/item/contentmodule.h"
5 | #include "wallpapersettings.h"
6 | #include
7 | #include
8 | #include
9 |
10 | DWIDGET_USE_NAMESPACE
11 |
12 | namespace dtb {
13 | namespace wallpaper {
14 | class WallpaperModel;
15 | class WallpaperWidget : public ContentModule
16 | {
17 | Q_OBJECT
18 | public:
19 | explicit WallpaperWidget(QWidget *parent = 0);
20 | void setModel(WallpaperModel *model);
21 |
22 | enum HandleAction{
23 | Next,
24 | Abount,
25 | Brow,
26 | Preferences
27 | };
28 |
29 | QMenu *menu() const;
30 |
31 | signals:
32 | void requestSetWallpapers(const QJsonObject &value);
33 |
34 | private:
35 | void handleAction(const int &action);
36 |
37 | private:
38 | void initUI();
39 | void initMenu();
40 | void initConnect();
41 |
42 | private:
43 | QMenu *m_menu;
44 | DAboutDialog *m_about;
45 | WallpaperModel *m_model;
46 | WallpaperSettings *m_settings;
47 | };
48 | }
49 | }
50 |
51 | #endif // WallpaperWIDGET_H
52 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpaperworker.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "wallpaperworker.h"
20 | #include "wallpapermodel.h"
21 |
22 | #include
23 |
24 | using namespace dtb;
25 | using namespace dtb::wallpaper;
26 |
27 | WallpaperWorker::WallpaperWorker(WallpaperModel *model, QObject *parent)
28 | : QObject(parent)
29 | , m_model(model)
30 | , m_wallpaperInter(new Wallpaper("com.deepin.dde.Wallpaper", "/com/deepin/dde/Wallpaper", QDBusConnection::sessionBus(), this))
31 | {
32 | m_wallpaperInter->setSync(false);
33 | }
34 |
35 | void WallpaperWorker::setWallpaperList(const QJsonObject &value)
36 | {
37 | QJsonArray array = value["Folder"].toArray();
38 | QStringList list;
39 |
40 | for (const QJsonValue &v : array)
41 | list << v.toString();
42 |
43 | m_wallpaperInter->setFolder(list, false);
44 | m_wallpaperInter->setInterval(value["Interval"].toInt());
45 | m_wallpaperInter->play();
46 | }
47 |
--------------------------------------------------------------------------------
/src/modules/wallpaper/wallpaperworker.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef WALLPAPERWORKER_H
20 | #define WALLPAPERWORKER_H
21 |
22 | #include "com_deepin_dde_wallpaper.h"
23 | #include
24 |
25 | using Wallpaper = com::deepin::dde::Wallpaper;
26 |
27 | namespace dtb {
28 | namespace wallpaper {
29 | class WallpaperModel;
30 | class WallpaperWorker : public QObject
31 | {
32 | Q_OBJECT
33 | public:
34 | explicit WallpaperWorker(WallpaperModel *model, QObject *parent = nullptr);
35 |
36 | public slots:
37 | void setWallpaperList(const QJsonObject &value);
38 |
39 | private:
40 | WallpaperModel *m_model;
41 | Wallpaper *m_wallpaperInter;
42 | };
43 | }
44 | }
45 |
46 | #endif // WALLPAPERWORKER_H
47 |
--------------------------------------------------------------------------------
/src/widgets/dactionbutton.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef DACTIONBUTTON_H
20 | #define DACTIONBUTTON_H
21 |
22 | #include
23 | #include
24 |
25 | namespace dtb {
26 | namespace widgets {
27 | class DActionButton : public QWidget
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit DActionButton(QWidget *parent = nullptr);
32 | void setContent(QWidget *widget);
33 |
34 | protected:
35 | bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
36 |
37 | private:
38 | QHBoxLayout *m_layout;
39 | bool m_isEnter;
40 | };
41 |
42 | }
43 | }
44 |
45 |
46 | #endif // DACTIONBUTTON_H
47 |
--------------------------------------------------------------------------------
/src/widgets/dactionlabel.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "widgets/dactionlabel.h"
20 |
21 | using namespace dtb;
22 | using namespace dtb::widgets;
23 |
24 | DActionLabel::DActionLabel(QWidget *parent)
25 | : QWidgetAction(parent)
26 | {
27 | m_widget = new DActionButton;
28 |
29 | m_widget->setContent(parent);
30 | }
31 |
32 | QWidget *DActionLabel::createWidget(QWidget *parent)
33 | {
34 | m_widget->setParent(parent);
35 |
36 | return m_widget;
37 | }
38 |
--------------------------------------------------------------------------------
/src/widgets/dactionlabel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef DACTIONLABEL_H
20 | #define DACTIONLABEL_H
21 |
22 | #include "dactionbutton.h"
23 |
24 | #include
25 |
26 | namespace dtb {
27 | namespace widgets {
28 | class DActionLabel : public QWidgetAction
29 | {
30 | Q_OBJECT
31 | public:
32 | explicit DActionLabel(QWidget *parent = nullptr);
33 |
34 | QWidget *createWidget(QWidget *parent) Q_DECL_OVERRIDE;
35 |
36 | private:
37 | DActionButton *m_widget;
38 | };
39 | }
40 | }
41 |
42 | #endif // DACTIONLABEL_H
43 |
--------------------------------------------------------------------------------
/src/widgets/dwidgetaction.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #include "dwidgetaction.h"
20 | #include
21 | #include
22 |
23 | using namespace dtb;
24 | using namespace dtb::widgets;
25 |
26 | DWidgetAction::DWidgetAction(QWidget *parent)
27 | : QWidgetAction(parent)
28 | , m_widget(parent)
29 | {
30 | }
31 |
32 | QWidget *DWidgetAction::createWidget(QWidget *parent)
33 | {
34 | m_widget->setParent(parent);
35 |
36 | return m_widget;
37 | }
38 |
--------------------------------------------------------------------------------
/src/widgets/dwidgetaction.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 | *
4 | * Author: kirigaya
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef DWIDGETACTION_H
20 | #define DWIDGETACTION_H
21 |
22 | #include
23 | #include
24 |
25 | namespace dtb {
26 | namespace widgets {
27 | class DWidgetAction : public QWidgetAction
28 | {
29 | Q_OBJECT
30 | public:
31 | explicit DWidgetAction(QWidget *parent = nullptr);
32 |
33 | QWidget *createWidget(QWidget *parent) Q_DECL_OVERRIDE;
34 |
35 | private:
36 | QWidget *m_widget;
37 | };
38 | }
39 | }
40 |
41 | #endif // DWIDGETACTION_H
42 |
--------------------------------------------------------------------------------
/src/widgets/fontlabel.cpp:
--------------------------------------------------------------------------------
1 | #include "widgets/fontlabel.h"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | using namespace dtb::widgets;
8 |
9 | FontLabel::FontLabel(QWidget *parent) : QLabel(parent)
10 | {
11 | setAttribute(Qt::WA_TranslucentBackground);
12 | setObjectName("FontLabel");
13 |
14 | int fontId = QFontDatabase::addApplicationFont(":/segoe-mdl2-assets.ttf");
15 | QString fontName=QFontDatabase::applicationFontFamilies(fontId).at(0);
16 |
17 | m_iconFont = QFont(fontName);
18 | }
19 |
20 | void FontLabel::setIcon(const QChar c, int size)
21 | {
22 | m_iconFont.setPointSize(size);
23 | setFont(m_iconFont);
24 | setText(c);
25 | }
26 |
27 | void FontLabel::mouseReleaseEvent(QMouseEvent *event)
28 | {
29 | QLabel::mouseReleaseEvent(event);
30 |
31 | emit clicked();
32 | }
33 |
--------------------------------------------------------------------------------
/src/widgets/fontlabel.h:
--------------------------------------------------------------------------------
1 | #ifndef FONTLABEL_H
2 | #define FONTLABEL_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace widgets {
8 | class FontLabel : public QLabel
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit FontLabel(QWidget *parent = 0);
13 | void setIcon(const QChar c, int size);
14 |
15 | signals:
16 | void clicked();
17 |
18 | protected:
19 | void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
20 |
21 | private:
22 | QFont m_iconFont;
23 | };
24 | }
25 | }
26 |
27 | #endif // FONTLABEL_H
28 |
--------------------------------------------------------------------------------
/src/widgets/itempopupwindow.cpp:
--------------------------------------------------------------------------------
1 | #include "itempopupwindow.h"
2 |
3 | ItemPopupWindow::ItemPopupWindow(QWidget *parent)
4 | : DArrowRectangle(DArrowRectangle::ArrowTop, parent)
5 | , m_regionMonitor(new DRegionMonitor(this))
6 | {
7 | connect(m_regionMonitor, &DRegionMonitor::buttonRelease, this, [=] (const QPoint &p, const int flag){
8 | if (flag == 1 && !geometry().contains(p)) {
9 | hide();
10 | m_regionMonitor->unregisterRegion();
11 | }
12 | }, Qt::QueuedConnection);
13 | }
14 |
15 | void ItemPopupWindow::show(int x, int y)
16 | {
17 | DArrowRectangle::show(x, y);
18 | QTimer::singleShot(0, this, [=] {
19 | m_regionMonitor->registerRegion();
20 | });
21 | }
22 |
23 | void ItemPopupWindow::hideEvent(QHideEvent *event)
24 | {
25 | DArrowRectangle::hideEvent(event);
26 | if (m_regionMonitor->registered()) {
27 | m_regionMonitor->unregisterRegion();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/widgets/itempopupwindow.h:
--------------------------------------------------------------------------------
1 | #ifndef ITEMPOPUPWINDOW_H
2 | #define ITEMPOPUPWINDOW_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | DWIDGET_USE_NAMESPACE
9 | DGUI_USE_NAMESPACE
10 |
11 | class ItemPopupWindow : public DArrowRectangle
12 | {
13 | Q_OBJECT
14 | public:
15 | explicit ItemPopupWindow(QWidget *parent = nullptr);
16 |
17 | void show(int x, int y) override;
18 |
19 | protected:
20 | void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
21 |
22 | private:
23 | DRegionMonitor *m_regionMonitor;
24 | };
25 |
26 | #endif // ITEMPOPUPWINDOW_H
27 |
--------------------------------------------------------------------------------
/src/widgets/segoe-mdl2-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justforlxz/deepin-topbar/fb770ae9be94427551874e15abd46ab0fdb3a238/src/widgets/segoe-mdl2-assets.ttf
--------------------------------------------------------------------------------
/src/widgets/switchbutton.cpp:
--------------------------------------------------------------------------------
1 | #include "switchbutton.h"
2 |
3 | using namespace dtb;
4 | using namespace dtb::widgets;
5 |
6 | SwitchButton::SwitchButton(QWidget *parent) : QWidget(parent)
7 | {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/widgets/switchbutton.h:
--------------------------------------------------------------------------------
1 | #ifndef SWITCHBUTTON_H
2 | #define SWITCHBUTTON_H
3 |
4 | #include
5 |
6 | namespace dtb {
7 | namespace widgets {
8 | class SwitchButton : public QWidget
9 | {
10 | Q_OBJECT
11 | public:
12 | explicit SwitchButton(QWidget *parent = nullptr);
13 |
14 | signals:
15 | void stateChanged(bool state) const;
16 |
17 | public slots:
18 | };
19 | }
20 | }
21 |
22 | #endif // SWITCHBUTTON_H
23 |
--------------------------------------------------------------------------------
/src/widgets/switchitem.cpp:
--------------------------------------------------------------------------------
1 | #include "switchitem.h"
2 | #include
3 |
4 | namespace dtb {
5 | namespace widgets {
6 | SwitchItem::SwitchItem(QWidget *parent) : QWidget(parent) {
7 | setAttribute(Qt::WA_TranslucentBackground);
8 | setFixedHeight(30);
9 | m_text = new QLabel;
10 | m_switch = new DSwitchButton;
11 |
12 | QHBoxLayout *layout = new QHBoxLayout;
13 | layout->setMargin(0);
14 | layout->setSpacing(0);
15 | layout->setContentsMargins(10, 0, 10, 0);
16 |
17 | layout->addWidget(m_text);
18 | layout->addStretch();
19 | layout->addSpacing(10);
20 | layout->addWidget(m_switch);
21 |
22 | setLayout(layout);
23 |
24 | connect(m_switch, &DSwitchButton::checkedChanged, this, &SwitchItem::clicked);
25 | }
26 |
27 | void SwitchItem::setText(const QString &text) {
28 | m_text->setText(text);
29 | }
30 |
31 | void SwitchItem::setCheck(const bool state) {
32 | m_switch->blockSignals(true);
33 | m_switch->setChecked(state);
34 | m_switch->blockSignals(false);
35 | }
36 |
37 | void SwitchItem::setValue(const QString &value) {
38 | m_value = value;
39 | }
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/widgets/switchitem.h:
--------------------------------------------------------------------------------
1 | #ifndef SWITCHITEM_H
2 | #define SWITCHITEM_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | DWIDGET_USE_NAMESPACE
9 |
10 | namespace dtb {
11 | namespace widgets {
12 | class SwitchItem : public QWidget {
13 | Q_OBJECT
14 | public:
15 | explicit SwitchItem(QWidget *parent = 0);
16 |
17 | const QString text() const { return m_text->text(); }
18 | bool checked() const { return m_switch->isChecked(); }
19 | const QString value() const {return m_value; }
20 |
21 | signals:
22 | void clicked(const bool state);
23 |
24 | public slots:
25 | void setText(const QString &text);
26 | void setCheck(const bool state);
27 | void setValue(const QString &value);
28 |
29 | private:
30 | QLabel *m_text;
31 | DSwitchButton *m_switch;
32 | QString m_value;
33 | };
34 | }
35 | }
36 |
37 | #endif // SWITCHITEM_H
38 |
--------------------------------------------------------------------------------
/src/widgets/widgets.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | segoe-mdl2-assets.ttf
4 |
5 |
6 |
--------------------------------------------------------------------------------
/translate_generation.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # this file is used to auto-generate .qm file from .ts file.
3 | # author: shibowen at linuxdeepin.com
4 |
5 | ts_list=(`ls translations/*.ts`)
6 |
7 | for ts in "${ts_list[@]}"
8 | do
9 | printf "\nprocess ${ts}\n"
10 | lrelease "${ts}"
11 | done
12 |
--------------------------------------------------------------------------------