mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-06 20:12:29 +00:00
fix: Fix the proportions of the list and the preview
This commit is contained in:
@@ -13,12 +13,12 @@ import qs.Widgets
|
|||||||
SmartPanel {
|
SmartPanel {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property int baseWidth: Math.round(500 * Style.uiScaleRatio)
|
readonly property real clipListRatio: 0.6 // 60% for the list
|
||||||
readonly property int previewWidth: Math.round(400 * Style.uiScaleRatio)
|
readonly property real clipPreviewRatio: 0.4 // 40% for the preview
|
||||||
readonly property bool previewActive: activePlugin && activePlugin.name === I18n.tr("plugins.clipboard") && results.length > 0
|
readonly property bool previewActive: activePlugin && activePlugin.name === I18n.tr("plugins.clipboard") && results.length > 0
|
||||||
|
|
||||||
// Panel configuration
|
// Panel configuration
|
||||||
preferredWidth: baseWidth + (previewActive ? previewWidth : 0)
|
preferredWidth: Math.round(700 * Style.uiScaleRatio) // Base width when both are shown, scaled appropriately
|
||||||
preferredHeight: Math.round(600 * Style.uiScaleRatio)
|
preferredHeight: Math.round(600 * Style.uiScaleRatio)
|
||||||
preferredWidthRatio: 0.3
|
preferredWidthRatio: 0.3
|
||||||
preferredHeightRatio: 0.5
|
preferredHeightRatio: 0.5
|
||||||
@@ -348,7 +348,10 @@ SmartPanel {
|
|||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: leftPane
|
id: leftPane
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.preferredWidth: root.baseWidth
|
Layout.fillWidth: root.previewActive // Fill width proportionally when preview is active
|
||||||
|
Layout.preferredWidth: root.previewActive ?
|
||||||
|
Math.round(root.clipListRatio * (root.preferredWidth - (Style.marginL * 2))) :
|
||||||
|
(root.preferredWidth - (Style.marginL * 2))
|
||||||
anchors.margins: Style.marginL
|
anchors.margins: Style.marginL
|
||||||
spacing: Style.marginM
|
spacing: Style.marginM
|
||||||
|
|
||||||
@@ -656,7 +659,9 @@ SmartPanel {
|
|||||||
// --- Right Pane (Preview) ---
|
// --- Right Pane (Preview) ---
|
||||||
Item {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.preferredWidth: root.previewActive ? root.previewWidth : 0
|
Layout.fillWidth: root.previewActive // Fill width proportionally when preview is active
|
||||||
|
Layout.preferredWidth: root.previewActive ?
|
||||||
|
Math.round(root.clipPreviewRatio * (root.preferredWidth - (Style.marginL * 2))) : 0
|
||||||
visible: root.previewActive
|
visible: root.previewActive
|
||||||
|
|
||||||
Behavior on Layout.preferredWidth {
|
Behavior on Layout.preferredWidth {
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Item {
|
|||||||
property bool loadingFullContent: false
|
property bool loadingFullContent: false
|
||||||
|
|
||||||
implicitHeight: contentColumn.implicitHeight + Style.marginL * 2
|
implicitHeight: contentColumn.implicitHeight + Style.marginL * 2
|
||||||
implicitWidth: 350 // A default width
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: previewPanel
|
target: previewPanel
|
||||||
|
|||||||
Reference in New Issue
Block a user