mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
MediaPlayerPanel: fix layout issues
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user