代码拉取完成,页面将自动刷新
/*
* Copyright (c) 2021 黄川
* "Live2d桌宠桌面秀——桌面背景管理工具" is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
import QtQuick 2.0
import QtQuick 2.12
import QtQuick.Window 2.2
import QtQuick.Controls 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.15
import com.mycompany.start 1.0
Window{
title: "设置"
property real modelSize: 1.0 //用于保存模型大小比例,范围为0.8-1.5,默认为1
signal iconChange()
signal modelSizeChange()
StartOnBegin{
id:startOnBegin
}
property bool iconShow: true
function defaultSetting(){
if (iconShow){
control.checked = true
}
if(startOnBegin.isOpenStart()){
isStartControl.checked = true;
}
}
function controlContent(){
if(control.position == 0){
return "显示桌面图标";
} else {
return "隐藏桌面图标";
}
}
function isStartContent(){
if(isStartControl.position == 0){
return "开机自启:关";
} else{
return "开机自启:开";
}
}
id:config
x:Screen.width / 2 - width /2
y:Screen.height /2 - height /2
width: 250
height: 210
minimumWidth: width
maximumWidth: width
minimumHeight: height
maximumHeight: height
visible:false
Component.onCompleted: { //加载后进行初始化
defaultSetting()
modelSizeSlider.value = modelSize
// if (iconShow) control.position = 1
// else control.position = 0
}
Column{
id:configClumn
spacing: 10
width: parent.width * 4/5
anchors.centerIn: parent
height: parent.height
Row{
id:modelSizeSetting
height: parent.height /4
width: configClumn.width
spacing: height /20
anchors.horizontalCenter: parent.horizontalCenter
Text{
font.pixelSize: 13
width: parent.width *1/3
anchors.verticalCenter: parent.verticalCenter
verticalAlignment:Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text:qsTr("模型大小:")
}
Slider{
id:modelSizeSlider
width: modelSizeSetting.width * 1 / 2
anchors.verticalCenter: parent.verticalCenter
from:0.8
to:1.5
value:modelSize
onValueChanged: { //数值改变时自动更新到modelSize
modelSize=value;
modelSizeChange()
}
}
Text {
id: slidervalue
text: modelSizeSlider.value.toFixed(2)
font.pixelSize: 12
anchors.verticalCenter: parent.verticalCenter
verticalAlignment:Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
}
RowLayout{
id:iconTypeShow
height: parent.height /4
width: configClumn.width
spacing: height /20
anchors.horizontalCenter: parent.horizontalCenter
Text {
id:iconConfigText
font.pixelSize: 15
width: parent.width *2/5
verticalAlignment:Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: qsTr(controlContent())
}
Switch{
id:control
position: 0
width: parent.width * 2 / 5
onPositionChanged: {
iconShow = control.position
config.iconChange()
}
}
}
RowLayout{
id:isStart
height: parent.height /4
width: configClumn.width
spacing: height /20
anchors.horizontalCenter: parent.horizontalCenter
Text {
id:isStartText
font.pixelSize: 15
width: parent.width *2/5
verticalAlignment:Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: qsTr(isStartContent())
}
Switch{
id:isStartControl
position: 0
width: parent.width * 2 / 5
onPositionChanged: {
if (isStartControl.position == 1){
startOnBegin.start()
} else {
startOnBegin.unStart()
}
}
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。