Merge branch 'cura4.0_header' of github.com:Ultimaker/Cura into cura4.0_header

This commit is contained in:
Jaime van Kessel 2018-10-12 13:26:53 +02:00
commit 6ea03d27a4
4 changed files with 29 additions and 23 deletions

View File

@ -27,21 +27,25 @@ UM.MainWindow
UM.I18nCatalog UM.I18nCatalog
{ {
id: catalog id: catalog
name:"cura" name: "cura"
} }
onWidthChanged: onWidthChanged:
{ {
// If slidebar is collapsed then it should be invisible // If slidebar is collapsed then it should be invisible
// otherwise after the main_window resize the sidebar will be fully re-drawn // otherwise after the main_window resize the sidebar will be fully re-drawn
if (sidebar.collapsed){ if (sidebar.collapsed)
if (sidebar.visible == true){ {
if (sidebar.visible == true)
{
sidebar.visible = false sidebar.visible = false
sidebar.initialWidth = 0 sidebar.initialWidth = 0
} }
} }
else{ else
if (sidebar.visible == false){ {
if (sidebar.visible == false)
{
sidebar.visible = true sidebar.visible = true
sidebar.initialWidth = UM.Theme.getSize("sidebar").width sidebar.initialWidth = UM.Theme.getSize("sidebar").width
} }
@ -156,7 +160,7 @@ UM.MainWindow
Button Button
{ {
id: openFileButton id: openFileButton
text: catalog.i18nc("@action:button","Open File") text: catalog.i18nc("@action:button", "Open File")
iconSource: UM.Theme.getIcon("load") iconSource: UM.Theme.getIcon("load")
style: UM.Theme.styles.tool_button style: UM.Theme.styles.tool_button
tooltip: "" tooltip: ""
@ -352,10 +356,10 @@ UM.MainWindow
{ {
//; Remove & re-add the general page as we want to use our own instead of uranium standard. //; Remove & re-add the general page as we want to use our own instead of uranium standard.
removePage(0); removePage(0);
insertPage(0, catalog.i18nc("@title:tab","General"), Qt.resolvedUrl("Preferences/GeneralPage.qml")); insertPage(0, catalog.i18nc("@title:tab", "General"), Qt.resolvedUrl("Preferences/GeneralPage.qml"));
removePage(1); removePage(1);
insertPage(1, catalog.i18nc("@title:tab","Settings"), Qt.resolvedUrl("Preferences/SettingVisibilityPage.qml")); insertPage(1, catalog.i18nc("@title:tab", "Settings"), Qt.resolvedUrl("Preferences/SettingVisibilityPage.qml"));
insertPage(2, catalog.i18nc("@title:tab", "Printers"), Qt.resolvedUrl("Preferences/MachinesPage.qml")); insertPage(2, catalog.i18nc("@title:tab", "Printers"), Qt.resolvedUrl("Preferences/MachinesPage.qml"));
@ -528,7 +532,7 @@ UM.MainWindow
id: openDialog; id: openDialog;
//: File open dialog title //: File open dialog title
title: catalog.i18nc("@title:window","Open file(s)") title: catalog.i18nc("@title:window", "Open file(s)")
modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal; modality: UM.Application.platform == "linux" ? Qt.NonModal : Qt.WindowModal;
selectMultiple: true selectMultiple: true
nameFilters: UM.MeshFileHandler.supportedReadFileTypes; nameFilters: UM.MeshFileHandler.supportedReadFileTypes;

View File

@ -346,4 +346,4 @@ Rectangle
} }
} }
} }

View File

@ -27,7 +27,7 @@ Item
Menu Menu
{ {
id: fileMenu id: fileMenu
title: catalog.i18nc("@title:menu menubar:toplevel","&File") title: catalog.i18nc("@title:menu menubar:toplevel", "&File")
MenuItem MenuItem
{ {
@ -46,7 +46,7 @@ Item
MenuItem MenuItem
{ {
id: saveWorkspaceMenu id: saveWorkspaceMenu
text: catalog.i18nc("@title:menu menubar:file","&Save...") text: catalog.i18nc("@title:menu menubar:file", "&Save...")
onTriggered: onTriggered:
{ {
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" }; var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
@ -99,7 +99,7 @@ Item
Menu Menu
{ {
title: catalog.i18nc("@title:menu menubar:toplevel","&Edit") title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
MenuItem { action: Cura.Actions.undo } MenuItem { action: Cura.Actions.undo }
MenuItem { action: Cura.Actions.redo } MenuItem { action: Cura.Actions.redo }
@ -181,7 +181,7 @@ Item
Menu Menu
{ {
id: extensionMenu id: extensionMenu
title: catalog.i18nc("@title:menu menubar:toplevel","E&xtensions") title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions")
Instantiator Instantiator
{ {
@ -223,7 +223,7 @@ Item
Menu Menu
{ {
id: preferencesMenu id: preferencesMenu
title: catalog.i18nc("@title:menu menubar:toplevel","P&references") title: catalog.i18nc("@title:menu menubar:toplevel", "P&references")
MenuItem { action: Cura.Actions.preferences } MenuItem { action: Cura.Actions.preferences }
} }
@ -231,7 +231,7 @@ Item
Menu Menu
{ {
id: helpMenu id: helpMenu
title: catalog.i18nc("@title:menu menubar:toplevel","&Help") title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
MenuItem { action: Cura.Actions.showProfileFolder } MenuItem { action: Cura.Actions.showProfileFolder }
MenuItem { action: Cura.Actions.documentation } MenuItem { action: Cura.Actions.documentation }

View File

@ -11,9 +11,9 @@ import Cura 1.0 as Cura
import "../components" import "../components"
// This item contains the views selector, a combobox that is dinamically created from // This item contains the views selector, a combobox that is dynamically created from
// the list of available Views (packages that create different visualizactions of the // the list of available Views (packages that create different visualizations of the
// scene. Aside the selector, there is a row of buttons that change the orientation of the view. // scene). Aside from the selector, there is a row of buttons that change the orientation of the view.
Item Item
{ {
id: applicationViewsSelector id: applicationViewsSelector
@ -25,7 +25,8 @@ Item
{ {
id: viewModeButton id: viewModeButton
anchors { anchors
{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: parent.right right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
@ -51,15 +52,16 @@ Item
{ {
for (var i = 0; i < model.rowCount(); i++) for (var i = 0; i < model.rowCount(); i++)
{ {
if (model.getItem(i).active) { if (model.getItem(i).active)
return i {
return i;
} }
} }
return 0 return 0
} }
// set the active index // set the active index
function setActiveIndex (index) function setActiveIndex(index)
{ {
UM.Controller.setActiveView(index) UM.Controller.setActiveView(index)
// the connection to UM.ActiveView will trigger update so there is no reason to call it manually here // the connection to UM.ActiveView will trigger update so there is no reason to call it manually here