MediaPlayerPanel: fix layout issues

This commit is contained in:
notiant
2026-04-01 22:28:45 +02:00
committed by GitHub
parent 7b29c11d7a
commit 6a6844b3aa
5 changed files with 8 additions and 18 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ SmartPanel {
if (!view)
return Style.marginL;
var row = launcherCore.isGridView ? Math.floor(launcherCore.selectedIndex / launcherCore.gridColumns) : launcherCore.selectedIndex;
var gridCellSize = Math.floor((root.listPanelWidth - (2 * Style.marginXS) - ((launcherCore.targetGridColumns - 1) * Style.marginS)) / launcherCore.targetGridColumns);
var gridCellSize = Math.floor((root.listPanelWidth - Style.margin2XS - ((launcherCore.targetGridColumns - 1) * Style.marginS)) / launcherCore.targetGridColumns);
var itemHeight = launcherCore.isGridView ? (gridCellSize + Style.marginXXS) : (launcherCore.entryHeight + (view.spacing || 0));
var yPos = row * itemHeight - (view.contentY || 0);
var mapped = view.mapToItem(ui, 0, yPos);
+1 -1
View File
@@ -132,7 +132,7 @@ Rectangle {
return base;
}
readonly property int listPanelWidth: Math.round(500 * Style.uiScaleRatio)
readonly property int gridContentWidth: listPanelWidth - (2 * Style.marginXS)
readonly property int gridContentWidth: listPanelWidth - Style.margin2XS
readonly property int gridCellSize: Math.floor((gridContentWidth - ((targetGridColumns - 1) * Style.marginS)) / targetGridColumns)
readonly property int gridColumns: targetGridColumns
@@ -364,7 +364,7 @@ Variants {
if (!view)
return launcherPanel.y + Style.marginL;
var row = launcherCore.isGridView ? Math.floor(launcherCore.selectedIndex / launcherCore.gridColumns) : launcherCore.selectedIndex;
var gridCellSize = Math.floor((launcherWindow.listPanelWidth - (2 * Style.marginXS) - ((launcherCore.targetGridColumns - 1) * Style.marginS)) / launcherCore.targetGridColumns);
var gridCellSize = Math.floor((launcherWindow.listPanelWidth - Style.margin2XS - ((launcherCore.targetGridColumns - 1) * Style.marginS)) / launcherCore.targetGridColumns);
var itemHeight = launcherCore.isGridView ? (gridCellSize + Style.marginXXS) : (launcherCore.entryHeight + (view.spacing || 0));
var yPos = row * itemHeight - (view.contentY || 0);
var mapped = view.mapToItem(launcherWindow.contentItem, 0, yPos);
+4 -14
View File
@@ -74,16 +74,7 @@ SmartPanel {
id: playerContent
anchors.fill: parent
// implicitHeight + mainLayout vertical anchors.margins (each Style.marginL).
readonly property real contentPreferredHeight: {
const m = mainLayout.implicitHeight + 2 * Style.marginL;
const scale = Style.uiScaleRatio;
if (root.compactMode)
return Math.max(m, 240 * scale);
if (!root.showAlbumArt)
return Math.max(m, 300 * scale);
return Math.max(m, 260 * scale);
}
property real contentPreferredHeight: mainLayout.implicitHeight + Style.margin2L;
property Component visualizerSource: {
switch (root.visualizerType) {
@@ -102,8 +93,7 @@ SmartPanel {
id: mainLayout
anchors.fill: parent
anchors.margins: Style.marginL
spacing: root.compactMode ? Style.marginL : Style.marginM
z: 1
spacing: Style.marginM
NBox {
Layout.fillWidth: true
@@ -238,7 +228,7 @@ SmartPanel {
NBox {
Layout.fillWidth: true
Layout.preferredHeight: mediaContentGrid.implicitHeight + Style.marginM + Style.marginM
Layout.preferredHeight: mediaContentGrid.implicitHeight + Style.margin2M
// Visualizer background for content area
Loader {
@@ -313,7 +303,7 @@ SmartPanel {
ColumnLayout {
id: controlsLayout
Layout.preferredWidth: root.compactMode ? -1 : albumArtItem.width
Layout.fillWidth: root.compactMode
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.fillHeight: root.compactMode
spacing: root.compactMode ? Style.marginXS : Style.marginS
@@ -89,7 +89,7 @@ ColumnLayout {
ColumnLayout {
id: contentCol
width: parent.width - 2 * Style.marginL
width: parent.width - Style.margin2L
x: Style.marginL
y: Style.marginL
spacing: Style.marginXXS