mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-30 01:15:13 +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 {
|
||||
id: root
|
||||
|
||||
readonly property int baseWidth: Math.round(500 * Style.uiScaleRatio)
|
||||
readonly property int previewWidth: Math.round(400 * Style.uiScaleRatio)
|
||||
readonly property real clipListRatio: 0.6 // 60% for the list
|
||||
readonly property real clipPreviewRatio: 0.4 // 40% for the preview
|
||||
readonly property bool previewActive: activePlugin && activePlugin.name === I18n.tr("plugins.clipboard") && results.length > 0
|
||||
|
||||
// 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)
|
||||
preferredWidthRatio: 0.3
|
||||
preferredHeightRatio: 0.5
|
||||
@@ -348,7 +348,10 @@ SmartPanel {
|
||||
ColumnLayout {
|
||||
id: leftPane
|
||||
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
|
||||
spacing: Style.marginM
|
||||
|
||||
@@ -656,7 +659,9 @@ SmartPanel {
|
||||
// --- Right Pane (Preview) ---
|
||||
Item {
|
||||
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
|
||||
|
||||
Behavior on Layout.preferredWidth {
|
||||
|
||||
@@ -13,7 +13,6 @@ Item {
|
||||
property bool loadingFullContent: false
|
||||
|
||||
implicitHeight: contentColumn.implicitHeight + Style.marginL * 2
|
||||
implicitWidth: 350 // A default width
|
||||
|
||||
Connections {
|
||||
target: previewPanel
|
||||
|
||||
Reference in New Issue
Block a user