Changeset View
Changeset View
Standalone View
Standalone View
applets/icon/package/contents/ui/main.qml
Show All 26 Lines | |||||
27 | import org.kde.plasma.core 2.0 as PlasmaCore | 27 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
28 | import org.kde.plasma.components 2.0 as Components | 28 | import org.kde.plasma.components 2.0 as Components | ||
29 | import org.kde.kquickcontrolsaddons 2.0 | 29 | import org.kde.kquickcontrolsaddons 2.0 | ||
30 | import org.kde.draganddrop 2.0 as DragDrop | 30 | import org.kde.draganddrop 2.0 as DragDrop | ||
31 | 31 | | |||
32 | MouseArea { | 32 | MouseArea { | ||
33 | id: root | 33 | id: root | ||
34 | 34 | | |||
35 | readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge | ||||
36 | || plasmoid.location == PlasmaCore.Types.RightEdge | ||||
37 | || plasmoid.location == PlasmaCore.Types.BottomEdge | ||||
38 | || plasmoid.location == PlasmaCore.Types.LeftEdge) | ||||
35 | readonly property bool constrained: plasmoid.formFactor === PlasmaCore.Types.Vertical || plasmoid.formFactor === PlasmaCore.Types.Horizontal | 39 | readonly property bool constrained: plasmoid.formFactor === PlasmaCore.Types.Vertical || plasmoid.formFactor === PlasmaCore.Types.Horizontal | ||
36 | property bool containsAcceptableDrag: false | 40 | property bool containsAcceptableDrag: false | ||
37 | 41 | | |||
38 | height: Math.round(units.iconSizes.desktop + 2 * theme.mSize(theme.defaultFont).height) | 42 | height: Math.round(units.iconSizes.desktop + 2 * theme.mSize(theme.defaultFont).height) | ||
39 | width: Math.round(units.iconSizes.desktop * 1.5) | 43 | width: Math.round(units.iconSizes.desktop * 1.5) | ||
40 | 44 | | |||
41 | Layout.minimumWidth: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? height : units.iconSizes.small | 45 | Layout.minimumWidth: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? height : units.iconSizes.small | ||
42 | Layout.minimumHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? width : (units.iconSizes.small + 2 * theme.mSize(theme.defaultFont).height) | 46 | Layout.minimumHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? width : (units.iconSizes.small + 2 * theme.mSize(theme.defaultFont).height) | ||
43 | 47 | | |||
48 | root.Layout.maximumWidth = inPanel ? units.iconSizeHints.panel : undefined; | ||||
49 | root.Layout.maximumHeight = inPanel ? units.iconSizeHints.panel : undefined; | ||||
50 | | ||||
44 | hoverEnabled: true | 51 | hoverEnabled: true | ||
45 | 52 | | |||
46 | onClicked: plasmoid.nativeInterface.run() | 53 | onClicked: plasmoid.nativeInterface.run() | ||
47 | 54 | | |||
48 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | 55 | Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation | ||
49 | Plasmoid.icon: plasmoid.nativeInterface.iconName | 56 | Plasmoid.icon: plasmoid.nativeInterface.iconName | ||
50 | Plasmoid.title: plasmoid.nativeInterface.name | 57 | Plasmoid.title: plasmoid.nativeInterface.name | ||
51 | Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground | 58 | Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground | ||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |