Changeset View
Changeset View
Standalone View
Standalone View
applets/kickoff/package/contents/ui/Kickoff.qml
Show All 27 Lines | |||||
28 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 28 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
29 | import org.kde.kquickcontrolsaddons 2.0 | 29 | import org.kde.kquickcontrolsaddons 2.0 | ||
30 | 30 | | |||
31 | import org.kde.plasma.private.kicker 0.1 as Kicker | 31 | import org.kde.plasma.private.kicker 0.1 as Kicker | ||
32 | 32 | | |||
33 | Item { | 33 | Item { | ||
34 | id: kickoff | 34 | id: kickoff | ||
35 | 35 | | |||
36 | readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge | ||||
37 | || plasmoid.location == PlasmaCore.Types.RightEdge | ||||
38 | || plasmoid.location == PlasmaCore.Types.BottomEdge | ||||
39 | || plasmoid.location == PlasmaCore.Types.LeftEdge) | ||||
40 | | ||||
36 | Plasmoid.switchWidth: units.gridUnit * 20 | 41 | Plasmoid.switchWidth: units.gridUnit * 20 | ||
37 | Plasmoid.switchHeight: units.gridUnit * 30 | 42 | Plasmoid.switchHeight: units.gridUnit * 30 | ||
38 | 43 | | |||
39 | Plasmoid.fullRepresentation: FullRepresentation {} | 44 | Plasmoid.fullRepresentation: FullRepresentation {} | ||
40 | 45 | | |||
41 | Plasmoid.icon: plasmoid.configuration.icon | 46 | Plasmoid.icon: plasmoid.configuration.icon | ||
42 | 47 | | |||
43 | Plasmoid.compactRepresentation: MouseArea { | 48 | Plasmoid.compactRepresentation: MouseArea { | ||
44 | //AppletQuickItem expects a layout to exist | 49 | //AppletQuickItem expects a layout to exist | ||
45 | //setting even a default property forces it to be created | 50 | //setting even a default property forces it to be created | ||
46 | Layout.fillWidth: false | 51 | Layout.fillWidth: false | ||
52 | Layout.maximumWidth: inPanel ? units.iconSizeHints.panel : -1 | ||||
53 | Layout.maximumHeight: inPanel ? units.iconSizeHints.panel : -1 | ||||
47 | hoverEnabled: true | 54 | hoverEnabled: true | ||
48 | onClicked: plasmoid.expanded = !plasmoid.expanded | 55 | onClicked: plasmoid.expanded = !plasmoid.expanded | ||
49 | 56 | | |||
50 | DropArea { | 57 | DropArea { | ||
51 | id: compactDragArea | 58 | id: compactDragArea | ||
52 | anchors.fill: parent | 59 | anchors.fill: parent | ||
53 | } | 60 | } | ||
54 | 61 | | |||
Show All 40 Lines |