@ -17,15 +17,15 @@
* 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 , USA .
* /
import QtQuick 2.1
import QtQuick . Layouts 1.1
import QtQuick 2.13
import QtQuick . Layouts 1.13
import org . kde . plasma . core 2.0 as PlasmaCore
import org . kde . plasma . components 2 .0 as PlasmaComponents
import org . kde . plasma . components 3 .0 as PlasmaComponents
import org . kde . plasma . extras 2.0 as PlasmaExtras
Item {
ColumnLayout {
id: expandedRepresentation
/ / s e t w i d t h / h e i g h t t o a v o i d a n u s e l e s s D i a l o g r e s i z e
width: Layout . minimumWidth
height: Layout . minimumHeight
@ -33,112 +33,109 @@ Item {
Layout.minimumHeight: units . gridUnit * 21
Layout.preferredWidth: Layout . minimumWidth
Layout.preferredHeight: Layout . minimumHeight * 1.5
spacing: 0 / / a v o i d g a p b e t w e e n t i t l e a n d c o n t e n t
property alias activeApplet: container . activeApplet
property alias hiddenLayout: hiddenItemsView . layout
PlasmaComponents . ToolButton {
id: pinButton
anchors.right: parent . right
width: Math . round ( units . gridUnit * 1.25 )
height: width
checkable: true
checked: plasmoid . configuration . pin
onCheckedChanged: plasmoid . configuration . pin = checked
iconSource: "window-pin"
z: 2
tooltip: i18n ( "Keep Open" )
}
RowLayout {
Layout.maximumWidth: parent . width / / o t h e r w i s e t h e p i n b u t t o n d i s a p p e a r s i n n o A p p l e t m o d e
PlasmaExtras . Heading {
id: heading
level: 1
PlasmaExtras . Heading {
id: heading
level: 1
Layout.leftMargin: {
/ / M e n u m o d e
if ( ! activeApplet && hiddenItemsView . visible && ! LayoutMirroring . enabled ) {
return units . smallSpacing ;
anchors {
left: parent . left
top: parent . top
right: parent . right
topMargin: hiddenItemsView . visible ? units.smallSpacing : 0
leftMargin: {
/ / a p p l e t o p e n , s i d e b a r
} else if ( activeApplet && hiddenItemsView . visible && ! LayoutMirroring . enabled ) {
return hiddenItemsView . width + units . largeSpacing ;
/ / a p p l e t o p e n , n o s i d e b a r
} else {
return 0 ;
}
}
Layout.rightMargin: {
/ / M e n u m o d e
if ( ! activeApplet && hiddenItemsView . visible ) {
if ( ! activeApplet && hiddenItemsView . visible && LayoutMirroring . enabled ) {
return units . smallSpacing ;
/ / a p p l e t o p e n , s i d e b a r
} else if ( activeApplet && hiddenItemsView . visible ) {
return hiddenItemsView . iconColumnW idth + units . largeSpacing ;
} else if ( activeApplet && hiddenItemsView . visible && LayoutMirroring . enabled ) {
return hiddenItemsView . w idth + units . largeSpacing ;
/ / a p p l e t o p e n , n o s i d e b a r
} else {
return 0 ;
}
}
}
visible: activeApplet
text: activeApplet ? activeApplet.title : ""
MouseArea {
anchors.fill: parent
onClicked: {
if ( activeApplet ) {
activeApplet . expanded = false ;
dialog . visible = true ;
visible: activeApplet
text: activeApplet ? activeApplet.title : ""
MouseArea {
anchors.fill: parent
onClicked: {
if ( activeApplet ) {
activeApplet . expanded = false ;
dialog . visible = true ;
}
}
}
}
}
PlasmaExtras . Heading {
id: noAppletHeading
level: 1
anchors {
left: parent . left
top: parent . top
right: parent . right
topMargin: hiddenItemsView . visible ? units.smallSpacing : 0
leftMargin: units . smallSpacing
PlasmaExtras . Heading {
id: noAppletHeading
level: 1
text: i18n ( "Status and Notifications" )
visible: ! heading . visible
}
text: i18n ( "Status and Notifications" )
visible: ! heading . visible
}
PlasmaCore . SvgItem {
anchors {
left: parent . left
leftMargin: hiddenLayout . width
top: parent . top
bottom: parent . bottom
margins: - units . gridUnit
/ / s p a c e r
Item {
Layout.fillWidth: true
}
visible: hiddenItemsView . visible && activeApplet
width: lineSvg . elementSize ( "vertical-line" ) . width
PlasmaComponents . ToolButton {
id: pinButton
checkable: true
checked: plasmoid . configuration . pin
onCheckedChanged: plasmoid . configuration . pin = checked
icon.name: "window-pin"
PlasmaComponents . ToolTip {
text: i18n ( "Keep Open" )
}
}
}
elementId: "vertical-line"
RowLayout {
spacing: 0 / / m u s t b e 0 s o t h a t t h e s e p a r a t o r i s a s c l o s e t o t h e i n d i c a t o r a s p o s s i b l e
svg: PlasmaCore . Svg {
id: lineSvg ;
imagePath: "widgets/line"
HiddenItemsView {
id: hiddenItemsView
Layout.preferredWidth: visible && activeApplet ? iconColumnWidth : expandedRepresentation . width
Layout.fillHeight: true
}
}
HiddenItemsView {
id: hiddenItemsView
anchors {
left: parent . left
top: noAppletHeading . bottom
topMargin: units . smallSpacing
bottom: parent . bottom
PlasmaCore . SvgItem {
visible: hiddenItemsView . visible && activeApplet
Layout.fillHeight: true
Layout.preferredWidth: lineSvg . elementSize ( "vertical-line" ) . width
elementId: "vertical-line"
svg: PlasmaCore . Svg {
id: lineSvg ;
imagePath: "widgets/line"
}
}
}
PlasmoidPopupsContainer {
id: container
anchors {
left: parent . left
right: parent . right
top: heading . bottom
bottom: parent . bottom
leftMargin: hiddenItemsView . visible ? hiddenItemsView . iconColumnWidth + units.largeSpacing : 0
PlasmoidPopupsContainer {
id: container
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: hiddenItemsView . visible && activeApplet && ! LayoutMirroring . enabled ? units.largeSpacing : 0
Layout.rightMargin: hiddenItemsView . visible && activeApplet && LayoutMirroring . enabled ? units.largeSpacing : 0
}
}
}