-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(config): improve selection for click action
This improve #12.
- Loading branch information
Showing
7 changed files
with
284 additions
and
159 deletions.
There are no files selected for viewing
Binary file modified
BIN
-191 Bytes
(96%)
package/contents/locale/fr/LC_MESSAGES/plasma_applet_org.kde.resourcesMonitor-fork.mo
Binary file not shown.
39 changes: 39 additions & 0 deletions
39
package/contents/ui/components/ApplicationDelegateItem.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import QtQuick 2.0 | ||
import QtQuick.Controls 2.12 as QtControls | ||
import QtQuick.Layouts 1.1 as QtLayouts | ||
import org.kde.plasma.core 2.0 as PlasmaCore | ||
import org.kde.plasma.components 2.0 as PlasmaComponents | ||
import org.kde.kirigami 2.6 as Kirigami | ||
|
||
MouseArea { | ||
id: root | ||
height: childrenRect.height | ||
|
||
hoverEnabled: true | ||
cursorShape: Qt.PointingHandCursor | ||
|
||
property string serviceName: "" | ||
property string name: "" | ||
property string comment: "" | ||
property string iconName: "" | ||
property bool selected: false | ||
|
||
QtLayouts.RowLayout { | ||
spacing: Kirigami.Units.smallSpacing | ||
|
||
QtControls.ToolTip.text: (comment !== "" ? comment + "\n\n" : "") + | ||
"ID: " + serviceName + ".desktop" | ||
QtControls.ToolTip.visible: root.containsMouse | ||
|
||
PlasmaCore.IconItem { | ||
id: icon | ||
|
||
source: iconName | ||
implicitHeight: 16 | ||
implicitWidth: 16 | ||
} | ||
PlasmaComponents.Label { | ||
text: selected ? "<strong>" + name + "</strong>" : name | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import QtQuick 2.0 | ||
import org.kde.plasma.core 2.1 as PlasmaCore | ||
|
||
PlasmaCore.SortFilterModel { | ||
id: appsDetector | ||
|
||
sourceModel: PlasmaCore.DataModel { | ||
dataSource: source | ||
} | ||
|
||
filterRole: "name" | ||
sortColumn: 0 | ||
sortRole: "name" | ||
sortOrder: Qt.AscendingOrder | ||
|
||
// https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/core/datasource.h | ||
property var dataSource: PlasmaCore.DataSource { | ||
id: source | ||
engine: "apps" | ||
connectedSources: { | ||
// Explude folder | ||
var result = [] | ||
for (var i = 0; i < sources.length; i++) { | ||
if (sources[i].indexOf(".desktop") !== -1) { | ||
result.push(sources[i]) | ||
} | ||
} | ||
return result | ||
} | ||
interval: 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.