Commit a4a978a3 authored by Marco Martin's avatar Marco Martin
Browse files

manage constrained formfactor

constrained formfactor is used by ksysguardqml.
in there the faces can get really small, especially in edit mode and
must be able to scale down as much as possible
parent ab250412
......@@ -38,7 +38,8 @@ public:
enum FormFactor {
Planar,
Vertical,
Horizontal
Horizontal,
Constrained
};
Q_ENUM(FormFactor)
......
......@@ -59,7 +59,9 @@ Faces.SensorFace {
id: compactRepresentation
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumHeight: 5 * Kirigami.Units.gridUnit
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Constrained
? Kirigami.Units.gridUnit
: 5 * Kirigami.Units.gridUnit
Layout.preferredHeight: 8 * Kirigami.Units.gridUnit
Layout.maximumHeight: Math.max(root.width, Layout.minimumHeight)
}
......@@ -68,7 +70,10 @@ Faces.SensorFace {
Layout.fillWidth: root.width < implicitWidth * 1.5
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.fillHeight: true
Layout.minimumHeight: root.formFactor !== Faces.SensorFace.Planar ? implicitHeight : -1
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Horizontal
|| root.formFactor === Faces.SensorFace.Vertical
? implicitHeight
: -1
visible: root.showLegend
chart: compactRepresentation
sourceModel: root.showLegend ? compactRepresentation.sensorsModel : null
......
......@@ -56,7 +56,9 @@ Faces.SensorFace {
id: compactRepresentation
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumHeight: 3 * Kirigami.Units.gridUnit
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Constrained
? Kirigami.Units.gridUnit
: 3 * Kirigami.Units.gridUnit
Layout.preferredHeight: 5 * Kirigami.Units.gridUnit
}
......@@ -64,7 +66,10 @@ Faces.SensorFace {
Layout.fillWidth: root.width < implicitWidth * 1.5
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.fillHeight: true
Layout.minimumHeight: root.formFactor !== Faces.SensorFace.Planar ? implicitHeight : -1
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Horizontal
|| root.formFactor === Faces.SensorFace.Vertical
? implicitHeight
: -1
visible: root.showLegend
chart: compactRepresentation
sourceModel: root.showLegend ? compactRepresentation.sensorsModel : null
......
......@@ -59,7 +59,9 @@ Faces.SensorFace {
id: compactRepresentation
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumHeight: 5 * Kirigami.Units.gridUnit
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Constrained
? Kirigami.Units.gridUnit
: 5 * Kirigami.Units.gridUnit
Layout.preferredHeight: 8 * Kirigami.Units.gridUnit
Layout.maximumHeight: Math.max(root.width, Layout.minimumHeight)
}
......@@ -68,7 +70,10 @@ Faces.SensorFace {
Layout.fillWidth: root.width < implicitWidth * 1.5
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.fillHeight: true
Layout.minimumHeight: root.formFactor !== Faces.SensorFace.Planar ? implicitHeight : -1
Layout.minimumHeight: root.formFactor === Faces.SensorFace.Horizontal
|| root.formFactor === Faces.SensorFace.Vertical
? implicitHeight
: -1
visible: root.showLegend
chart: compactRepresentation.chart
sourceModel: root.showLegend ? compactRepresentation.sensorsModel : null
......
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