mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 00:58:58 +08:00
Cleanup unused code
CURA-5772
This commit is contained in:
parent
2fce1e433a
commit
fc1faf79f5
@ -21,7 +21,6 @@ UM.MainWindow
|
|||||||
|
|
||||||
// Cura application window title
|
// Cura application window title
|
||||||
title: catalog.i18nc("@title:window", "Ultimaker Cura")
|
title: catalog.i18nc("@title:window", "Ultimaker Cura")
|
||||||
//viewportRect: Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
|
|
||||||
viewportRect: Qt.rect(0, 0, 1.0, 1.0)
|
viewportRect: Qt.rect(0, 0, 1.0, 1.0)
|
||||||
backgroundColor: UM.Theme.getColor("viewport_background")
|
backgroundColor: UM.Theme.getColor("viewport_background")
|
||||||
|
|
||||||
@ -43,24 +42,6 @@ UM.MainWindow
|
|||||||
tooltip.hide();
|
tooltip.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*onWidthChanged:
|
|
||||||
{
|
|
||||||
// If slidebar is collapsed then it should be invisible
|
|
||||||
// otherwise after the main_window resize the sidebar will be fully re-drawn
|
|
||||||
if (sidebar.collapsed){
|
|
||||||
if (sidebar.visible == true){
|
|
||||||
sidebar.visible = false
|
|
||||||
sidebar.initialWidth = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (sidebar.visible == false){
|
|
||||||
sidebar.visible = true
|
|
||||||
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
CuraApplication.setMinimumWindowSize(UM.Theme.getSize("window_minimum_size"))
|
CuraApplication.setMinimumWindowSize(UM.Theme.getSize("window_minimum_size"))
|
||||||
@ -193,14 +174,11 @@ UM.MainWindow
|
|||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
//right: sidebar.left
|
|
||||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
rightMargin: UM.Theme.getSize("default_margin").width
|
rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Toolbar
|
Toolbar
|
||||||
{
|
{
|
||||||
id: toolbar
|
id: toolbar
|
||||||
@ -226,18 +204,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ApplicationViews
|
|
||||||
{
|
|
||||||
id: applicationViews
|
|
||||||
|
|
||||||
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
top: parent.top
|
|
||||||
right: sidebar.left
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Loader
|
Loader
|
||||||
{
|
{
|
||||||
id: main
|
id: main
|
||||||
@ -261,78 +227,6 @@ UM.MainWindow
|
|||||||
source: UM.Controller.activeStage.mainComponent
|
source: UM.Controller.activeStage.mainComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Loader
|
|
||||||
{
|
|
||||||
id: sidebar
|
|
||||||
|
|
||||||
property bool collapsed: false
|
|
||||||
property var initialWidth: UM.Theme.getSize("sidebar").width
|
|
||||||
|
|
||||||
function callExpandOrCollapse()
|
|
||||||
{
|
|
||||||
if (collapsed)
|
|
||||||
{
|
|
||||||
sidebar.visible = true
|
|
||||||
sidebar.initialWidth = UM.Theme.getSize("sidebar").width
|
|
||||||
viewportRect = Qt.rect(0, 0, (base.width - sidebar.width) / base.width, 1.0)
|
|
||||||
expandSidebarAnimation.start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
viewportRect = Qt.rect(0, 0, 1, 1.0)
|
|
||||||
collapseSidebarAnimation.start()
|
|
||||||
}
|
|
||||||
collapsed = !collapsed
|
|
||||||
UM.Preferences.setValue("cura/sidebar_collapsed", collapsed)
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors
|
|
||||||
{
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
width: initialWidth
|
|
||||||
x: base.width - sidebar.width
|
|
||||||
source: UM.Controller.activeStage.sidebarComponent
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
id: collapseSidebarAnimation
|
|
||||||
target: sidebar
|
|
||||||
properties: "x"
|
|
||||||
to: base.width
|
|
||||||
duration: 100
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
id: expandSidebarAnimation
|
|
||||||
target: sidebar
|
|
||||||
properties: "x"
|
|
||||||
to: base.width - sidebar.width
|
|
||||||
duration: 100
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted:
|
|
||||||
{
|
|
||||||
var sidebar_collapsed = UM.Preferences.getValue("cura/sidebar_collapsed")
|
|
||||||
|
|
||||||
if (sidebar_collapsed)
|
|
||||||
{
|
|
||||||
sidebar.collapsed = true
|
|
||||||
viewportRect = Qt.rect(0, 0, 1, 1.0)
|
|
||||||
collapseSidebarAnimation.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea
|
|
||||||
{
|
|
||||||
visible: UM.Controller.activeStage.sidebarComponent != ""
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.AllButtons
|
|
||||||
onWheel: wheel.accepted = true
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
UM.MessageStack
|
UM.MessageStack
|
||||||
{
|
{
|
||||||
anchors
|
anchors
|
||||||
@ -345,7 +239,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ViewOrientationControls
|
ViewOrientationControls
|
||||||
{
|
{
|
||||||
id: viewOrientationControls
|
id: viewOrientationControls
|
||||||
@ -359,7 +252,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ProgressAndSaveWidget
|
ProgressAndSaveWidget
|
||||||
{
|
{
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@ -379,13 +271,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expand or collapse sidebar
|
|
||||||
/*Connections
|
|
||||||
{
|
|
||||||
target: Cura.Actions.expandSidebar
|
|
||||||
onTriggered: sidebar.callExpandOrCollapse()
|
|
||||||
}*/
|
|
||||||
|
|
||||||
UM.PreferencesDialog
|
UM.PreferencesDialog
|
||||||
{
|
{
|
||||||
id: preferences
|
id: preferences
|
||||||
@ -509,7 +394,8 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContextMenu {
|
ContextMenu
|
||||||
|
{
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user