mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
nscrollview: more fixes
This commit is contained in:
@@ -233,13 +233,12 @@ Variants {
|
||||
height: 2
|
||||
color: "transparent"
|
||||
|
||||
readonly property real availableWidth: parent.width - (2 * parent.radius)
|
||||
|
||||
Rectangle {
|
||||
id: progressBar
|
||||
readonly property real progressWidth: cardBackground.width - (2 * cardBackground.radius)
|
||||
height: parent.height
|
||||
x: parent.parent.radius + (parent.availableWidth * (1 - model.progress)) / 2
|
||||
width: parent.availableWidth * model.progress
|
||||
x: cardBackground.radius + (progressWidth * (1 - model.progress)) / 2
|
||||
width: progressWidth * model.progress
|
||||
|
||||
color: {
|
||||
var baseColor = model.urgency === 2 ? Color.mError : model.urgency === 0 ? Color.mOnSurface : Color.mPrimary;
|
||||
|
||||
@@ -1306,6 +1306,7 @@ SmartPanel {
|
||||
}
|
||||
|
||||
NScrollView {
|
||||
id: descriptionScrollView
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||
Layout.topMargin: Style.fontSizeL + Style.marginXL
|
||||
Layout.fillWidth: true
|
||||
@@ -1314,7 +1315,7 @@ SmartPanel {
|
||||
reserveScrollbarSpace: false
|
||||
|
||||
NText {
|
||||
width: parent.availableWidth
|
||||
width: descriptionScrollView.availableWidth
|
||||
text: root.results.length > 0 ? root.results[0].description : ""
|
||||
pointSize: Style.fontSizeM
|
||||
font.weight: Font.Bold
|
||||
|
||||
@@ -255,9 +255,10 @@ SmartPanel {
|
||||
NScrollView {
|
||||
id: scrollView
|
||||
anchors.fill: parent
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
horizontalPolicy: ScrollBar.AlwaysOff
|
||||
verticalPolicy: ScrollBar.AsNeeded
|
||||
reserveScrollbarSpace: false
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
// Track which notification is expanded
|
||||
property string expandedId: ""
|
||||
|
||||
@@ -22,6 +22,7 @@ Popup {
|
||||
readonly property real settingsContentWidth: {
|
||||
if (settingsLoader.item && settingsLoader.item.implicitWidth > 0) {
|
||||
return settingsLoader.item.implicitWidth;
|
||||
d;
|
||||
}
|
||||
return defaultContentWidth;
|
||||
}
|
||||
@@ -89,9 +90,11 @@ Popup {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: 100
|
||||
gradientColor: Color.mSurface
|
||||
reserveScrollbarSpace: false
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.width
|
||||
width: scrollView.availableWidth
|
||||
spacing: Style.marginM
|
||||
|
||||
Loader {
|
||||
|
||||
@@ -90,9 +90,10 @@ Popup {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: 100
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.width
|
||||
width: scrollView.availableWidth
|
||||
spacing: Style.marginM
|
||||
|
||||
Loader {
|
||||
|
||||
@@ -837,16 +837,10 @@ Popup {
|
||||
visible: hasInitialData && availableSchemes.length > 0
|
||||
verticalPolicy: ScrollBar.AsNeeded
|
||||
horizontalPolicy: ScrollBar.AlwaysOff
|
||||
|
||||
// Only show scrollbar when content actually overflows (size < 1.0 means content is larger than viewport)
|
||||
ScrollBar.vertical.visible: schemesScrollView.ScrollBar.vertical.size < 1.0
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
ColumnLayout {
|
||||
width: {
|
||||
// Always account for scrollbar width when it's visible (for testing with visible: true)
|
||||
var scrollbarWidth = schemesScrollView.ScrollBar.vertical.visible ? (schemesScrollView.handleWidth + Style.marginS) : 0;
|
||||
return parent.width - scrollbarWidth;
|
||||
}
|
||||
width: schemesScrollView.availableWidth
|
||||
spacing: Style.marginS
|
||||
|
||||
Repeater {
|
||||
|
||||
@@ -608,6 +608,7 @@ Popup {
|
||||
}
|
||||
|
||||
NScrollView {
|
||||
id: paletteScrollView
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.min(paletteGrid.implicitHeight, 200)
|
||||
verticalPolicy: paletteGrid.implicitHeight > 200 ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
|
||||
@@ -615,7 +616,7 @@ Popup {
|
||||
|
||||
GridLayout {
|
||||
id: paletteGrid
|
||||
width: parent.availableWidth
|
||||
width: paletteScrollView.availableWidth
|
||||
columns: 17
|
||||
columnSpacing: 6
|
||||
rowSpacing: 6
|
||||
|
||||
@@ -91,6 +91,9 @@ Popup {
|
||||
cellWidth: root.cellW
|
||||
cellHeight: root.cellH
|
||||
model: root.filteredIcons
|
||||
reserveScrollbarSpace: false
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
delegate: Rectangle {
|
||||
width: grid.cellWidth
|
||||
height: grid.cellHeight
|
||||
|
||||
@@ -67,15 +67,16 @@ Popup {
|
||||
|
||||
// Settings loader - pluginApi is passed via setSource() in openPluginSettings()
|
||||
NScrollView {
|
||||
id: settingsScrollView
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: 100
|
||||
horizontalPolicy: ScrollBar.AlwaysOff
|
||||
rightPadding: verticalScrollable ? Style.marginM : 0 // Only add padding when scrollbar is visible
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
Loader {
|
||||
id: settingsLoader
|
||||
width: parent.width
|
||||
width: settingsScrollView.availableWidth
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ NBox {
|
||||
}
|
||||
|
||||
property var widgetRegistry: null
|
||||
property string settingsDialogComponent: "BarWidgetSettingsDialog.qml"
|
||||
property string settingsDialogComponent: "invalid-settings-dialog"
|
||||
property var screen: null // Screen reference for per-screen widget settings
|
||||
property var _activeDialog: null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user