1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-08-15 21:49:28 +03:00

improve proportion icon size with automatic icon

--when dock is changing screens and dock is using
an automatic calculated icon size based on contents
the automatic icon size must be recalculated for the
new proportion icon size
This commit is contained in:
Michail Vourlakos
2017-03-09 16:49:51 +02:00
parent 82c3edfd48
commit 5de5b11e38
3 changed files with 23 additions and 2 deletions

View File

@ -243,6 +243,8 @@ void DockView::setScreenToFollow(QScreen *screen, bool updateScreenId)
this->containment()->reactToScreenChange();
syncGeometry();
emit screenGeometryChanged();
}
//! the main function which decides if this dock is at the

View File

@ -297,7 +297,7 @@ Window{
}
Text{
text: "Proportion Icon Size "+space
text: "Icon Size (proportion)"+space
}
Text{

View File

@ -82,7 +82,8 @@ DragDrop.DropArea {
root.maxIconSize
property int proportionIconSize: { //icon size based on screen height
return (plasmoid.configuration.proportionIconSize===-1) ? -1 : Math.round(Screen.height * plasmoid.configuration.proportionIconSize/100/8)*8;
return (plasmoid.configuration.proportionIconSize===-1) || !dock ?
-1 : Math.round(dock.screenGeometry.height * plasmoid.configuration.proportionIconSize/100/8)*8;
}
property int iconStep: 8
@ -521,6 +522,11 @@ DragDrop.DropArea {
}
}
onProportionIconSizeChanged: {
if (proportionIconSize!==-1)
updateAutomaticIconSize();
}
// onIconSizeChanged: console.log("Icon Size Changed:"+iconSize);
Component.onCompleted: {
@ -1075,6 +1081,19 @@ DragDrop.DropArea {
}
}
Connections {
target: dock
onWidthChanged:{
if (root.isHorizontal && proportionIconSize!==-1)
updateAutomaticIconSize();
}
onHeightChanged:{
if (root.isVertical && proportionIconSize!==-1)
updateAutomaticIconSize();
}
}
////END interfaces