Commit 02757c05 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

sketch: Add duplicate/clear layer buttons to the Layer panel

parent b063f996
......@@ -248,15 +248,22 @@ Panel {
top: topSpacer.bottom;
left: parent.left;
right: parent.right;
leftMargin: 8 * model.depth;
leftMargin: Constants.DefaultMargin * model.depth;
}
height: Constants.GridHeight;
height: model.activeLayer ? Constants.GridHeight * 1.5 : Constants.GridHeight;
Behavior on height { NumberAnimation { duration: 100; } }
radius: 8
color: model.activeLayer ? Settings.theme.color("panels/layers/layer/active") : Settings.theme.color("panels/layers/layer/inactive");
color: Settings.theme.color("panels/layers/layer/background");
}
Rectangle {
anchors.fill: layerBgRect
color: "transparent";
anchors {
top: layerBgRect.top;
left: layerBgRect.left;
right: layerBgRect.right;
}
height: Constants.GridHeight;
color: model.activeLayer ? Settings.theme.color("panels/layers/layer/active") : Settings.theme.color("panels/layers/layer/inactive");
radius: 8
Rectangle {
id: layerThumbContainer;
anchors {
......@@ -307,6 +314,7 @@ Panel {
checkedColor: Settings.theme.color("panels/layers/layer/visible");
image: checked ? Settings.theme.icon("visible_on-small") : Settings.theme.icon("visible_off-small");
onCheckedChanged: layerModel.setVisible(model.index, checked);
tooltip: checked ? "Hide Layer" : "Show Layer";
}
Button {
width: height;
......@@ -316,6 +324,7 @@ Panel {
checkedColor: Settings.theme.color("panels/layers/layer/locked");
image: checked ? Settings.theme.icon("locked_on-small") : Settings.theme.icon("locked_off-small");
onCheckedChanged: layerModel.setLocked(model.index, checked);
tooltip: checked ? "Unlock Layer" : "Lock Layer";
}
}
Label {
......@@ -342,74 +351,80 @@ Panel {
horizontalAlignment: Text.AlignRight;
}
}
Image {
id: moveUpButton;
Row {
anchors {
horizontalCenter: layerBgRect.left;
top: layerBgRect.top;
left: layerBgRect.left;
leftMargin: Constants.DefaultMargin;
right: layerBgRect.right;
rightMargin: Constants.DefaultMargin;
bottom: layerBgRect.bottom;
// bottomMargin: Constants.DefaultMargin;
}
height: Constants.GridHeight / 3;
width: height;
visible: model.canMoveUp;
fillMode: Image.PreserveAspectFit;
smooth: true;
source: Settings.theme.icon("up");
MouseArea {
anchors.fill: parent;
height: Constants.GridHeight * 0.5;
opacity: model.activeLayer ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 100; } }
spacing: Constants.DefaultMargin;
Button {
id: moveUpButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
enabled: model.canMoveUp;
image: Settings.theme.icon("up");
onClicked: layerModel.moveUp();
tooltip: "Move Layer Up";
}
}
Image {
id: moveDownButton;
anchors {
horizontalCenter: layerBgRect.left;
bottom: layerBgRect.bottom;
}
height: Constants.GridHeight / 3;
width: height;
visible: model.canMoveDown;
fillMode: Image.PreserveAspectFit;
smooth: true;
source: Settings.theme.icon("down");
MouseArea {
anchors.fill: parent;
Button {
id: moveDownButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
enabled: model.canMoveDown;
image: Settings.theme.icon("down");
onClicked: layerModel.moveDown();
tooltip: "Move Layer Down";
}
}
Image {
id: moveLeftButton;
anchors {
right: layerBgRect.left;
verticalCenter: layerBgRect.verticalCenter;
}
height: Constants.GridHeight / 3;
width: height;
visible: model.canMoveLeft;
fillMode: Image.PreserveAspectFit;
smooth: true;
source: Settings.theme.icon("back");
MouseArea {
anchors.fill: parent;
Button {
id: moveLeftButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
enabled: model.canMoveLeft;
image: Settings.theme.icon("back");
onClicked: layerModel.moveLeft();
tooltip: "Move Layer out of Group";
}
}
Image {
id: moveRightButton;
anchors {
left: layerBgRect.left;
verticalCenter: layerBgRect.verticalCenter;
}
height: Constants.GridHeight / 3;
width: height;
visible: model.canMoveRight;
fillMode: Image.PreserveAspectFit;
smooth: true;
source: Settings.theme.icon("forward");
MouseArea {
anchors.fill: parent;
Button {
id: moveRightButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
enabled: model.canMoveRight;
image: Settings.theme.icon("forward");
onClicked: layerModel.moveRight();
tooltip: "Move Layer into Group";
}
Button {
id: duplicateLayerButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
image: Settings.theme.icon("layer_duplicate");
onClicked: layerModel.clone();
tooltip: "Duplicate Layer";
}
Button {
id: clearLayerButton;
anchors.verticalCenter: parent.verticalCenter;
width: Constants.GridWidth / 4;
height: width;
image: Settings.theme.icon("erase");
onClicked: layerModel.clear();
tooltip: "Clear Layer";
}
}
Rectangle {
id: bottomSpacer;
anchors.top: layerBgRect.bottom;
......
......@@ -179,6 +179,7 @@ var values = {
layer: {
active: Qt.rgba(1.0, 1.0, 1.0, 0.5),
inactive: Qt.rgba(1.0, 1.0, 1.0, 0.2),
background: "#d7d7d7",
text: "#000000",
visible: "#ffffff",
locked: "#ffffff",
......
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" baseProfile="tiny" width="16.93mm" height="16.93mm" viewBox="0 0 1693 1693" preserveAspectRatio="xMidYMid" fill-rule="evenodd" clip-path="url(#presentation_clip_path)" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="1693" height="1693"/>
</clipPath>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template(57356)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template(57354)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template(10146)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template(10132)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template(10007)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template(10004)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template(9679)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template(8226)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template(8211)" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
</defs>
<defs class="TextEmbeddedBitmaps"/>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.ClosedBezierShape">
<g id="id3">
<path fill="rgb(0,0,0)" stroke="none" d="M 847,0 C 379,0 0,379 0,847 0,1315 379,1694 847,1694 1315,1694 1694,1315 1694,847 1694,379 1315,0 847,0 Z M 847,141 C 1237,141 1553,457 1553,847 1553,1237 1237,1553 847,1553 457,1553 141,1237 141,847 141,457 457,141 847,141 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id4">
<path fill="rgb(0,0,0)" stroke="none" d="M 444,571 L 444,1333 1079,1333 1079,571 444,571 Z"/>
</g>
</g>
<g class="com.sun.star.drawing.PolyPolygonShape">
<g id="id5">
<path fill="rgb(0,0,0)" stroke="none" d="M 635,381 L 635,1143 1270,1143 1270,381 635,381 Z"/>
<path fill="none" stroke="rgb(255,255,255)" stroke-width="51" stroke-linejoin="miter" d="M 635,381 L 635,1143 1270,1143 1270,381 635,381 Z"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
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