Use ForkAwesome consistently in Plasmoid as well
This commit is contained in:
parent
7b6121cb05
commit
0651323da4
|
@ -48,6 +48,7 @@ else()
|
||||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}" OR IS_DIRECTORY "${BUNDLED_QT_FORK_AWESOME_PATH}")
|
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}" OR IS_DIRECTORY "${BUNDLED_QT_FORK_AWESOME_PATH}")
|
||||||
add_subdirectory("${BUNDLED_QT_FORK_AWESOME_PATH}" qtforkawesome)
|
add_subdirectory("${BUNDLED_QT_FORK_AWESOME_PATH}" qtforkawesome)
|
||||||
set(${NAMESPACE_PREFIX}qtforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtforkawesome")
|
set(${NAMESPACE_PREFIX}qtforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtforkawesome")
|
||||||
|
set(${NAMESPACE_PREFIX}qtquickforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtquickforkawesome")
|
||||||
set(${NAMESPACE_PREFIX}qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/iconengineplugin")
|
set(${NAMESPACE_PREFIX}qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/iconengineplugin")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Specified directory for qtforkawesome sources \"${BUNDLED_QT_FORK_AWESOME_PATH}\" does not exist.")
|
message(FATAL_ERROR "Specified directory for qtforkawesome sources \"${BUNDLED_QT_FORK_AWESOME_PATH}\" does not exist.")
|
||||||
|
|
|
@ -22,6 +22,7 @@ set(PLASMOID_FILES
|
||||||
package/contents/ui/DetailItem.qml
|
package/contents/ui/DetailItem.qml
|
||||||
package/contents/ui/ToolTipTrigger.qml
|
package/contents/ui/ToolTipTrigger.qml
|
||||||
package/contents/ui/ToolTipView.qml
|
package/contents/ui/ToolTipView.qml
|
||||||
|
package/contents/ui/ToolButton.qml
|
||||||
package/contents/ui/TinyButton.qml
|
package/contents/ui/TinyButton.qml
|
||||||
package/contents/ui/IconLabel.qml
|
package/contents/ui/IconLabel.qml
|
||||||
package/contents/ui/StatisticsView.qml
|
package/contents/ui/StatisticsView.qml
|
||||||
|
|
|
@ -11,6 +11,10 @@ set(TS_FILES ../translations/${META_PROJECT_NAME}_de_DE.ts ../translations/${MET
|
||||||
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.2.0 REQUIRED)
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.2.0 REQUIRED)
|
||||||
use_qt_utilities()
|
use_qt_utilities()
|
||||||
|
|
||||||
|
# find qtforkawesomequickimageprovider
|
||||||
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtquickforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME} 0.0.1 REQUIRED)
|
||||||
|
use_qt_quick_fork_awesome()
|
||||||
|
|
||||||
# check whether qtutilities supports DBus notifications
|
# check whether qtutilities supports DBus notifications
|
||||||
get_target_property(QT_UTILITIES_COMPILE_DEFINITIONS ${QT_UTILITIES_LIB} INTERFACE_COMPILE_DEFINITIONS)
|
get_target_property(QT_UTILITIES_COMPILE_DEFINITIONS ${QT_UTILITIES_LIB} INTERFACE_COMPILE_DEFINITIONS)
|
||||||
list(FIND QT_UTILITIES_COMPILE_DEFINITIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS)
|
list(FIND QT_UTILITIES_COMPILE_DEFINITIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS)
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "resources/qtconfig.h"
|
#include "resources/qtconfig.h"
|
||||||
|
|
||||||
#include <qtforkawesome/utils.h>
|
#include <qtforkawesome/utils.h>
|
||||||
|
#include <qtquickforkawesome/imageprovider.h>
|
||||||
|
|
||||||
#include <qtutilities/misc/desktoputils.h>
|
#include <qtutilities/misc/desktoputils.h>
|
||||||
#include <qtutilities/misc/dialogutils.h>
|
#include <qtutilities/misc/dialogutils.h>
|
||||||
|
@ -39,8 +40,6 @@
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Data;
|
using namespace Data;
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
@ -135,6 +134,15 @@ void SyncthingApplet::init()
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SyncthingApplet::initEngine(QObject *object)
|
||||||
|
{
|
||||||
|
auto engine = qmlEngine(object);
|
||||||
|
if (!engine) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
engine->addImageProvider(QStringLiteral("fa"), new QtForkAwesome::QuickImageProvider(IconManager::instance().forkAwesomeRenderer()));
|
||||||
|
}
|
||||||
|
|
||||||
QIcon SyncthingApplet::statusIcon() const
|
QIcon SyncthingApplet::statusIcon() const
|
||||||
{
|
{
|
||||||
return m_statusInfo.statusIcon();
|
return m_statusInfo.statusIcon();
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
void initEngine(QObject *object);
|
||||||
void showSettingsDlg();
|
void showSettingsDlg();
|
||||||
void showWebUI();
|
void showWebUI();
|
||||||
void showLog();
|
void showLog();
|
||||||
|
|
|
@ -60,7 +60,7 @@ Item {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: resumePauseButton
|
id: resumePauseButton
|
||||||
icon.name: paused ? "media-playback-start" : "media-playback-pause"
|
icon.source: paused ? "image://fa/play" : "image://fa/pause"
|
||||||
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
||||||
enabled: !isOwnDevice
|
enabled: !isOwnDevice
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
@ -67,7 +67,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: errorsButton
|
id: errorsButton
|
||||||
icon.name: "data-error"
|
icon.source: "image://fa/exclamation-triangle"
|
||||||
tooltip: qsTr("Show errors")
|
tooltip: qsTr("Show errors")
|
||||||
visible: pullErrorCount > 0
|
visible: pullErrorCount > 0
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -78,7 +78,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: rescanButton
|
id: rescanButton
|
||||||
icon.name: "view-refresh"
|
icon.source: "image://fa/refresh"
|
||||||
tooltip: qsTr("Rescan")
|
tooltip: qsTr("Rescan")
|
||||||
enabled: !paused
|
enabled: !paused
|
||||||
onClicked: plasmoid.nativeInterface.connection.rescan(
|
onClicked: plasmoid.nativeInterface.connection.rescan(
|
||||||
|
@ -86,7 +86,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: resumePauseButton
|
id: resumePauseButton
|
||||||
icon.name: paused ? "media-playback-start" : "media-playback-pause"
|
icon.source: paused ? "image://fa/play" : "image://fa/pause"
|
||||||
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
tooltip: paused ? qsTr("Resume") : qsTr("Pause")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
paused ? plasmoid.nativeInterface.connection.resumeDirectories(
|
paused ? plasmoid.nativeInterface.connection.resumeDirectories(
|
||||||
|
@ -96,7 +96,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: openButton
|
id: openButton
|
||||||
icon.name: "folder"
|
icon.source: "image://fa/folder"
|
||||||
tooltip: qsTr("Open in file browser")
|
tooltip: qsTr("Open in file browser")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Qt.openUrlExternally(path)
|
Qt.openUrlExternally(path)
|
||||||
|
|
|
@ -63,7 +63,7 @@ Item {
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
id: openButton
|
id: openButton
|
||||||
icon.name: "folder"
|
icon.source: "image://fa/folder"
|
||||||
tooltip: qsTr("Open in file browser")
|
tooltip: qsTr("Open in file browser")
|
||||||
enabled: path !== undefined
|
enabled: path !== undefined
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -119,7 +119,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TinyButton {
|
TinyButton {
|
||||||
icon.name: "folder"
|
icon.source: "image://fa/folder"
|
||||||
tooltip: qsTr("Open in file browser")
|
tooltip: qsTr("Open in file browser")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Qt.openUrlExternally(path + "/..")
|
Qt.openUrlExternally(path + "/..")
|
||||||
|
|
|
@ -182,7 +182,7 @@ ColumnLayout {
|
||||||
id: toolBar
|
id: toolBar
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: connectButton
|
id: connectButton
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
@ -190,7 +190,7 @@ ColumnLayout {
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Connect")
|
text: qsTr("Connect")
|
||||||
icon.name: "view-refresh"
|
icon.source: "image://fa/refresh"
|
||||||
visible: true
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -206,7 +206,7 @@ ColumnLayout {
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Resume")
|
text: qsTr("Resume")
|
||||||
icon.name: "media-playback-start"
|
icon.source: "image://fa/play"
|
||||||
visible: true
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -215,7 +215,7 @@ ColumnLayout {
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Pause")
|
text: qsTr("Pause")
|
||||||
icon.name: "media-playback-pause"
|
icon.source: "image://fa/pause"
|
||||||
visible: true
|
visible: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ ColumnLayout {
|
||||||
onActivated: connectButton.clicked()
|
onActivated: connectButton.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: startStopButton
|
id: startStopButton
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
@ -265,7 +265,7 @@ ColumnLayout {
|
||||||
target: startStopButton
|
target: startStopButton
|
||||||
visible: true
|
visible: true
|
||||||
text: qsTr("Stop")
|
text: qsTr("Stop")
|
||||||
icon.name: "process-stop"
|
icon.source: "image://fa/stop"
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: startStopToolTip
|
target: startStopToolTip
|
||||||
|
@ -279,7 +279,7 @@ ColumnLayout {
|
||||||
target: startStopButton
|
target: startStopButton
|
||||||
visible: true
|
visible: true
|
||||||
text: qsTr("Start")
|
text: qsTr("Start")
|
||||||
icon.name: "system-run"
|
icon.source: "image://fa/play"
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: startStopToolTip
|
target: startStopToolTip
|
||||||
|
@ -345,8 +345,8 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
icon.name: "help-about"
|
icon.source: "image://fa/info"
|
||||||
PlasmaComponents3.ToolTip {
|
PlasmaComponents3.ToolTip {
|
||||||
text: qsTr("About Syncthing Tray")
|
text: qsTr("About Syncthing Tray")
|
||||||
}
|
}
|
||||||
|
@ -355,15 +355,9 @@ ColumnLayout {
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: showOwnIdButton
|
id: showOwnIdButton
|
||||||
// use PlasmaCore.IconItem for the icon because I wouldn't know how to show the QIcon otherwise
|
icon.source: "image://fa/qrcode"
|
||||||
contentItem: PlasmaCore.IconItem {
|
|
||||||
source: plasmoid.nativeInterface.loadForkAwesomeIcon("qrcode", 64)
|
|
||||||
}
|
|
||||||
// set preferred size so the tool button is displayed consistently with the previous one despite using PlasmaCore.IconItem
|
|
||||||
Layout.preferredWidth: settingsButton.width
|
|
||||||
Layout.preferredHeight: settingsButton.height
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
plasmoid.nativeInterface.showOwnDeviceId()
|
plasmoid.nativeInterface.showOwnDeviceId()
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
|
@ -376,9 +370,9 @@ ColumnLayout {
|
||||||
onActivated: showOwnIdButton.clicked()
|
onActivated: showOwnIdButton.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: showLogButton
|
id: showLogButton
|
||||||
icon.name: "text-x-generic"
|
icon.source: "image://fa/file-code-o"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
plasmoid.nativeInterface.showLog()
|
plasmoid.nativeInterface.showLog()
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
|
@ -391,9 +385,9 @@ ColumnLayout {
|
||||||
onActivated: showLogButton.clicked()
|
onActivated: showLogButton.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: rescanAllDirsButton
|
id: rescanAllDirsButton
|
||||||
icon.name: "folder-sync"
|
icon.source: "image://fa/search"
|
||||||
onClicked: plasmoid.nativeInterface.connection.rescanAllDirs()
|
onClicked: plasmoid.nativeInterface.connection.rescanAllDirs()
|
||||||
PlasmaComponents3.ToolTip {
|
PlasmaComponents3.ToolTip {
|
||||||
text: qsTr("Rescan all directories")
|
text: qsTr("Rescan all directories")
|
||||||
|
@ -403,9 +397,9 @@ ColumnLayout {
|
||||||
onActivated: rescanAllDirsButton.clicked()
|
onActivated: rescanAllDirsButton.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: settingsButton
|
id: settingsButton
|
||||||
icon.name: "preferences-other"
|
icon.source: "image://fa/cogs"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
plasmoid.nativeInterface.showSettingsDlg()
|
plasmoid.nativeInterface.showSettingsDlg()
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
|
@ -418,15 +412,9 @@ ColumnLayout {
|
||||||
onActivated: settingsButton.clicked()
|
onActivated: settingsButton.clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlasmaComponents3.ToolButton {
|
ToolButton {
|
||||||
id: webUIButton
|
id: webUIButton
|
||||||
// use PlasmaCore.IconItem for the icon because I wouldn't know how to show the QIcon otherwise
|
icon.source: "image://fa/syncthing"
|
||||||
contentItem: PlasmaCore.IconItem {
|
|
||||||
source: plasmoid.nativeInterface.loadForkAwesomeIcon("syncthing")
|
|
||||||
}
|
|
||||||
// set preferred size so the tool button is displayed consistently with the previous one despite using PlasmaCore.IconItem
|
|
||||||
Layout.preferredWidth: settingsButton.width
|
|
||||||
Layout.preferredHeight: settingsButton.height
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
plasmoid.nativeInterface.showWebUI()
|
plasmoid.nativeInterface.showWebUI()
|
||||||
plasmoid.expanded = false
|
plasmoid.expanded = false
|
||||||
|
@ -472,10 +460,12 @@ ColumnLayout {
|
||||||
rowSpacing: 1
|
rowSpacing: 1
|
||||||
columnSpacing: 4
|
columnSpacing: 4
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Image {
|
||||||
Layout.preferredWidth: 16
|
Layout.preferredWidth: 16
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
source: "globe"
|
height: 16
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: "image://fa/globe"
|
||||||
}
|
}
|
||||||
StatisticsView {
|
StatisticsView {
|
||||||
Layout.leftMargin: 4
|
Layout.leftMargin: 4
|
||||||
|
@ -485,17 +475,18 @@ ColumnLayout {
|
||||||
|
|
||||||
IconLabel {
|
IconLabel {
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon(
|
iconSource: "image://fa/cloud-download"
|
||||||
"cloud-download")
|
|
||||||
iconOpacity: plasmoid.nativeInterface.hasIncomingTraffic ? 1.0 : 0.5
|
iconOpacity: plasmoid.nativeInterface.hasIncomingTraffic ? 1.0 : 0.5
|
||||||
text: plasmoid.nativeInterface.incomingTraffic
|
text: plasmoid.nativeInterface.incomingTraffic
|
||||||
tooltip: qsTr("Global incoming traffic")
|
tooltip: qsTr("Global incoming traffic")
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Image {
|
||||||
Layout.preferredWidth: 16
|
Layout.preferredWidth: 16
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
source: "user-home-symbolic"
|
height: 16
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: "image://fa/home"
|
||||||
}
|
}
|
||||||
StatisticsView {
|
StatisticsView {
|
||||||
Layout.leftMargin: 4
|
Layout.leftMargin: 4
|
||||||
|
@ -505,8 +496,7 @@ ColumnLayout {
|
||||||
|
|
||||||
IconLabel {
|
IconLabel {
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon(
|
iconSource: "image://fa/cloud-upload"
|
||||||
"cloud-upload")
|
|
||||||
iconOpacity: plasmoid.nativeInterface.hasOutgoingTraffic ? 1.0 : 0.5
|
iconOpacity: plasmoid.nativeInterface.hasOutgoingTraffic ? 1.0 : 0.5
|
||||||
text: plasmoid.nativeInterface.outgoingTraffic
|
text: plasmoid.nativeInterface.outgoingTraffic
|
||||||
tooltip: qsTr("Global outgoing traffic")
|
tooltip: qsTr("Global outgoing traffic")
|
||||||
|
@ -540,22 +530,22 @@ ColumnLayout {
|
||||||
|
|
||||||
PlasmaComponents.TabButton {
|
PlasmaComponents.TabButton {
|
||||||
id: dirsTabButton
|
id: dirsTabButton
|
||||||
iconSource: "folder-symbolic"
|
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("folder")
|
||||||
tab: dirsPage
|
tab: dirsPage
|
||||||
}
|
}
|
||||||
PlasmaComponents.TabButton {
|
PlasmaComponents.TabButton {
|
||||||
id: devsTabButton
|
id: devsTabButton
|
||||||
iconSource: "network-server-symbolic"
|
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("sitemap")
|
||||||
tab: devicesPage
|
tab: devicesPage
|
||||||
}
|
}
|
||||||
PlasmaComponents.TabButton {
|
PlasmaComponents.TabButton {
|
||||||
id: downloadsTabButton
|
id: downloadsTabButton
|
||||||
iconSource: "folder-download-symbolic"
|
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("download")
|
||||||
tab: downloadsPage
|
tab: downloadsPage
|
||||||
}
|
}
|
||||||
PlasmaComponents.TabButton {
|
PlasmaComponents.TabButton {
|
||||||
id: recentChangesTabButton
|
id: recentChangesTabButton
|
||||||
iconSource: "document-open-recent-symbolic"
|
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("history")
|
||||||
tab: recentChangesPage
|
tab: recentChangesPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,12 @@ Item {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
Image {
|
||||||
id: iconItem
|
id: iconItem
|
||||||
Layout.preferredWidth: 16
|
Layout.preferredWidth: 16
|
||||||
Layout.preferredHeight: 16
|
Layout.preferredHeight: 16
|
||||||
opacity: 0.7
|
height: 16
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
}
|
}
|
||||||
PlasmaComponents3.Label {
|
PlasmaComponents3.Label {
|
||||||
id: label
|
id: label
|
||||||
|
|
|
@ -7,17 +7,17 @@ RowLayout {
|
||||||
property string context: "?"
|
property string context: "?"
|
||||||
|
|
||||||
IconLabel {
|
IconLabel {
|
||||||
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("file-o")
|
iconSource: "image://fa/file-o"
|
||||||
text: statistics.files !== undefined ? statistics.files : "?"
|
text: statistics.files !== undefined ? statistics.files : "?"
|
||||||
tooltip: context + qsTr(" files")
|
tooltip: context + qsTr(" files")
|
||||||
}
|
}
|
||||||
IconLabel {
|
IconLabel {
|
||||||
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("folder-o")
|
iconSource: "image://fa/folder-o"
|
||||||
text: statistics.dirs !== undefined ? statistics.dirs : "?"
|
text: statistics.dirs !== undefined ? statistics.dirs : "?"
|
||||||
tooltip: context + qsTr(" directories")
|
tooltip: context + qsTr(" directories")
|
||||||
}
|
}
|
||||||
IconLabel {
|
IconLabel {
|
||||||
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("hdd-o")
|
iconSource: "image://fa/hdd-o"
|
||||||
text: statistics.bytes !== undefined ? plasmoid.nativeInterface.formatFileSize(
|
text: statistics.bytes !== undefined ? plasmoid.nativeInterface.formatFileSize(
|
||||||
statistics.bytes) : "?"
|
statistics.bytes) : "?"
|
||||||
tooltip: context + qsTr(" size")
|
tooltip: context + qsTr(" size")
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
|
import QtQuick 2.8
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||||
|
|
||||||
PlasmaComponents3.ToolButton {
|
PlasmaComponents3.ToolButton {
|
||||||
|
id: root
|
||||||
|
|
||||||
property alias tooltip: tooltip.text
|
property alias tooltip: tooltip.text
|
||||||
icon.width: units.iconSizes.small
|
|
||||||
icon.height: units.iconSizes.small
|
Layout.fillHeight: true
|
||||||
|
Layout.preferredWidth: units.iconSizes.smallMedium
|
||||||
|
Layout.preferredHeight: units.iconSizes.smallMedium
|
||||||
|
|
||||||
PlasmaComponents3.ToolTip {
|
PlasmaComponents3.ToolTip {
|
||||||
id: tooltip
|
id: tooltip
|
||||||
}
|
}
|
||||||
|
contentItem: Image {
|
||||||
|
source: root.icon.source
|
||||||
|
height: parent.height
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
import QtQuick 2.8
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
||||||
|
|
||||||
|
PlasmaComponents3.ToolButton {
|
||||||
|
id: root
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.preferredHeight: units.iconSizes.smallMedium
|
||||||
|
contentItem: Grid {
|
||||||
|
columns: 2
|
||||||
|
columnSpacing: label.visible ? units.smallSpacing : 0
|
||||||
|
verticalItemAlignment: Grid.AlignVCenter
|
||||||
|
PlasmaCore.ColorScope.inherit: true
|
||||||
|
Image {
|
||||||
|
source: root.icon.source
|
||||||
|
height: parent.height
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
}
|
||||||
|
PlasmaComponents3.Label {
|
||||||
|
id: label
|
||||||
|
visible: text.length > 0
|
||||||
|
text: root.text
|
||||||
|
font: root.parent.font
|
||||||
|
color: PlasmaCore.ColorScope.textColor
|
||||||
|
elide: Text.ElideRight
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
plasmoid.nativeInterface.initEngine(this)
|
||||||
plasmoid.removeAction("configure")
|
plasmoid.removeAction("configure")
|
||||||
plasmoid.setAction(
|
plasmoid.setAction(
|
||||||
"showWebUI", qsTr("Open Syncthing"),
|
"showWebUI", qsTr("Open Syncthing"),
|
||||||
|
|
Loading…
Reference in New Issue