mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 04:42:05 -04:00
launcher v2: remove calc cc: enhancements for plugins to size details
This commit is contained in:
@@ -15,18 +15,22 @@ Item {
|
||||
property var pluginDetailInstance: null
|
||||
property var widgetModel: null
|
||||
property var collapseCallback: null
|
||||
property real maxAvailableHeight: 9999
|
||||
|
||||
function getDetailHeight(section) {
|
||||
const maxAvailable = parent ? parent.height - Theme.spacingS : 9999;
|
||||
switch (true) {
|
||||
case section === "wifi":
|
||||
case section === "bluetooth":
|
||||
case section === "builtin_vpn":
|
||||
return Math.min(350, maxAvailable);
|
||||
return Math.min(350, maxAvailableHeight);
|
||||
case section.startsWith("brightnessSlider_"):
|
||||
return Math.min(400, maxAvailable);
|
||||
return Math.min(400, maxAvailableHeight);
|
||||
case section.startsWith("plugin_"):
|
||||
if (pluginDetailInstance?.ccDetailHeight)
|
||||
return Math.min(pluginDetailInstance.ccDetailHeight, maxAvailableHeight);
|
||||
return Math.min(250, maxAvailableHeight);
|
||||
default:
|
||||
return Math.min(250, maxAvailable);
|
||||
return Math.min(250, maxAvailableHeight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,26 @@ Column {
|
||||
|
||||
spacing: editMode ? Theme.spacingL : Theme.spacingS
|
||||
|
||||
property real maxPopoutHeight: 9999
|
||||
property var currentRowWidgets: []
|
||||
property real currentRowWidth: 0
|
||||
property int expandedRowIndex: -1
|
||||
property var colorPickerModal: null
|
||||
|
||||
readonly property real _maxDetailHeight: {
|
||||
const rows = layoutResult.rows;
|
||||
let totalRowHeight = 0;
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
const sliderOnly = rows[i].every(w => {
|
||||
const id = w.id || "";
|
||||
return id === "volumeSlider" || id === "brightnessSlider" || id === "inputVolumeSlider";
|
||||
});
|
||||
totalRowHeight += sliderOnly ? 36 : 60;
|
||||
}
|
||||
const rowSpacing = Math.max(0, rows.length - 1) * spacing;
|
||||
return Math.max(100, maxPopoutHeight - totalRowHeight - rowSpacing);
|
||||
}
|
||||
|
||||
function calculateRowsAndWidgets() {
|
||||
return LayoutUtils.calculateRowsAndWidgets(root, expandedSection, expandedWidgetIndex);
|
||||
}
|
||||
@@ -163,6 +178,7 @@ Column {
|
||||
DetailHost {
|
||||
id: detailHost
|
||||
width: parent.width
|
||||
maxAvailableHeight: root._maxDetailHeight
|
||||
height: active ? (getDetailHeight(root.expandedSection) + Theme.spacingS) : 0
|
||||
property bool active: {
|
||||
if (root.expandedSection === "")
|
||||
|
||||
@@ -116,6 +116,7 @@ DankPopout {
|
||||
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
||||
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
@@ -166,6 +167,10 @@ DankPopout {
|
||||
id: widgetGrid
|
||||
width: parent.width
|
||||
editMode: root.editMode
|
||||
maxPopoutHeight: {
|
||||
const screenHeight = (root.triggerScreen?.height ?? 1080);
|
||||
return screenHeight - 100 - Theme.spacingL - headerPane.height - Theme.spacingS;
|
||||
}
|
||||
expandedSection: root.expandedSection
|
||||
expandedWidgetIndex: root.expandedWidgetIndex
|
||||
expandedWidgetData: root.expandedWidgetData
|
||||
|
||||
Reference in New Issue
Block a user