convert location to Plasma::Types::Location
This commit is contained in:
parent
b983ab2c72
commit
55d973385e
@ -36,8 +36,6 @@ namespace Plasma {
|
||||
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
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -106,11 +106,11 @@ PlasmaCore.FrameSvgItem {
|
||||
}
|
||||
duration: 150
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
target: configDialog
|
||||
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
|
||||
to: {
|
||||
panel.height
|
||||
switch (panel.location) {
|
||||
//TopEdge
|
||||
case 3:
|
||||
|
@ -107,6 +107,8 @@ PlasmaComponents.ToolButton {
|
||||
panel.location = newLocation
|
||||
print("New Location: " + newLocation);
|
||||
}
|
||||
onReleased: panelResetAnimation.running = true
|
||||
onReleased: {
|
||||
panelResetAnimation.running = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,9 @@ PlasmaCore.FrameSvgItem {
|
||||
property Item containment
|
||||
|
||||
function adjustBorders() {
|
||||
if (!containment) {
|
||||
return;
|
||||
}
|
||||
var borders = PlasmaCore.FrameSvg.AllBorders;
|
||||
|
||||
switch (containment.location) {
|
||||
|
@ -136,14 +136,12 @@ Plasma::Containment *View::containment() const
|
||||
return m_containment.data();
|
||||
}
|
||||
|
||||
//FIXME: wrong types
|
||||
void View::setLocation(int location)
|
||||
void View::setLocation(Plasma::Types::Location location)
|
||||
{
|
||||
m_containment.data()->setLocation((Plasma::Types::Location)location);
|
||||
m_containment.data()->setLocation(location);
|
||||
}
|
||||
|
||||
//FIXME: wrong types
|
||||
int View::location() const
|
||||
Plasma::Types::Location View::location() const
|
||||
{
|
||||
if (!m_containment) {
|
||||
return Plasma::Types::Desktop;
|
||||
|
@ -30,7 +30,7 @@
|
||||
class View : public QQuickView
|
||||
{
|
||||
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)
|
||||
|
||||
public:
|
||||
@ -44,9 +44,8 @@ public:
|
||||
void setContainment(Plasma::Containment *cont);
|
||||
Plasma::Containment *containment() const;
|
||||
|
||||
//FIXME: Plasma::Types::Location should be something qml can understand
|
||||
int location() const;
|
||||
void setLocation(int location);
|
||||
Plasma::Types::Location location() const;
|
||||
void setLocation(Plasma::Types::Location location);
|
||||
|
||||
Plasma::Types::FormFactor formFactor() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user