Commit 72f9f7c1 authored by Marco Martin's avatar Marco Martin Committed by Bhushan Shah
Browse files

fix horizontal scrolling of applets

try harder to not have the applet outside of boundaries


(cherry picked from commit b044fd15)
parent 7bcbaff1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment