This commit is contained in:
Jaime van Kessel 2015-04-20 12:02:02 +02:00
commit e8dc563c46
5 changed files with 51 additions and 44 deletions

View File

@ -8,22 +8,4 @@ import UM 1.0 as UM
Button {
id: base;
style: UM.Theme.styles.tool_button;
Rectangle {
anchors.bottom: parent.top;
width: parent.width;
height: base.hovered ? label.height : 0;
Behavior on height { NumberAnimation { duration: 75; } }
opacity: base.hovered ? 1.0 : 0.0;
Behavior on opacity { NumberAnimation { duration: 75; } }
Label {
id: label
anchors.horizontalCenter: parent.horizontalCenter;
text: base.text;
font: UM.Theme.fonts.button_tooltip;
}
}
}

View File

@ -5,9 +5,18 @@ import QtQuick.Layouts 1.1
import UM 1.0 as UM
RowLayout {
Item {
id: base;
width: buttons.width;
height: buttons.height + panel.height;
RowLayout {
id: buttons;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
spacing: UM.Theme.sizes.default_margin.width * 2;
Repeater {
@ -31,4 +40,18 @@ RowLayout {
}
}
}
}
Loader {
id: panel
anchors.left: parent.left;
anchors.right: parent.right;
anchors.bottom: buttons.top;
anchors.bottomMargin: UM.Theme.sizes.default_margin.height;
height: childrenRect.height;
source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : "";
}
}

View File

@ -15,7 +15,6 @@ UM.AngledCornerRectangle {
cornerSize: UM.Theme.sizes.default_margin.width;
function showTooltip(item, position, text) {
print("omg zomg")
tooltip.text = text;
position = item.mapToItem(base, position.x, position.y);
tooltip.show(position);
@ -72,16 +71,19 @@ UM.AngledCornerRectangle {
onLoaded:
{
if(item) item.configureSettings = base.configureMachinesAction;
if(typeof(item.onShowTooltip) != 'undefined')
if(item)
{
item.configureSettings = base.configureMachinesAction;
if(item.onShowTooltip != undefined)
{
item.showTooltip.connect(base.showTooltip)
}
if(item.onHideTooltip != undefined)
{
item.hideTooltip.connect(base.hideTooltip)
}
}
}
//onShowTooltip: base.showTooltip(item,position,text)
//onHideTooltip: base.hideTooltip()
}
SaveButton {

View File

@ -1,3 +1,3 @@
import UM 1.0 as UM
UM.SettingView{}
UM.SettingView { }

View File

@ -110,7 +110,7 @@ Column {
height: UM.Theme.sizes.section.height;
iconSource: UM.Theme.icons.printsetup;
text: qsTr("Setup");
text: qsTr("Print Setup");
enabled: false;
color: UM.Theme.colors.primary;