mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
move title and arrow in default compactrepresentation
This commit is contained in:
parent
0a00527788
commit
adba281d59
3 changed files with 42 additions and 51 deletions
|
|
@ -57,7 +57,7 @@ PlasmaCore.ColorScope {
|
|||
//applet.anchors.fill = container;
|
||||
applet.anchors.left = container.left;
|
||||
applet.anchors.right = container.right;
|
||||
applet.height = units.iconSizes.medium
|
||||
applet.height = units.iconSizes.medium;
|
||||
applet.visible = true;
|
||||
container.visible = true;
|
||||
|
||||
|
|
@ -119,6 +119,7 @@ PlasmaCore.ColorScope {
|
|||
Component {
|
||||
id: appletContainerComponent
|
||||
Item {
|
||||
id: containerItem
|
||||
property Item applet
|
||||
Layout.fillWidth: true
|
||||
clip: true
|
||||
|
|
@ -133,9 +134,13 @@ PlasmaCore.ColorScope {
|
|||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: bah
|
||||
}
|
||||
Connections {
|
||||
target: applet
|
||||
onExpandedChanged: {
|
||||
|
||||
if (!applet.expanded && root.expandedApplet == applet) {
|
||||
root.expandedApplet = null;
|
||||
return;
|
||||
|
|
@ -146,6 +151,16 @@ PlasmaCore.ColorScope {
|
|||
root.expandedApplet = applet;
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
property bool wasExpanded: false
|
||||
|
||||
anchors.fill: parent
|
||||
onPressed: wasExpanded = applet.expanded
|
||||
onClicked: applet.expanded = !wasExpanded
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,16 +23,11 @@ import org.kde.plasma.core 2.0 as PlasmaCore
|
|||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
|
||||
PlasmaCore.ToolTipArea {
|
||||
Item {
|
||||
id: root
|
||||
objectName: "org.kde.desktop-CompactApplet"
|
||||
anchors.fill: parent
|
||||
|
||||
icon: plasmoid.icon
|
||||
mainText: plasmoid.toolTipMainText
|
||||
subText: plasmoid.toolTipSubText
|
||||
location: plasmoid.location
|
||||
active: !plasmoid.expanded
|
||||
property Item fullRepresentation
|
||||
property Item compactRepresentation
|
||||
property Item expandedFeedback: expandedItem
|
||||
|
|
@ -40,7 +35,10 @@ PlasmaCore.ToolTipArea {
|
|||
onCompactRepresentationChanged: {
|
||||
if (compactRepresentation) {
|
||||
compactRepresentation.parent = root;
|
||||
compactRepresentation.anchors.fill = root;
|
||||
compactRepresentation.anchors.left = root.left;
|
||||
compactRepresentation.anchors.top = root.top;
|
||||
compactRepresentation.width = units.iconSizes.medium;
|
||||
compactRepresentation.height = compactRepresentation.width;
|
||||
compactRepresentation.visible = true;
|
||||
}
|
||||
root.visible = true;
|
||||
|
|
@ -51,31 +49,31 @@ PlasmaCore.ToolTipArea {
|
|||
if (!fullRepresentation) {
|
||||
return;
|
||||
}
|
||||
/* //if the fullRepresentation size was restored to a stored size, or if is dragged from the desktop, restore popup size
|
||||
if (fullRepresentation.width > 0) {
|
||||
appletParent.width = fullRepresentation.width;
|
||||
} else if (fullRepresentation.Layout && fullRepresentation.Layout.preferredWidth > 0) {
|
||||
appletParent.width = fullRepresentation.Layout.preferredWidth
|
||||
} else if (fullRepresentation.implicitWidth > 0) {
|
||||
appletParent.width = fullRepresentation.implicitWidth
|
||||
} else {
|
||||
appletParent.width = theme.mSize(theme.defaultFont).width * 35
|
||||
}
|
||||
|
||||
if (fullRepresentation.height > 0) {
|
||||
appletParent.height = fullRepresentation.height;
|
||||
} else if (fullRepresentation.Layout && fullRepresentation.Layout.preferredHeight > 0) {
|
||||
appletParent.height = fullRepresentation.Layout.preferredHeight
|
||||
} else if (fullRepresentation.implicitHeight > 0) {
|
||||
appletParent.height = fullRepresentation.implicitHeight
|
||||
} else {
|
||||
appletParent.height = theme.mSize(theme.defaultFont).height * 25
|
||||
}*/
|
||||
|
||||
fullRepresentation.parent = appletParent;
|
||||
fullRepresentation.anchors.fill = fullRepresentation.parent;
|
||||
}
|
||||
|
||||
Row {
|
||||
height: units.iconSizes.medium
|
||||
anchors.left: compactRepresentation ? compactRepresentation.right : undefined
|
||||
PlasmaCore.SvgItem {
|
||||
svg: PlasmaCore.Svg {
|
||||
id: arrowSvg
|
||||
imagePath: "widgets/arrows"
|
||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
}
|
||||
width: units.iconSizes.smallMedium
|
||||
height: width
|
||||
elementId: plasmoid.expanded ? "up-arrow" : "down-arrow"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
PlasmaComponents.Label {
|
||||
text: plasmoid.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: expandedItem
|
||||
anchors.fill: parent
|
||||
|
|
@ -88,12 +86,6 @@ PlasmaCore.ToolTipArea {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: expandedSync
|
||||
interval: 100
|
||||
onTriggered: plasmoid.expanded = popupWindow.visible;
|
||||
}
|
||||
|
||||
Item {
|
||||
id: appletParent
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@ import QtQuick.Layouts 1.1
|
|||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
|
||||
Row {
|
||||
Item {
|
||||
id: main
|
||||
spacing: units.largeSpacing
|
||||
|
||||
Layout.minimumWidth: {
|
||||
switch (plasmoid.formFactor) {
|
||||
|
|
@ -54,21 +53,6 @@ Row {
|
|||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
PlasmaCore.SvgItem {
|
||||
svg: PlasmaCore.Svg {
|
||||
id: arrowSvg
|
||||
imagePath: "widgets/arrows"
|
||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
||||
}
|
||||
width: units.iconSizes.smallMedium
|
||||
height: width
|
||||
elementId: plasmoid.expanded ? "up-arrow" : "down-arrow"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
PlasmaComponents.Label {
|
||||
text: plasmoid.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
|
|
|||
Loading…
Reference in a new issue