Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/package/contents/ui/main.qml
Show All 31 Lines | |||||
32 | 32 | | |||
33 | import "code/LayoutManager.js" as LayoutManager | 33 | import "code/LayoutManager.js" as LayoutManager | ||
34 | import "code/FolderTools.js" as FolderTools | 34 | import "code/FolderTools.js" as FolderTools | ||
35 | 35 | | |||
36 | FolderViewDropArea { | 36 | FolderViewDropArea { | ||
37 | id: root | 37 | id: root | ||
38 | objectName: isFolder ? "folder" : "desktop" | 38 | objectName: isFolder ? "folder" : "desktop" | ||
39 | 39 | | |||
40 | width: isPopup ? undefined : preferredWidth(false) // for the initial size when placed on the desktop | 40 | width: isPopup ? undefined : preferredWidth(false) | ||
41 | Layout.minimumWidth: preferredWidth(true) | | |||
42 | Layout.preferredWidth: isPopup ? preferredWidth(false) : 0 // for the popup size to change at runtime when view mode changes | | |||
43 | Plasmoid.switchWidth: isPopup ? units.iconSizeHints.panel : preferredWidth(true) | | |||
44 | | ||||
45 | height: isPopup ? undefined : preferredHeight(false) | 41 | height: isPopup ? undefined : preferredHeight(false) | ||
46 | Layout.minimumHeight: preferredHeight(true) | 42 | | ||
47 | Layout.preferredHeight: isPopup ? preferredHeight(false) : 0 | 43 | Layout.minimumWidth: preferredWidth(!isPopup) | ||
48 | Plasmoid.switchHeight: isPopup ? units.iconSizeHints.panel : preferredHeight(true) | 44 | Layout.minimumHeight: preferredHeight(!isPopup) | ||
45 | | ||||
46 | Layout.preferredWidth: preferredWidth(false) | ||||
47 | Layout.preferredHeight: preferredHeight(false) | ||||
48 | | ||||
49 | Layout.maximumWidth: isPopup ? preferredWidth(false) : -1 | ||||
50 | Layout.maximumHeight: isPopup ? preferredHeight(false) : -1 | ||||
51 | | ||||
52 | Plasmoid.switchWidth: { | ||||
53 | // Support expanding into the full representation only on vertical panels. | ||||
54 | if (isPopup && plasmoid.formFactor == PlasmaCore.Types.Vertical) { | ||||
55 | return units.iconSizeHints.panel; | ||||
56 | } | ||||
57 | | ||||
58 | return undefined; | ||||
59 | } | ||||
60 | | ||||
kossebau: This and the same below sadly results in error log output e.g. when testing applets with… | |||||
61 | Plasmoid.switchHeight: { | ||||
62 | // Support expanding into the full representation only on vertical panels. | ||||
63 | if (isPopup && plasmoid.formFactor == PlasmaCore.Types.Vertical) { | ||||
64 | return units.iconSizeHints.panel; | ||||
65 | } | ||||
66 | | ||||
67 | return undefined; | ||||
68 | } | ||||
49 | 69 | | |||
50 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 70 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
51 | LayoutMirroring.childrenInherit: true | 71 | LayoutMirroring.childrenInherit: true | ||
52 | 72 | | |||
53 | property bool isFolder: (plasmoid.pluginName == "org.kde.plasma.folder") | 73 | property bool isFolder: (plasmoid.pluginName == "org.kde.plasma.folder") | ||
54 | property bool isContainment: ("containmentType" in plasmoid) | 74 | property bool isContainment: ("containmentType" in plasmoid) | ||
55 | property bool isPopup: (plasmoid.location != PlasmaCore.Types.Floating) | 75 | property bool isPopup: (plasmoid.location != PlasmaCore.Types.Floating) | ||
56 | property bool useListViewMode: isPopup && plasmoid.configuration.viewMode === 0 | 76 | property bool useListViewMode: isPopup && plasmoid.configuration.viewMode === 0 | ||
▲ Show 20 Lines • Show All 528 Lines • Show Last 20 Lines |
This and the same below sadly results in error log output e.g. when testing applets with plasmoidviewer:
Seems to be able to assign null or undefined to a property the respective property needs to have a RESET method defined.
Unsure myself what undefined even should mean here, and whether a RESET method is better than just assigning some dummy value here.