replace PlasmaCore functions with Kirigami counterparts
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
|
||||
@ -91,7 +92,7 @@ Item {
|
||||
}
|
||||
height: childrenRect.height
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: PlasmaCore.Units.longDuration } }
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } }
|
||||
|
||||
Flickable {
|
||||
id: breadcrumbFlickable
|
||||
@ -150,8 +151,8 @@ Item {
|
||||
anchors {
|
||||
top: crumbContainer.bottom
|
||||
bottom: parent.bottom
|
||||
rightMargin: -PlasmaCore.Units.largeSpacing
|
||||
leftMargin: -PlasmaCore.Units.largeSpacing
|
||||
rightMargin: -Kirigami.Units.gridUnit
|
||||
leftMargin: -Kirigami.Units.gridUnit
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
@ -159,7 +160,7 @@ Item {
|
||||
property Item activatedItem: null
|
||||
property var newModel: null
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: PlasmaCore.Units.longDuration } }
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration } }
|
||||
|
||||
focus: true
|
||||
|
||||
@ -223,14 +224,14 @@ Item {
|
||||
// and we want the item that has been clicked on, not the one that is under the
|
||||
// mouse once the animation is done
|
||||
ScriptAction { script: applicationsView.activatedItem = applicationsView.currentItem }
|
||||
NumberAnimation { properties: "x,opacity"; easing.type: Easing.InQuad; duration: PlasmaCore.Units.longDuration }
|
||||
NumberAnimation { properties: "x,opacity"; easing.type: Easing.InQuad; duration: Kirigami.Units.longDuration }
|
||||
ScriptAction { script: applicationsView.moveRight() }
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
to: "OutgoingRight"
|
||||
SequentialAnimation {
|
||||
NumberAnimation { properties: "x,opacity"; easing.type: Easing.InQuad; duration: PlasmaCore.Units.longDuration }
|
||||
NumberAnimation { properties: "x,opacity"; easing.type: Easing.InQuad; duration: Kirigami.Units.longDuration }
|
||||
ScriptAction { script: applicationsView.moveLeft() }
|
||||
}
|
||||
}
|
||||
@ -275,7 +276,7 @@ Item {
|
||||
visible: opacity != 0
|
||||
anchors.centerIn: parent
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: PlasmaCore.Units.shortDuration } }
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.draganddrop 2.0
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
|
||||
Item {
|
||||
|
@ -20,14 +20,15 @@ import QtQuick 2.5
|
||||
import QtQml.Models 2.1
|
||||
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigami 2.5 as Kirigami
|
||||
|
||||
|
||||
GridView {
|
||||
id: configButtons
|
||||
|
||||
cellHeight: PlasmaCore.Units.gridUnit * 5 + PlasmaCore.Units.smallSpacing
|
||||
cellWidth: PlasmaCore.Units.gridUnit * 5
|
||||
cellHeight: Kirigami.Units.gridUnit * 5 + Kirigami.Units.smallSpacing
|
||||
cellWidth: Kirigami.Units.gridUnit * 5
|
||||
|
||||
implicitWidth: cellWidth * 5
|
||||
implicitHeight: cellHeight * 2
|
||||
@ -125,8 +126,8 @@ GridView {
|
||||
delegate: MouseArea {
|
||||
id: delegateRoot
|
||||
|
||||
width: PlasmaCore.Units.gridUnit * 5
|
||||
height: PlasmaCore.Units.gridUnit * 4
|
||||
width: Kirigami.Units.gridUnit * 5
|
||||
height: Kirigami.Units.gridUnit * 4
|
||||
|
||||
property int visualIndex: DelegateModel.itemsIndex
|
||||
|
||||
|
@ -21,6 +21,7 @@ import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kquickcontrolsaddons as KQuickAddons
|
||||
import org.kde.kirigami 2.5 as Kirigami
|
||||
|
||||
@ -38,8 +39,8 @@ ColumnLayout {
|
||||
|
||||
Kirigami.FormData.label: i18n("Icon:")
|
||||
|
||||
implicitWidth: previewFrame.width + PlasmaCore.Units.smallSpacing * 2
|
||||
implicitHeight: previewFrame.height + PlasmaCore.Units.smallSpacing * 2
|
||||
implicitWidth: previewFrame.width + Kirigami.Units.smallSpacing * 2
|
||||
implicitHeight: previewFrame.height + Kirigami.Units.smallSpacing * 2
|
||||
|
||||
KQuickAddons.IconDialog {
|
||||
id: iconDialog
|
||||
@ -53,12 +54,12 @@ ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
imagePath: plasmoid.location === PlasmaCore.Types.Vertical || plasmoid.location === PlasmaCore.Types.Horizontal
|
||||
? "widgets/panel-background" : "widgets/background"
|
||||
width: PlasmaCore.Units.iconSizes.large + fixedMargins.left + fixedMargins.right
|
||||
height: PlasmaCore.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom
|
||||
width: Kirigami.Units.iconSizes.large + fixedMargins.left + fixedMargins.right
|
||||
height: Kirigami.Units.iconSizes.large + fixedMargins.top + fixedMargins.bottom
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
Kirigami.Icon {
|
||||
anchors.centerIn: parent
|
||||
width: PlasmaCore.Units.iconSizes.large
|
||||
width: Kirigami.Units.iconSizes.large
|
||||
height: width
|
||||
source: cfg_icon
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import QtQuick 2.0
|
||||
import org.kde.kquickcontrolsaddons as KQuickControlsAddons
|
||||
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.draganddrop 2.0
|
||||
@ -32,7 +33,7 @@ import org.kde.plasma.private.kicker 0.1 as Kicker
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: PlasmaCore.Units.largeSpacing
|
||||
anchors.topMargin: Kirigami.Units.gridUnit
|
||||
|
||||
objectName: "FavoritesView"
|
||||
|
||||
|
@ -23,6 +23,7 @@ import QtQuick 2.3
|
||||
import org.kde.plasma.plasmoid 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
@ -31,10 +32,10 @@ import org.kde.plasma.private.kicker 0.1 as Kicker
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 26
|
||||
Layout.minimumWidth: Kirigami.Units.gridUnit * 26
|
||||
Layout.maximumWidth: Layout.minimumWidth
|
||||
|
||||
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 34
|
||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 34
|
||||
Layout.maximumHeight: Layout.minimumHeight
|
||||
|
||||
property string previousState
|
||||
@ -63,7 +64,7 @@ Item {
|
||||
Kicker.DragHelper {
|
||||
id: dragHelper
|
||||
|
||||
dragIconSize: PlasmaCore.Units.iconSizes.medium
|
||||
dragIconSize: Kirigami.Units.iconSizes.medium
|
||||
onDropped: kickoff.dragSource = null
|
||||
}
|
||||
|
||||
@ -120,7 +121,7 @@ Item {
|
||||
|
||||
Item {
|
||||
id: mainArea
|
||||
anchors.topMargin: mainTabGroup.state == "top" ? PlasmaCore.Units.smallSpacing : 0
|
||||
anchors.topMargin: mainTabGroup.state == "top" ? Kirigami.Units.smallSpacing : 0
|
||||
|
||||
PlasmaComponents.TabGroup {
|
||||
id: mainTabGroup
|
||||
@ -207,7 +208,7 @@ Item {
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tabBar
|
||||
width: (tabBar.opacity == 0) ? 0 : PlasmaCore.Units.gridUnit * 5
|
||||
width: (tabBar.opacity == 0) ? 0 : Kirigami.Units.gridUnit * 5
|
||||
}
|
||||
AnchorChanges {
|
||||
target: tabBar
|
||||
@ -259,7 +260,7 @@ Item {
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tabBar
|
||||
height: (tabBar.opacity == 0) ? 0 : PlasmaCore.Units.gridUnit * 5
|
||||
height: (tabBar.opacity == 0) ? 0 : Kirigami.Units.gridUnit * 5
|
||||
}
|
||||
AnchorChanges {
|
||||
target: tabBar
|
||||
@ -311,7 +312,7 @@ Item {
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tabBar
|
||||
width: (tabBar.opacity == 0) ? 0 : PlasmaCore.Units.gridUnit * 5
|
||||
width: (tabBar.opacity == 0) ? 0 : Kirigami.Units.gridUnit * 5
|
||||
}
|
||||
AnchorChanges {
|
||||
target: tabBar
|
||||
@ -363,7 +364,7 @@ Item {
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tabBar
|
||||
height: (tabBar.opacity == 0) ? 0 : PlasmaCore.Units.gridUnit * 5
|
||||
height: (tabBar.opacity == 0) ? 0 : Kirigami.Units.gridUnit * 5
|
||||
}
|
||||
AnchorChanges {
|
||||
target: tabBar
|
||||
@ -398,11 +399,11 @@ Item {
|
||||
property int count: 5 // updated in createButtons()
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: PlasmaCore.Units.longDuration; easing.type: Easing.InQuad; }
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InQuad; }
|
||||
enabled: plasmoid.expanded
|
||||
}
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: PlasmaCore.Units.longDuration; easing.type: Easing.InQuad; }
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InQuad; }
|
||||
enabled: plasmoid.expanded
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.kcoreaddons 1.0 as KCoreAddons
|
||||
@ -33,7 +34,7 @@ import QtGraphicalEffects 1.0
|
||||
PlasmaExtras.PlasmoidHeading {
|
||||
id: header
|
||||
|
||||
implicitHeight: PlasmaCore.Units.gridUnit * 5
|
||||
implicitHeight: Kirigami.Units.gridUnit * 5
|
||||
|
||||
property alias query: queryField.text
|
||||
property Item input: queryField
|
||||
@ -77,15 +78,15 @@ PlasmaExtras.PlasmoidHeading {
|
||||
|
||||
flat: true
|
||||
|
||||
Layout.preferredWidth: PlasmaCore.Units.gridUnit * 3
|
||||
Layout.preferredHeight: PlasmaCore.Units.gridUnit * 3
|
||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 3
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 3
|
||||
|
||||
Kirigami.Avatar {
|
||||
source: kuser.faceIconUrl
|
||||
name: nameLabel
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: PlasmaCore.Units.smallSpacing
|
||||
margins: Kirigami.Units.smallSpacing
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,13 +97,13 @@ PlasmaExtras.PlasmoidHeading {
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: PlasmaCore.Units.gridUnit
|
||||
Layout.rightMargin: Kirigami.Units.gridUnit
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: PlasmaCore.Units.gridUnit
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit
|
||||
|
||||
PlasmaExtras.Heading {
|
||||
Kirigami.Heading {
|
||||
id: nameLabel
|
||||
anchors.fill: parent
|
||||
|
||||
@ -112,7 +113,7 @@ PlasmaExtras.PlasmoidHeading {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignBottom
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: PlasmaCore.Units.longDuration; easing.type: Easing.InOutQuad; } }
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } }
|
||||
|
||||
// Show the info instead of the user's name when hovering over it
|
||||
MouseArea {
|
||||
@ -127,7 +128,7 @@ PlasmaExtras.PlasmoidHeading {
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaExtras.Heading {
|
||||
Kirigami.Heading {
|
||||
id: infoLabel
|
||||
anchors.fill: parent
|
||||
level: 5
|
||||
@ -137,7 +138,7 @@ PlasmaExtras.PlasmoidHeading {
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignBottom
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: PlasmaCore.Units.longDuration; easing.type: Easing.InOutQuad; } }
|
||||
Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
|
||||
@ -31,7 +32,7 @@ PlasmaComponents.TabButton {
|
||||
|
||||
Item {
|
||||
anchors {
|
||||
margins: PlasmaCore.Units.smallSpacing
|
||||
margins: Kirigami.Units.smallSpacing
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -39,11 +40,11 @@ PlasmaComponents.TabButton {
|
||||
|
||||
height: childrenRect.height
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
Kirigami.Icon {
|
||||
id: iconElement
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: PlasmaCore.Units.iconSizes.medium
|
||||
width: Kirigami.Units.iconSizes.medium
|
||||
height: width
|
||||
|
||||
source: iconSource
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import QtQuick.Controls 1.0 as QtControls
|
||||
import QtQuick.Layouts 1.1
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
@ -28,8 +29,8 @@ PlasmaCore.FrameSvgItem {
|
||||
property alias text: textElement.text
|
||||
property string name
|
||||
|
||||
width: PlasmaCore.Units.gridUnit * 5
|
||||
height: PlasmaCore.Units.gridUnit * 4
|
||||
width: Kirigami.Units.gridUnit * 5
|
||||
height: Kirigami.Units.gridUnit * 4
|
||||
|
||||
visible: name != "empty"
|
||||
|
||||
@ -38,11 +39,11 @@ PlasmaCore.FrameSvgItem {
|
||||
ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
Kirigami.Icon {
|
||||
id: iconElement
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.preferredWidth: PlasmaCore.Units.iconSizes.medium
|
||||
Layout.preferredWidth: Kirigami.Units.iconSizes.medium
|
||||
Layout.preferredHeight: width
|
||||
|
||||
source: icon
|
||||
|
@ -18,14 +18,15 @@
|
||||
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
|
||||
Item {
|
||||
PlasmaComponents.Highlight {
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: PlasmaCore.Units.smallSpacing * 4
|
||||
rightMargin: PlasmaCore.Units.smallSpacing * 4
|
||||
leftMargin: Kirigami.Units.smallSpacing * 4
|
||||
rightMargin: Kirigami.Units.smallSpacing * 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.draganddrop 2.0
|
||||
|
||||
@ -31,7 +32,7 @@ Item {
|
||||
enabled: !model.disabled
|
||||
|
||||
width: ListView.view.width
|
||||
height: (PlasmaCore.Units.smallSpacing * 2) + Math.max(elementIcon.height, titleElement.implicitHeight + subTitleElement.implicitHeight)
|
||||
height: (Kirigami.Units.smallSpacing * 2) + Math.max(elementIcon.height, titleElement.implicitHeight + subTitleElement.implicitHeight)
|
||||
|
||||
signal reset
|
||||
signal actionTriggered(string actionId, variant actionArgument)
|
||||
@ -97,15 +98,15 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
Kirigami.Icon {
|
||||
id: elementIcon
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: PlasmaCore.Units.smallSpacing * 6
|
||||
leftMargin: Kirigami.Units.smallSpacing * 6
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
width: PlasmaCore.Units.iconSizes.medium
|
||||
width: Kirigami.Units.iconSizes.medium
|
||||
height: width
|
||||
|
||||
animated: false
|
||||
@ -122,8 +123,8 @@ Item {
|
||||
//bottom: elementIcon.verticalCenter
|
||||
left: elementIcon.right
|
||||
right: arrow.left
|
||||
leftMargin: PlasmaCore.Units.smallSpacing * 4
|
||||
rightMargin: PlasmaCore.Units.smallSpacing * 6
|
||||
leftMargin: Kirigami.Units.smallSpacing * 4
|
||||
rightMargin: Kirigami.Units.smallSpacing * 6
|
||||
}
|
||||
height: implicitHeight //undo PC2 height override, remove when porting to PC3
|
||||
// TODO: games should always show the by name!
|
||||
@ -154,11 +155,11 @@ Item {
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: PlasmaCore.Units.smallSpacing * 6
|
||||
rightMargin: Kirigami.Units.smallSpacing * 6
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
width: visible ? PlasmaCore.Units.iconSizes.small : 0
|
||||
width: visible ? Kirigami.Units.iconSizes.small : 0
|
||||
height: width
|
||||
|
||||
visible: (model.hasChildren === true)
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
|
||||
@ -175,10 +176,10 @@ FocusScope {
|
||||
if (pressed && pressX != -1 && pressed.url && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y)) {
|
||||
kickoff.dragSource = item;
|
||||
if (mouse.source == Qt.MouseEventSynthesizedByQt) {
|
||||
dragHelper.dragIconSize = PlasmaCore.Units.iconSizes.huge
|
||||
dragHelper.dragIconSize = Kirigami.Units.iconSizes.huge
|
||||
dragHelper.startDrag(kickoff, pressed.url, pressed.decoration);
|
||||
} else {
|
||||
dragHelper.dragIconSize = PlasmaCore.Units.iconSizes.medium
|
||||
dragHelper.dragIconSize = Kirigami.Units.iconSizes.medium
|
||||
dragHelper.startDrag(kickoff, pressed.url, pressed.decoration);
|
||||
}
|
||||
pressed = null;
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
import QtQuick 2.0
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
|
||||
@ -28,21 +29,21 @@ Item {
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
PlasmaExtras.Heading {
|
||||
Kirigami.Heading {
|
||||
id: sectionHeading
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: PlasmaCore.Units.gridUnit
|
||||
leftMargin: Kirigami.Units.gridUnit
|
||||
}
|
||||
|
||||
y: Math.round(PlasmaCore.Units.gridUnit / 4)
|
||||
y: Math.round(Kirigami.Units.gridUnit / 4)
|
||||
level: 4
|
||||
text: section
|
||||
}
|
||||
Item {
|
||||
width: parent.width
|
||||
height: Math.round(PlasmaCore.Units.gridUnit / 4)
|
||||
height: Math.round(Kirigami.Units.gridUnit / 4)
|
||||
anchors.left: parent.left
|
||||
anchors.top: sectionHeading.bottom
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import QtQuick.Layouts 1.1
|
||||
|
||||
import org.kde.plasma.plasmoid
|
||||
import org.kde.plasma.core as PlasmaCore
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components as PlasmaComponents
|
||||
import org.kde.plasma.extras as PlasmaExtras
|
||||
import org.kde.kquickcontrolsaddons
|
||||
@ -39,8 +40,8 @@ PlasmoidItem {
|
||||
|| plasmoid.location === PlasmaCore.Types.LeftEdge)
|
||||
readonly property bool vertical: (plasmoid.formFactor === PlasmaCore.Types.Vertical)
|
||||
|
||||
Plasmoid.switchWidth: PlasmaCore.Units.gridUnit * 20
|
||||
Plasmoid.switchHeight: PlasmaCore.Units.gridUnit * 30
|
||||
Plasmoid.switchWidth: Kirigami.Units.gridUnit * 20
|
||||
Plasmoid.switchHeight: Kirigami.Units.gridUnit * 30
|
||||
|
||||
Plasmoid.fullRepresentation: FullRepresentation {}
|
||||
|
||||
@ -51,23 +52,23 @@ PlasmoidItem {
|
||||
|
||||
Layout.minimumWidth: {
|
||||
if (!inPanel) {
|
||||
return PlasmaCore.Units.iconSizeHints.panel;
|
||||
return Kirigami.Units.iconSizeHints.panel;
|
||||
}
|
||||
|
||||
if (vertical) {
|
||||
return -1;
|
||||
} else {
|
||||
return Math.min(PlasmaCore.Units.iconSizeHints.panel, parent.height) * buttonIcon.aspectRatio;
|
||||
return Math.min(Kirigami.Units.iconSizeHints.panel, parent.height) * buttonIcon.aspectRatio;
|
||||
}
|
||||
}
|
||||
|
||||
Layout.minimumHeight: {
|
||||
if (!inPanel) {
|
||||
return PlasmaCore.Units.iconSizeHints.panel;
|
||||
return Kirigami.Units.iconSizeHints.panel;
|
||||
}
|
||||
|
||||
if (vertical) {
|
||||
return Math.min(PlasmaCore.Units.iconSizeHints.panel, parent.width) * buttonIcon.aspectRatio;
|
||||
return Math.min(Kirigami.Units.iconSizeHints.panel, parent.width) * buttonIcon.aspectRatio;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
@ -79,9 +80,9 @@ PlasmoidItem {
|
||||
}
|
||||
|
||||
if (vertical) {
|
||||
return PlasmaCore.Units.iconSizeHints.panel;
|
||||
return Kirigami.Units.iconSizeHints.panel;
|
||||
} else {
|
||||
return Math.min(PlasmaCore.Units.iconSizeHints.panel, parent.height) * buttonIcon.aspectRatio;
|
||||
return Math.min(Kirigami.Units.iconSizeHints.panel, parent.height) * buttonIcon.aspectRatio;
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,9 +92,9 @@ PlasmoidItem {
|
||||
}
|
||||
|
||||
if (vertical) {
|
||||
return Math.min(PlasmaCore.Units.iconSizeHints.panel, parent.width) * buttonIcon.aspectRatio;
|
||||
return Math.min(Kirigami.Units.iconSizeHints.panel, parent.width) * buttonIcon.aspectRatio;
|
||||
} else {
|
||||
return PlasmaCore.Units.iconSizeHints.panel;
|
||||
return Kirigami.Units.iconSizeHints.panel;
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +114,7 @@ PlasmoidItem {
|
||||
onTriggered: plasmoid.expanded = true
|
||||
}
|
||||
|
||||
PlasmaCore.IconItem {
|
||||
Kirigami.Icon {
|
||||
id: buttonIcon
|
||||
|
||||
readonly property double aspectRatio: (vertical ? implicitHeight / implicitWidth
|
||||
|
Reference in New Issue
Block a user