Merge branch 'work/plasmoidsCanIgnoreMargins'
This commit is contained in:
commit
6837f0355a
@ -25,6 +25,7 @@ T.BusyIndicator {
|
|||||||
padding: 0
|
padding: 0
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
|
id: baseItem
|
||||||
/* implicitWidth and implicitHeight won't work unless they come
|
/* implicitWidth and implicitHeight won't work unless they come
|
||||||
* from a child of the contentItem. No idea why.
|
* from a child of the contentItem. No idea why.
|
||||||
*/
|
*/
|
||||||
@ -61,7 +62,7 @@ T.BusyIndicator {
|
|||||||
to: 360
|
to: 360
|
||||||
duration: 2000
|
duration: 2000
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
running: visible
|
running: control.running || baseItem.opacity > 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ T.ComboBox {
|
|||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
width: control.popup.width
|
width: control.popup.width
|
||||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
||||||
highlighted: mouseArea.pressed ? listView.currentIndex == index : control.highlightedIndex == index
|
highlighted: control.highlightedIndex == index
|
||||||
property bool separatorVisible: false
|
property bool separatorVisible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,64 +51,7 @@ T.ComboBox {
|
|||||||
elementId: "down-arrow"
|
elementId: "down-arrow"
|
||||||
}
|
}
|
||||||
|
|
||||||
// contentItem: Label {
|
contentItem: T.TextField {
|
||||||
// text: control.displayText
|
|
||||||
// font: control.font
|
|
||||||
// color: theme.buttonTextColor
|
|
||||||
// horizontalAlignment: Text.AlignLeft
|
|
||||||
// verticalAlignment: Text.AlignVCenter
|
|
||||||
// elide: Text.ElideRight
|
|
||||||
// }
|
|
||||||
contentItem: MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
preventStealing: true
|
|
||||||
property int indexUnderMouse: -1
|
|
||||||
onWheel: {
|
|
||||||
if (wheel.pixelDelta.y < 0 || wheel.angleDelta.y < 0) {
|
|
||||||
control.currentIndex = Math.min(control.currentIndex + 1, delegateModel.count -1);
|
|
||||||
} else {
|
|
||||||
control.currentIndex = Math.max(control.currentIndex - 1, 0);
|
|
||||||
}
|
|
||||||
control.activated(control.currentIndex);
|
|
||||||
}
|
|
||||||
onPressed: {
|
|
||||||
indexUnderMouse = -1;
|
|
||||||
listView.currentIndex = control.highlightedIndex
|
|
||||||
control.down = true;
|
|
||||||
control.pressed = true;
|
|
||||||
control.popup.visible = !control.popup.visible;
|
|
||||||
}
|
|
||||||
onReleased: {
|
|
||||||
if (!containsMouse) {
|
|
||||||
control.down = false;
|
|
||||||
control.pressed = false;
|
|
||||||
control.popup.visible = false;
|
|
||||||
}
|
|
||||||
if (indexUnderMouse > -1) {
|
|
||||||
control.currentIndex = indexUnderMouse;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCanceled: {
|
|
||||||
control.down = false;
|
|
||||||
control.pressed = false;
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
var pos = listView.mapFromItem(this, mouse.x, mouse.y);
|
|
||||||
indexUnderMouse = listView.indexAt(pos.x, pos.y);
|
|
||||||
listView.currentIndex = indexUnderMouse;
|
|
||||||
controlRoot.activated(indexUnderMouse);
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: popup
|
|
||||||
onClosed: {
|
|
||||||
control.down = false;
|
|
||||||
control.pressed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
T.TextField {
|
|
||||||
id: textField
|
id: textField
|
||||||
padding: 0
|
padding: 0
|
||||||
anchors {
|
anchors {
|
||||||
@ -159,7 +102,6 @@ T.ComboBox {
|
|||||||
selectWord();
|
selectWord();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: mobileCursor
|
id: mobileCursor
|
||||||
|
@ -421,10 +421,12 @@ Item {
|
|||||||
PlasmaComponents3.Label {
|
PlasmaComponents3.Label {
|
||||||
id: listItemSubtitle
|
id: listItemSubtitle
|
||||||
|
|
||||||
enabled: false
|
|
||||||
visible: text.length > 0
|
visible: text.length > 0
|
||||||
font: PlasmaCore.Theme.smallestFont
|
font: PlasmaCore.Theme.smallestFont
|
||||||
|
|
||||||
|
// Otherwise colored text can be hard to see
|
||||||
|
opacity: color === PlasmaCore.Theme.textColor ? 0.7 : 1.0
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
textFormat: listItem.allowStyledText ? Text.StyledText : Text.PlainText
|
textFormat: listItem.allowStyledText ? Text.StyledText : Text.PlainText
|
||||||
|
@ -179,7 +179,7 @@ void FrameSvg::resizeFrame(const QSizeF &size)
|
|||||||
d->pendingFrameSize = size.toSize();
|
d->pendingFrameSize = size.toSize();
|
||||||
|
|
||||||
if (!d->repaintBlocked) {
|
if (!d->repaintBlocked) {
|
||||||
d->updateFrameData(FrameSvgPrivate::UpdateFrame);
|
d->updateFrameData(Svg::d->lastModified, FrameSvgPrivate::UpdateFrame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,16 @@ public:
|
|||||||
Q_ENUM(Constraint)
|
Q_ENUM(Constraint)
|
||||||
Q_DECLARE_FLAGS(Constraints, Constraint)
|
Q_DECLARE_FLAGS(Constraints, Constraint)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This enumeration lists the various hints that an applet can pass to its
|
||||||
|
* constraint regarding the way that it is represented
|
||||||
|
*/
|
||||||
|
enum ConstraintHints {
|
||||||
|
NoHint = 0,
|
||||||
|
CanFillArea = 1 /**< The applet can fill the area and ignore constraint margins*/
|
||||||
|
};
|
||||||
|
Q_ENUM(ConstraintHints)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The FormFactor enumeration describes how a Plasma::Applet should arrange
|
* The FormFactor enumeration describes how a Plasma::Applet should arrange
|
||||||
* itself. The value is derived from the container managing the Applet
|
* itself. The value is derived from the container managing the Applet
|
||||||
|
@ -605,6 +605,16 @@ bool AppletInterface::hideOnWindowDeactivate() const
|
|||||||
return m_hideOnDeactivate;
|
return m_hideOnDeactivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppletInterface::setConstraintHints(Plasma::Types::ConstraintHints hints)
|
||||||
|
{
|
||||||
|
m_constraintHints = hints;
|
||||||
|
}
|
||||||
|
|
||||||
|
Plasma::Types::ConstraintHints AppletInterface::constraintHints() const
|
||||||
|
{
|
||||||
|
return m_constraintHints;
|
||||||
|
}
|
||||||
|
|
||||||
QKeySequence AppletInterface::globalShortcut() const
|
QKeySequence AppletInterface::globalShortcut() const
|
||||||
{
|
{
|
||||||
return applet()->globalShortcut();
|
return applet()->globalShortcut();
|
||||||
|
@ -239,6 +239,11 @@ class AppletInterface : public PlasmaQuick::AppletQuickItem
|
|||||||
|
|
||||||
Q_PROPERTY(bool loading MEMBER m_loading NOTIFY isLoadingChanged)
|
Q_PROPERTY(bool loading MEMBER m_loading NOTIFY isLoadingChanged)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When false the plasmoid will ignore the margins when contained in a panel
|
||||||
|
*/
|
||||||
|
Q_PROPERTY(Plasma::Types::ConstraintHints constraintHints READ constraintHints WRITE setConstraintHints NOTIFY constraintHintsChanged)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata of the applet.
|
* The metadata of the applet.
|
||||||
* @since 5.73
|
* @since 5.73
|
||||||
@ -410,6 +415,8 @@ public:
|
|||||||
|
|
||||||
QString configurationRequiredReason() const;
|
QString configurationRequiredReason() const;
|
||||||
void setConfigurationRequiredReason(const QString &reason);
|
void setConfigurationRequiredReason(const QString &reason);
|
||||||
|
Plasma::Types::ConstraintHints constraintHints() const;
|
||||||
|
void setConstraintHints(Plasma::Types::ConstraintHints constraintHints);
|
||||||
|
|
||||||
KPluginMetaData metaData() const;
|
KPluginMetaData metaData() const;
|
||||||
|
|
||||||
@ -458,6 +465,7 @@ Q_SIGNALS:
|
|||||||
void associatedApplicationUrlsChanged();
|
void associatedApplicationUrlsChanged();
|
||||||
void availableScreenRegionChanged();
|
void availableScreenRegionChanged();
|
||||||
void availableScreenRectChanged();
|
void availableScreenRectChanged();
|
||||||
|
void constraintHintsChanged();
|
||||||
|
|
||||||
void userConfiguringChanged();
|
void userConfiguringChanged();
|
||||||
void globalShortcutChanged();
|
void globalShortcutChanged();
|
||||||
@ -508,6 +516,7 @@ private:
|
|||||||
friend class ContainmentInterface;
|
friend class ContainmentInterface;
|
||||||
//This is used by ContainmentInterface
|
//This is used by ContainmentInterface
|
||||||
QPointF m_positionBeforeRemoval;
|
QPointF m_positionBeforeRemoval;
|
||||||
|
Plasma::Types::ConstraintHints m_constraintHints = Plasma::Types::ConstraintHints::NoHint;
|
||||||
};
|
};
|
||||||
|
|
||||||
QML_DECLARE_TYPEINFO(AppletInterface, QML_HAS_ATTACHED_PROPERTIES)
|
QML_DECLARE_TYPEINFO(AppletInterface, QML_HAS_ATTACHED_PROPERTIES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user