Commit f4195688 authored by Niccolò Venerandi's avatar Niccolò Venerandi

Created a top area based on widgets/toparea.svg

Summary:
This add a top area based on the current theme. If the file is not in the current theme, said area is not shown.

Problem: the header is moved to the right by the Svg element, and I'm not sure how to align it correctly anymore.

Depends on D27695

Test Plan: {F8088058}

Reviewers: #vdg, #plasma, ngraham

Reviewed By: #vdg, ngraham

Subscribers: mart, ngraham, ndavis, plasma-devel

Tags: #plasma

Maniphest Tasks: T10470

Differential Revision: https://phabricator.kde.org/D27189
parent 3f0ca0da
......@@ -40,72 +40,76 @@ ColumnLayout {
property alias activeApplet: container.activeApplet
property alias hiddenLayout: hiddenItemsView.layout
RowLayout {
PlasmaExtras.Heading {
id: heading
Layout.fillWidth: true
level: 1
Layout.leftMargin: {
//Menu mode
if (!activeApplet && hiddenItemsView.visible && !LayoutMirroring.enabled) {
return units.smallSpacing;
//applet open, sidebar
} else if (activeApplet && hiddenItemsView.visible && !LayoutMirroring.enabled) {
return hiddenItemsView.width + units.largeSpacing;
//applet open, no sidebar
} else {
return units.smallSpacing;
PlasmaExtras.PlasmoidHeading {
RowLayout {
anchors.fill: parent
PlasmaExtras.Heading {
id: heading
Layout.fillWidth: true
level: 1
Layout.leftMargin: {
//Menu mode
if (!activeApplet && hiddenItemsView.visible && !LayoutMirroring.enabled) {
return units.smallSpacing;
//applet open, sidebar
} else if (activeApplet && hiddenItemsView.visible && !LayoutMirroring.enabled) {
return hiddenItemsView.width + units.largeSpacing;
//applet open, no sidebar
} else {
return units.smallSpacing;
}
}
}
Layout.rightMargin: {
//Menu mode
if (!activeApplet && hiddenItemsView.visible && LayoutMirroring.enabled) {
return units.smallSpacing;
//applet open, sidebar
} else if (activeApplet && hiddenItemsView.visible && LayoutMirroring.enabled) {
return hiddenItemsView.width + units.largeSpacing;
//applet open, no sidebar
} else {
return 0;
Layout.rightMargin: {
//Menu mode
if (!activeApplet && hiddenItemsView.visible && LayoutMirroring.enabled) {
return units.smallSpacing;
//applet open, sidebar
} else if (activeApplet && hiddenItemsView.visible && LayoutMirroring.enabled) {
return hiddenItemsView.width + units.largeSpacing;
//applet open, no sidebar
} 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
visible: !activeApplet
Layout.fillWidth: true
level: 1
text: i18n("Status and Notifications")
}
PlasmaExtras.Heading {
id: noAppletHeading
visible: !activeApplet
Layout.fillWidth: true
level: 1
text: i18n("Status and Notifications")
}
PlasmaComponents.ToolButton {
id: pinButton
implicitHeight: Math.round(units.gridUnit * 1.25)
implicitWidth: implicitHeight
checkable: true
checked: plasmoid.configuration.pin
onToggled: plasmoid.configuration.pin = checked
icon.name: "window-pin"
PlasmaComponents.ToolTip {
text: i18n("Keep Open")
PlasmaComponents.ToolButton {
id: pinButton
implicitHeight: Math.round(units.gridUnit * 1.25)
implicitWidth: implicitHeight
checkable: true
checked: plasmoid.configuration.pin
onToggled: plasmoid.configuration.pin = checked
icon.name: "window-pin"
PlasmaComponents.ToolTip {
text: i18n("Keep Open")
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment