convert location to Plasma::Types::Location

This commit is contained in:
Marco Martin 2013-09-03 15:44:13 +02:00
parent b983ab2c72
commit 55d973385e
6 changed files with 13 additions and 13 deletions

View File

@ -36,8 +36,6 @@ namespace Plasma {
class Containment; class Containment;
} }
//TODO: this should be a subclass of ConfigView currently in the scriptengine
//TODO: that class should be moved here
class PanelConfigView : public ConfigView class PanelConfigView : public ConfigView
{ {
Q_OBJECT Q_OBJECT

View File

@ -106,11 +106,11 @@ PlasmaCore.FrameSvgItem {
} }
duration: 150 duration: 150
} }
NumberAnimation { NumberAnimation {
target: configDialog target: configDialog
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y" properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
to: { to: {
panel.height
switch (panel.location) { switch (panel.location) {
//TopEdge //TopEdge
case 3: case 3:

View File

@ -107,6 +107,8 @@ PlasmaComponents.ToolButton {
panel.location = newLocation panel.location = newLocation
print("New Location: " + newLocation); print("New Location: " + newLocation);
} }
onReleased: panelResetAnimation.running = true onReleased: {
panelResetAnimation.running = true
}
} }
} }

View File

@ -31,6 +31,9 @@ PlasmaCore.FrameSvgItem {
property Item containment property Item containment
function adjustBorders() { function adjustBorders() {
if (!containment) {
return;
}
var borders = PlasmaCore.FrameSvg.AllBorders; var borders = PlasmaCore.FrameSvg.AllBorders;
switch (containment.location) { switch (containment.location) {

View File

@ -136,14 +136,12 @@ Plasma::Containment *View::containment() const
return m_containment.data(); return m_containment.data();
} }
//FIXME: wrong types void View::setLocation(Plasma::Types::Location location)
void View::setLocation(int location)
{ {
m_containment.data()->setLocation((Plasma::Types::Location)location); m_containment.data()->setLocation(location);
} }
//FIXME: wrong types Plasma::Types::Location View::location() const
int View::location() const
{ {
if (!m_containment) { if (!m_containment) {
return Plasma::Types::Desktop; return Plasma::Types::Desktop;

View File

@ -30,7 +30,7 @@
class View : public QQuickView class View : public QQuickView
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int location READ location WRITE setLocation NOTIFY locationChanged) Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
Q_PROPERTY(QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged) Q_PROPERTY(QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
public: public:
@ -44,9 +44,8 @@ public:
void setContainment(Plasma::Containment *cont); void setContainment(Plasma::Containment *cont);
Plasma::Containment *containment() const; Plasma::Containment *containment() const;
//FIXME: Plasma::Types::Location should be something qml can understand Plasma::Types::Location location() const;
int location() const; void setLocation(Plasma::Types::Location location);
void setLocation(int location);
Plasma::Types::FormFactor formFactor() const; Plasma::Types::FormFactor formFactor() const;