mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 01:29:00 +08:00
ViewOrientationControls now use actions
This prevents code duplication CURA-5395
This commit is contained in:
parent
0bc8a67a37
commit
8b7c95da35
@ -101,7 +101,7 @@ Item
|
|||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: redoAction;
|
id: redoAction;
|
||||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Redo");
|
text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo");
|
||||||
iconName: "edit-redo";
|
iconName: "edit-redo";
|
||||||
shortcut: StandardKey.Redo;
|
shortcut: StandardKey.Redo;
|
||||||
onTriggered: UM.OperationStack.redo();
|
onTriggered: UM.OperationStack.redo();
|
||||||
@ -110,65 +110,65 @@ Item
|
|||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: quitAction;
|
id: quitAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:file","&Quit");
|
text: catalog.i18nc("@action:inmenu menubar:file","&Quit")
|
||||||
iconName: "application-exit";
|
iconName: "application-exit"
|
||||||
shortcut: StandardKey.Quit;
|
shortcut: StandardKey.Quit
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: view3DCameraAction;
|
id: view3DCameraAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:view","3D View");
|
text: catalog.i18nc("@action:inmenu menubar:view", "3D View")
|
||||||
onTriggered: UM.Controller.rotateView("3d", 0);
|
onTriggered: UM.Controller.rotateView("3d", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: viewFrontCameraAction;
|
id: viewFrontCameraAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:view","Front View");
|
text: catalog.i18nc("@action:inmenu menubar:view", "Front View")
|
||||||
onTriggered: UM.Controller.rotateView("home", 0);
|
onTriggered: UM.Controller.rotateView("home", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: viewTopCameraAction;
|
id: viewTopCameraAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:view","Top View");
|
text: catalog.i18nc("@action:inmenu menubar:view", "Top View")
|
||||||
onTriggered: UM.Controller.rotateView("y", 90);
|
onTriggered: UM.Controller.rotateView("y", 90)
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: viewLeftSideCameraAction;
|
id: viewLeftSideCameraAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:view","Left Side View");
|
text: catalog.i18nc("@action:inmenu menubar:view", "Left Side View")
|
||||||
onTriggered: UM.Controller.rotateView("x", 90);
|
onTriggered: UM.Controller.rotateView("x", 90)
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: viewRightSideCameraAction;
|
id: viewRightSideCameraAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:view","Right Side View");
|
text: catalog.i18nc("@action:inmenu menubar:view", "Right Side View")
|
||||||
onTriggered: UM.Controller.rotateView("x", -90);
|
onTriggered: UM.Controller.rotateView("x", -90)
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: preferencesAction;
|
id: preferencesAction
|
||||||
text: catalog.i18nc("@action:inmenu","Configure Cura...");
|
text: catalog.i18nc("@action:inmenu", "Configure Cura...")
|
||||||
iconName: "configure";
|
iconName: "configure"
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: addMachineAction;
|
id: addMachineAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:printer","&Add Printer...");
|
text: catalog.i18nc("@action:inmenu menubar:printer", "&Add Printer...")
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: settingsAction;
|
id: settingsAction
|
||||||
text: catalog.i18nc("@action:inmenu menubar:printer","Manage Pr&inters...");
|
text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...")
|
||||||
iconName: "configure";
|
iconName: "configure"
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
|
@ -6,7 +6,7 @@ import QtQuick.Controls 1.1
|
|||||||
import QtQuick.Controls.Styles 1.1
|
import QtQuick.Controls.Styles 1.1
|
||||||
|
|
||||||
import UM 1.4 as UM
|
import UM 1.4 as UM
|
||||||
|
import Cura 1.1 as Cura
|
||||||
// A row of buttons that control the view direction
|
// A row of buttons that control the view direction
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
@ -19,30 +19,30 @@ Row
|
|||||||
ViewOrientationButton
|
ViewOrientationButton
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_3d")
|
iconSource: UM.Theme.getIcon("view_3d")
|
||||||
onClicked: UM.Controller.rotateView("3d", 0)
|
onClicked: Cura.Actions.view3DCamera.trigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewOrientationButton
|
ViewOrientationButton
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_front")
|
iconSource: UM.Theme.getIcon("view_front")
|
||||||
onClicked: UM.Controller.rotateView("home", 0)
|
onClicked: Cura.Actions.viewFrontCamera.trigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewOrientationButton
|
ViewOrientationButton
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_top")
|
iconSource: UM.Theme.getIcon("view_top")
|
||||||
onClicked: UM.Controller.rotateView("y", 90)
|
onClicked: Cura.Actions.viewTopCamera.trigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewOrientationButton
|
ViewOrientationButton
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_left")
|
iconSource: UM.Theme.getIcon("view_left")
|
||||||
onClicked: UM.Controller.rotateView("x", 90)
|
onClicked: Cura.Actions.viewLeftSideCamera.trigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewOrientationButton
|
ViewOrientationButton
|
||||||
{
|
{
|
||||||
iconSource: UM.Theme.getIcon("view_right")
|
iconSource: UM.Theme.getIcon("view_right")
|
||||||
onClicked: UM.Controller.rotateView("x", -90)
|
onClicked: Cura.Actions.viewRightSideCamera.trigger()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user