Add material info button to show Ultimaker.com materials page

CURA-3810

Add a new info button for materials. When a user clicks on the button,
it will open the materials information page on the Ultimaker website.
This commit is contained in:
Lipu Fei 2017-05-24 13:27:11 +02:00
parent 8ede981a2c
commit 9b67fa94b4
3 changed files with 86 additions and 4 deletions

View file

@ -196,16 +196,60 @@ Column
}
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.45 - UM.Theme.getSize("default_margin").width
width: parent.width * 0.30
font: UM.Theme.getFont("default");
color: UM.Theme.getColor("text");
}
Text
{
width: parent.width * 0.05
}
Button
{
id: materialInfoButton
height: parent.height * 0.70
width: height
anchors.margins: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
text: "i"
style: UM.Theme.styles.info_button
onClicked:
{
// open the material URL with web browser
var url = "https://ultimaker.com/en/resources/23121-materials";
Qt.openUrlExternally(url);
}
onHoveredChanged:
{
if (hovered)
{
var content = catalog.i18nc("@tooltip", "Click to check the material compatibility on Ultimaker.com.");
base.showTooltip(
variantRow, Qt.point(0, variantRow.height / 2), catalog.i18nc("@tooltip", content)
);
}
else
{
base.hideTooltip();
}
}
}
Text
{
width: parent.width * 0.10 - materialInfoButton.width - UM.Theme.getSize("default_margin").width
}
Item
{
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.55 + UM.Theme.getSize("default_margin").width
width: parent.width * 0.50 + UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
ToolButton {