Changeset View
Changeset View
Standalone View
Standalone View
applets/userswitcher/package/contents/ui/main.qml
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 33 | Item { | |||
---|---|---|---|---|---|
64 | } | 64 | } | ||
65 | 65 | | |||
66 | Plasmoid.compactRepresentation: MouseArea { | 66 | Plasmoid.compactRepresentation: MouseArea { | ||
67 | id: compactRoot | 67 | id: compactRoot | ||
68 | 68 | | |||
69 | // Taken from DigitalClock to ensure uniform sizing when next to each other | 69 | // Taken from DigitalClock to ensure uniform sizing when next to each other | ||
70 | readonly property bool tooSmall: plasmoid.formFactor === PlasmaCore.Types.Horizontal && Math.round(2 * (compactRoot.height / 5)) <= theme.smallestFont.pixelSize | 70 | readonly property bool tooSmall: plasmoid.formFactor === PlasmaCore.Types.Horizontal && Math.round(2 * (compactRoot.height / 5)) <= theme.smallestFont.pixelSize | ||
71 | 71 | | |||
72 | Layout.minimumWidth: isVertical ? 0 : compactRow.contentWidth | 72 | Layout.minimumWidth: isVertical ? 0 : compactRow.implicitWidth | ||
73 | Layout.maximumWidth: isVertical ? Infinity : Layout.minimumWidth | 73 | Layout.maximumWidth: isVertical ? Infinity : Layout.minimumWidth | ||
74 | Layout.preferredWidth: isVertical ? undefined : Layout.minimumWidth | 74 | Layout.preferredWidth: isVertical ? undefined : Layout.minimumWidth | ||
75 | 75 | | |||
76 | Layout.minimumHeight: isVertical ? label.height : theme.smallestFont.pixelSize | 76 | Layout.minimumHeight: isVertical ? label.height : theme.smallestFont.pixelSize | ||
77 | Layout.maximumHeight: isVertical ? Layout.minimumHeight : Infinity | 77 | Layout.maximumHeight: isVertical ? Layout.minimumHeight : Infinity | ||
78 | Layout.preferredHeight: isVertical ? Layout.minimumHeight : theme.mSize(theme.defaultFont).height * 2 | 78 | Layout.preferredHeight: isVertical ? Layout.minimumHeight : theme.mSize(theme.defaultFont).height * 2 | ||
79 | 79 | | |||
80 | onClicked: plasmoid.expanded = !plasmoid.expanded | 80 | onClicked: plasmoid.expanded = !plasmoid.expanded | ||
81 | 81 | | |||
82 | Row { | 82 | Row { | ||
83 | id: compactRow | 83 | id: compactRow | ||
84 | 84 | | |||
85 | readonly property int contentWidth: (icon.visible ? icon.width : 0) + (icon.visible && label.visible ? spacing : 0) + (label.visible ? label.contentWidth : 0) | | |||
86 | | ||||
87 | anchors.centerIn: parent | 85 | anchors.centerIn: parent | ||
88 | spacing: units.smallSpacing | 86 | spacing: units.smallSpacing | ||
89 | 87 | | |||
90 | PlasmaCore.IconItem { | 88 | PlasmaCore.IconItem { | ||
91 | id: icon | 89 | id: icon | ||
92 | width: height | 90 | width: height | ||
93 | height: compactRoot.height | 91 | height: compactRoot.height | ||
94 | Layout.preferredWidth: height | 92 | Layout.preferredWidth: height | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |