improvements for Ruler

pull/2/head
Michail Vourlakos 7 years ago
parent 5b216845a3
commit 65c067f428

@ -31,7 +31,10 @@ import org.kde.latte 0.1 as Latte
Item{
id: rulerItem
opacity: behaveAsPlasmaPanel ? 0.7 : 1
width: root.isHorizontal ? root.maxLength : theme.defaultFont.pixelSize
height: root.isVertical ? root.maxLength : theme.defaultFont.pixelSize
opacity: root.editMode ? 1 : 0
x: {
if (root.isHorizontal) {
@ -58,8 +61,8 @@ Item{
}
property int length: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - root.maxIconSize/4 : root.maxLength):
(root.behaveAsPlasmaPanel ? root.height - root.maxIconSize/4 : root.maxLength)
property int length: root.maxLength/* root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - root.maxIconSize/4 : root.maxLength):
(root.behaveAsPlasmaPanel ? root.height - root.maxIconSize/4 : root.maxLength)*/
property int rMargin: 3
property int xL: 0
@ -141,16 +144,17 @@ Item{
rows: root.isHorizontal ? 1 : 0
columns: root.isVertical ? 1 : 0
rowSpacing: 2
columnSpacing: 2
spacing: 2
flow: root.isHorizontal ? GridLayout.TopToBottom : GridLayout.LeftToRight
property int freeSpace: {
if (root.isHorizontal) {
return rulerItem.width - (startLine.width + startArrow.width + labelItem.width + endArrow.width + endArrow.width);
return rulerItem.width - rulerGrid.spacing - 1 //((rulerGrid.children.length-2) * rulerGrid.spacing)
- (startLine.width + startArrow.width + labelItem.width + endArrow.width + endArrow.width);
} else {
return rulerItem.height - (startLine.height + startArrow.height + labelItem.height + endArrow.height + endArrow.height);
return rulerItem.height - rulerGrid.spacing - 1 //((rulerGrid.children.length-2) * rulerGrid.spacing)
- (startLine.height + startArrow.height + labelItem.height + endArrow.height + endArrow.height);
}
}

@ -173,10 +173,9 @@ DragDrop.DropArea {
//FIXME: this is not needed any more probably
property int previousAllTasks: -1 //is used to forbit updateAutomaticIconSize when hovering
property int offset: {
if (behaveAsPlasmaPanel) {
/*if (behaveAsPlasmaPanel) {
return 0;
}
}*/
if (root.isHorizontal) {
return width * (plasmoid.configuration.offset/100);
} else {
@ -1479,25 +1478,7 @@ DragDrop.DropArea {
// z: root.behaveAsPlasmaPanel ? 1 : 0
}
Ruler{
width: {
if (root.isHorizontal) {
return behaveAsPlasmaPanel ? panelBox.width : root.maxLength;
} else {
return;
}
}
height: {
if (root.isVertical) {
return behaveAsPlasmaPanel ? panelBox.height : root.maxLength;
} else {
return;
}
}
opacity: root.editMode ? 1 : 0
}
Ruler{id: ruler}
Item{
id: panelBox

Loading…
Cancel
Save