Merge branch 'master' into sebas/kplugins

wilder-5.14
Sebastian Kügler 13 years ago
commit 57e4d373a7
  1. 3
      applets/testapplet/contents/ui/main.qml
  2. 2
      applets/testcomponentsapplet/contents/ui/testcomponents.qml
  3. 2
      applets/testshaderapplet/contents/ui/testshaderapplet.qml
  4. 2
      containments/CMakeLists.txt
  5. 25
      containments/testpanel/contents/ui/main.qml
  6. 5
      panelview.cpp
  7. 2
      panelview.h
  8. 14
      qmlpackages/desktop/contents/applet/CompactApplet.qml
  9. 4
      qmlpackages/desktop/contents/configuration/panelconfiguration/ToolBar.qml
  10. 65
      qmlpackages/desktop/contents/views/Panel.qml
  11. 1
      qmlpackages/desktop/metadata.desktop
  12. 1
      qmlpackages/wallpapers/autumn/metadata.desktop

@ -28,6 +28,8 @@ Rectangle {
height: 100
radius: 10
smooth: true
property int minimumWidth: units.gridUnit * 20
property int minimumHeight: column.implicitHeight
property Component compactRepresentation: Component {
Rectangle {
@ -39,6 +41,7 @@ Rectangle {
}
Column {
id: column
anchors.centerIn: parent
Text {
text: "I'm an applet"

@ -28,6 +28,8 @@ Item {
width: 100
height: 100
clip: true
property int minimumWidth: units.gridUnit * 20
property int minimumHeight: units.gridUnit * 30
property int _s: theme.iconSizes.small
property int _h: theme.iconSizes.desktop

@ -28,6 +28,8 @@ Item {
width: 400
height: 400
property int minimumWidth: units.gridUnit * 20
property int minimumHeight: units.gridUnit * 30
property int _s: theme.iconSizes.small
property int _h: theme.iconSizes.desktop
property int _m: 12

@ -1,3 +1,3 @@
installPackage(testcontainment org.kde.testcontainment plasma/plasmoids containment)
installPackage(testpanel org.kde.panel applets plasma/plasmoids containment)
installPackage(testpanel org.kde.panel plasma/plasmoids containment)

@ -16,7 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.0
import QtQuick 2.1
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
@ -32,7 +33,7 @@ Item {
Connections {
target: plasmoid
onAppletAdded: {
var container = appletContainerComponent.createObject((plasmoid.formFactor == 3) ? column : row)
var container = appletContainerComponent.createObject((plasmoid.formFactor == PlasmaCore.Types.Vertical) ? column : row)
print("Applet added in test panel: " + applet)
applet.parent = container
container.applet = applet
@ -41,13 +42,17 @@ Item {
container.visible = true
}
onFormFactorChanged: {
if (plasmoid.formFactor == 3) {
if (plasmoid.formFactor == PlasmaCore.Types.Vertical) {
for (var container in row.children) {
container.parent = column
var item = row.children[0];
item.parent = column
item.width = column.width
}
} else {
for (var container in column.children) {
container.parent = row
var item = column.children[0];
item.parent = row
item.height = row.height
}
}
}
@ -59,11 +64,11 @@ Item {
id: container
visible: false
width: Math.min(root.width, root.height)
height: width
Layout.preferredWidth: Math.min(root.width, root.height)
Layout.preferredHeight: Layout.preferredWidth
property Item applet
property Item applet
PlasmaComponents.BusyIndicator {
z: 1000
@ -74,7 +79,7 @@ Item {
}
}
Row {
RowLayout {
id: row
anchors {
top: parent.top
@ -82,7 +87,7 @@ Item {
left: parent.left
}
}
Column {
ColumnLayout {
id: column
anchors {
top: parent.top

@ -22,6 +22,8 @@
#include <QAction>
#include <QDebug>
#include <QScreen>
#include <QQmlEngine>
#include <QQmlContext>
#include <KActionCollection>
#include <KWindowSystem>
@ -100,6 +102,8 @@ void PanelView::init()
}
setResizeMode(View::SizeRootObjectToView);
qmlRegisterType<QScreen>();
engine()->rootContext()->setContextProperty("panel", this);
setSource(QUrl::fromLocalFile(m_corona->package().filePath("views", "Panel.qml")));
positionPanel();
}
@ -367,6 +371,7 @@ void PanelView::restore()
emit maximumLengthChanged();
emit minimumLengthChanged();
emit offsetChanged();
emit alignmentChanged();
}
void PanelView::resizeEvent(QResizeEvent *ev)

@ -35,6 +35,7 @@ class PanelView : public View
Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged)
Q_PROPERTY(int maximumLength READ maximumLength WRITE setMaximumLength NOTIFY maximumLengthChanged)
Q_PROPERTY(int minimumLength READ minimumLength WRITE setMinimumLength NOTIFY minimumLengthChanged)
Q_PROPERTY(QScreen *screen READ screen NOTIFY screenChanged)
public:
explicit PanelView(DesktopCorona *corona, QWindow *parent = 0);
@ -73,6 +74,7 @@ Q_SIGNALS:
void lengthChanged();
void maximumLengthChanged();
void minimumLengthChanged();
void screenChanged(QScreen *screen);
private Q_SLOTS:
void positionPanel();

@ -25,10 +25,20 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
id: root
property int minimumWidth: compactRepresentation && compactRepresentation.minimumWidth !== undefined ? compactRepresentation.minimumWidth : -1
property int minimumHeight: compactRepresentation && compactRepresentation.minimumHeight !== undefined ? compactRepresentation.minimumHeight : -1
property int maximumWidth: compactRepresentation && compactRepresentation.maximumWidth !== undefined ? compactRepresentation.maximumWidth : -1
property int maximumHeight: compactRepresentation && compactRepresentation.maximumHeight !== undefined ? compactRepresentation.maximumHeight : -1
property int implicitWidth: compactRepresentation && compactRepresentation.implicitWidth !== undefined ? compactRepresentation.implicitWidth : -1
property int implicitHeight: compactRepresentation && compactRepresentation.implicitHeight !== undefined ? compactRepresentation.implicitHeight : -1
property Item applet
property Item compactRepresentation
onAppletChanged: {
applet.parent = appletParent
applet.anchors.fill = applet.parent
@ -48,7 +58,7 @@ Item {
mainItem: Item {
id: appletParent
width: applet && applet.implicitWidth > 0 ? applet.implicitWidth : theme.mSize(theme.defaultFont).width * 35
width: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).width * 35
height: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).height * 25
onWidthChanged: applet.width = width
onHeightChanged: applet.height = height

@ -25,8 +25,8 @@ import org.kde.plasma.configuration 2.0
Item {
id: root
state: parent.state
implicitWidth: childrenRect.width + 20
implicitHeight: childrenRect.height + 20
implicitWidth: column.width + 20
implicitHeight: row.height + 20
PlasmaComponents.ButtonRow {
id: row
spacing: 0

@ -30,6 +30,41 @@ PlasmaCore.FrameSvgItem {
property Item containment
function adjustBorders() {
var borders = PlasmaCore.FrameSvg.AllBorders;
switch (containment.location) {
case PlasmaCore.Types.TopEdge:
borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
break;
case PlasmaCore.Types.LeftEdge:
borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
break;
case PlasmaCore.Types.RightEdge:
borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
break;
case PlasmaCore.Types.BottomEdge:
default:
borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
break;
}
if (panel.x <= panel.screen.geometry.x) {
borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
}
if (panel.x + panel.width >= panel.screen.geometry.x + panel.screen.geometry.width) {
borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
}
if (panel.y <= panel.screen.geometry.y) {
borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
}
if (panel.y + panel.height >= panel.screen.geometry.y + panel.screen.geometry.height) {
borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
}
root.enabledBorders = borders;
}
onContainmentChanged: {
print("New panel Containment: " + containment)
//containment.parent = root
@ -37,6 +72,36 @@ PlasmaCore.FrameSvgItem {
containment.anchors.fill = root
}
Connections {
target: containment
onLocationChanged: {
adjustBorders()
}
}
Connections {
target: panel
onXChanged: {
adjustBorders();
}
onYChanged: {
adjustBorders();
}
onWidthChanged: {
adjustBorders();
}
onHeightChanged: {
adjustBorders();
}
}
Connections {
target: panel.screen
onGeometryChanged: {
adjustBorders();
}
}
Component.onCompleted: {
print("PanelView QML loaded")
}

@ -12,6 +12,7 @@ Comment[x-test]=xxDesktop view furniturexx
Encoding=UTF-8
Keywords=
Name=Desktop
Name[bs]=Površ
Name[cs]=Pracovní plocha
Name[de]=Arbeitsfläche
Name[es]=Escritorio

@ -2,6 +2,7 @@
Encoding=UTF-8
Keywords=
Name=Autumn
Name[bs]=Jesen
Name[cs]=Podzim
Name[de]=Herbst
Name[es]=Otoño

Loading…
Cancel
Save