mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:46:05 +08:00
commit
37ec14c239
@ -25,6 +25,17 @@ UM.PreferencesPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setDefaultTheme(defaultThemeCode)
|
||||||
|
{
|
||||||
|
for(var i = 0; i < themeList.count; i++)
|
||||||
|
{
|
||||||
|
if (themeComboBox.model.get(i).code == defaultThemeCode)
|
||||||
|
{
|
||||||
|
themeComboBox.currentIndex = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setDefaultDiscardOrKeepProfile(code)
|
function setDefaultDiscardOrKeepProfile(code)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < choiceOnProfileOverrideDropDownButton.model.count; i++)
|
for (var i = 0; i < choiceOnProfileOverrideDropDownButton.model.count; i++)
|
||||||
@ -55,6 +66,10 @@ UM.PreferencesPage
|
|||||||
var defaultLanguage = UM.Preferences.getValue("general/language")
|
var defaultLanguage = UM.Preferences.getValue("general/language")
|
||||||
setDefaultLanguage(defaultLanguage)
|
setDefaultLanguage(defaultLanguage)
|
||||||
|
|
||||||
|
UM.Preferences.resetPreference("general/theme")
|
||||||
|
var defaultTheme = UM.Preferences.getValue("general/theme")
|
||||||
|
setDefaultTheme(defaultTheme)
|
||||||
|
|
||||||
UM.Preferences.resetPreference("physics/automatic_push_free")
|
UM.Preferences.resetPreference("physics/automatic_push_free")
|
||||||
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
||||||
UM.Preferences.resetPreference("physics/automatic_drop_down")
|
UM.Preferences.resetPreference("physics/automatic_drop_down")
|
||||||
@ -194,6 +209,87 @@ UM.PreferencesPage
|
|||||||
font.italic: true
|
font.italic: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
//: Spacer
|
||||||
|
height: UM.Theme.getSize("default_margin").height
|
||||||
|
width: UM.Theme.getSize("default_margin").width
|
||||||
|
}
|
||||||
|
|
||||||
|
Row
|
||||||
|
{
|
||||||
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: themeLabel
|
||||||
|
text: catalog.i18nc("@label","Theme:")
|
||||||
|
anchors.verticalCenter: themeComboBox.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox
|
||||||
|
{
|
||||||
|
id: themeComboBox
|
||||||
|
model: ListModel
|
||||||
|
{
|
||||||
|
id: themeList
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
append({ text: catalog.i18nc("@item:inlistbox", "Ultimaker"), code: "cura" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
currentIndex:
|
||||||
|
{
|
||||||
|
var code = UM.Preferences.getValue("general/theme");
|
||||||
|
for(var i = 0; i < themeList.count; ++i)
|
||||||
|
{
|
||||||
|
if(model.get(i).code == code)
|
||||||
|
{
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onActivated: UM.Preferences.setValue("general/theme", model.get(index).code)
|
||||||
|
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
// Because ListModel is stupid and does not allow using qsTr() for values.
|
||||||
|
for(var i = 0; i < themeList.count; ++i)
|
||||||
|
{
|
||||||
|
themeList.setProperty(i, "text", catalog.i18n(themeList.get(i).text));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Glorious hack time. ComboBox does not update the text properly after changing the
|
||||||
|
// model. So change the indices around to force it to update.
|
||||||
|
currentIndex += 1;
|
||||||
|
currentIndex -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: themeCaption
|
||||||
|
|
||||||
|
//: Theme change warning
|
||||||
|
text: catalog.i18nc("@label", "You will need to restart the application for theme changes to have effect.")
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.italic: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
//: Spacer
|
||||||
|
height: UM.Theme.getSize("default_margin").height
|
||||||
|
width: UM.Theme.getSize("default_margin").width
|
||||||
|
}
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
font.bold: true
|
||||||
|
text: catalog.i18nc("@label","Viewport behavior")
|
||||||
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
//: Spacer
|
//: Spacer
|
||||||
@ -211,7 +307,6 @@ UM.PreferencesPage
|
|||||||
CheckBox
|
CheckBox
|
||||||
{
|
{
|
||||||
id: autoSliceCheckbox
|
id: autoSliceCheckbox
|
||||||
|
|
||||||
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
|
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
|
||||||
onClicked: UM.Preferences.setValue("general/auto_slice", checked)
|
onClicked: UM.Preferences.setValue("general/auto_slice", checked)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user