mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03: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
|
Layout.minimumHeight: applet && applet.switchHeight
|
||||||
onShouldBeVisibleChanged: fullContainer.visible = fullContainer.shouldBeVisible
|
onShouldBeVisibleChanged: fullContainer.visible = fullContainer.shouldBeVisible
|
||||||
|
|
||||||
|
Component.onCompleted: visibleChanged();
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
for (var i = 0; i < fullRepresentationModel.count; ++i) {
|
for (var i = 0; i < fullRepresentationModel.count; ++i) {
|
||||||
|
|
@ -45,7 +46,7 @@ DrawerBackground {
|
||||||
fullRepresentationView.forceLayout();
|
fullRepresentationView.forceLayout();
|
||||||
|
|
||||||
fullRepresentationView.currentIndex = ObjectModel.index;
|
fullRepresentationView.currentIndex = ObjectModel.index;
|
||||||
fullRepresentationView.positionViewAtIndex(ObjectModel.index, ListView.SnapPosition)
|
fullRepresentationView.positionViewAtIndex(ObjectModel.index, ListView.Contain)
|
||||||
} else if (ObjectModel.index >= 0) {
|
} else if (ObjectModel.index >= 0) {
|
||||||
fullRepresentationModel.remove(ObjectModel.index);
|
fullRepresentationModel.remove(ObjectModel.index);
|
||||||
fullRepresentationView.forceLayout();
|
fullRepresentationView.forceLayout();
|
||||||
|
|
@ -56,11 +57,17 @@ DrawerBackground {
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: fullContainer.applet
|
target: fullContainer.applet
|
||||||
onActivated: {
|
function onActivated() {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fullRepresentationView.currentIndex = ObjectModel.index;
|
fullRepresentationView.currentIndex = ObjectModel.index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: fullContainer.applet.fullRepresentationItem
|
||||||
|
function onParentChanged() {
|
||||||
|
fullContainer.applet.fullRepresentationItem.parent = fullContainer;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressed: {
|
onPressed: {
|
||||||
slidingPanel.cancelAnimations();
|
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;
|
slidingPanel.userInteracting = true;
|
||||||
oldMouseY = mouse.y;
|
oldMouseY = mouse.y;
|
||||||
slidingPanel.offset = 0//units.gridUnit * 2;
|
slidingPanel.offset = 0//units.gridUnit * 2;
|
||||||
|
|
@ -295,7 +295,7 @@ Item {
|
||||||
onClosed: quickSettings.closed()
|
onClosed: quickSettings.closed()
|
||||||
|
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
implicitWidth: quickSettingsParent.implicitWidth
|
implicitWidth: panelContents.implicitWidth
|
||||||
implicitHeight: Math.min(slidingPanel.height, quickSettingsParent.implicitHeight)
|
implicitHeight: Math.min(slidingPanel.height, quickSettingsParent.implicitHeight)
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: panelContents
|
id: panelContents
|
||||||
|
|
@ -325,7 +325,7 @@ Item {
|
||||||
z: 1
|
z: 1
|
||||||
interactive: width < contentWidth
|
interactive: width < contentWidth
|
||||||
//parent: slidingPanel.wideScreen ? slidingPanel.flickable.contentItem : panelContents
|
//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
|
//Layout.fillWidth: true
|
||||||
clip: slidingPanel.wideScreen
|
clip: slidingPanel.wideScreen
|
||||||
y: slidingPanel.wideScreen ? 0 : quickSettingsParent.height - height * (1-opacity)
|
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)
|
height: Math.min(plasmoid.screenGeometry.height - slidingPanel.headerHeight - quickSettingsParent.height - bottomBar.height, implicitHeight)
|
||||||
//leftMargin: slidingPanel.drawerX
|
//leftMargin: slidingPanel.drawerX
|
||||||
preferredHighlightBegin: slidingPanel.drawerX
|
preferredHighlightBegin: slidingPanel.drawerX
|
||||||
|
|
||||||
implicitHeight: units.gridUnit * 20
|
implicitHeight: units.gridUnit * 20
|
||||||
cacheBuffer: width * 100
|
cacheBuffer: width * 100
|
||||||
highlightFollowsCurrentItem: true
|
highlightFollowsCurrentItem: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue