mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
fix horizontal scrolling of applets
try harder to not have the applet outside of boundaries
This commit is contained in:
parent
59297a25f3
commit
b044fd156d
2 changed files with 13 additions and 6 deletions
|
|
@ -34,6 +34,7 @@ DrawerBackground {
|
|||
Layout.minimumHeight: applet && applet.switchHeight
|
||||
onShouldBeVisibleChanged: fullContainer.visible = fullContainer.shouldBeVisible
|
||||
|
||||
Component.onCompleted: visibleChanged();
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
for (var i = 0; i < fullRepresentationModel.count; ++i) {
|
||||
|
|
@ -45,7 +46,7 @@ DrawerBackground {
|
|||
fullRepresentationView.forceLayout();
|
||||
|
||||
fullRepresentationView.currentIndex = ObjectModel.index;
|
||||
fullRepresentationView.positionViewAtIndex(ObjectModel.index, ListView.SnapPosition)
|
||||
fullRepresentationView.positionViewAtIndex(ObjectModel.index, ListView.Contain)
|
||||
} else if (ObjectModel.index >= 0) {
|
||||
fullRepresentationModel.remove(ObjectModel.index);
|
||||
fullRepresentationView.forceLayout();
|
||||
|
|
@ -56,11 +57,17 @@ DrawerBackground {
|
|||
}
|
||||
Connections {
|
||||
target: fullContainer.applet
|
||||
onActivated: {
|
||||
function onActivated() {
|
||||
if (!visible) {
|
||||
return;
|
||||
}
|
||||
fullRepresentationView.currentIndex = ObjectModel.index;
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: fullContainer.applet.fullRepresentationItem
|
||||
function onParentChanged() {
|
||||
fullContainer.applet.fullRepresentationItem.parent = fullContainer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ Item {
|
|||
anchors.fill: parent
|
||||
onPressed: {
|
||||
slidingPanel.cancelAnimations();
|
||||
slidingPanel.drawerX = Math.min(Math.max(0, mouse.x - slidingPanel.drawerWidth/2), slidingPanel.width - slidingPanel.drawerWidth)
|
||||
slidingPanel.drawerX = Math.min(Math.max(0, mouse.x - slidingPanel.drawerWidth/2), slidingPanel.width - slidingPanel.contentItem.width)
|
||||
slidingPanel.userInteracting = true;
|
||||
oldMouseY = mouse.y;
|
||||
slidingPanel.offset = 0//units.gridUnit * 2;
|
||||
|
|
@ -295,7 +295,7 @@ Item {
|
|||
onClosed: quickSettings.closed()
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: quickSettingsParent.implicitWidth
|
||||
implicitWidth: panelContents.implicitWidth
|
||||
implicitHeight: Math.min(slidingPanel.height, quickSettingsParent.implicitHeight)
|
||||
GridLayout {
|
||||
id: panelContents
|
||||
|
|
@ -325,7 +325,7 @@ Item {
|
|||
z: 1
|
||||
interactive: width < contentWidth
|
||||
//parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents
|
||||
Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width/2, quickSettingsParent.width*fullRepresentationModel.count) : panelContents.width
|
||||
Layout.preferredWidth: slidingPanel.wideScreen ? Math.min(slidingPanel.width - quickSettingsParent.width, quickSettingsParent.width*fullRepresentationModel.count) : panelContents.width
|
||||
//Layout.fillWidth: true
|
||||
clip: slidingPanel.wideScreen
|
||||
y: slidingPanel.wideScreen ? 0 : quickSettingsParent.height - height * (1-opacity)
|
||||
|
|
@ -333,7 +333,7 @@ Item {
|
|||
height: Math.min(plasmoid.screenGeometry.height - slidingPanel.headerHeight - quickSettingsParent.height - bottomBar.height, implicitHeight)
|
||||
//leftMargin: slidingPanel.drawerX
|
||||
preferredHighlightBegin: slidingPanel.drawerX
|
||||
|
||||
|
||||
implicitHeight: units.gridUnit * 20
|
||||
cacheBuffer: width * 100
|
||||
highlightFollowsCurrentItem: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue