4
import FcitxCfgWizard 0.1
5
import "../common" as Common
6
import "../bars" as Bars
7
import "../../func" as Func
14
property string actiontitle: "小企鹅输入法配置"
15
property string actiontext: "可以设置自己喜欢的输入方式,点击"下一步"继续设置,点击"取消"取消当前设置并返回。"
16
property string selectedimage: ""
17
property int leftFcitxModelindex: 0
18
property int rightFcitxModelindex: 0
19
property int leftScrollbar_z:-1 //设置滑动条是否隐藏
20
property int rightScrollbar_z:0
21
property int scrollbar_z: -1
22
property int leftNum: 0
23
property int rightNum:0
24
property string m_separator: "<5|13)"
25
signal emitFcitxRefresh;
28
source: "../../img/skin/bg-left.png"
35
anchors.top: parent.top
37
anchors.left: parent.left
38
anchors.leftMargin: 80
40
text: fcitxconfigtool.actiontitle
46
text: fcitxconfigtool.actiontext
52
function returnUnneed_data()
54
var returnUnneed_list = new Array
55
leftFcitxModelindex =0;
56
rightFcitxModelindex = 0;
57
for(var i=0;i<leftNum;i++)
59
returnUnneed_list.push(leftFcitxModel.get(leftFcitxModelindex).itemTitle+m_separator+
60
leftFcitxModel.get(leftFcitxModelindex).uniqueName+m_separator+
61
leftFcitxModel.get(leftFcitxModelindex).langClde+m_separator+"true")
63
leftFcitxModelindex++;
65
for(var i=0;i<rightNum;i++)
67
returnUnneed_list.push(rightFcitxModel.get(rightFcitxModelindex).itemTitle+m_separator+
68
rightFcitxModel.get(rightFcitxModelindex).uniqueName+m_separator+
69
rightFcitxModel.get(rightFcitxModelindex).langClde+m_separator+"flase")
70
rightFcitxModelindex++;
72
console.log(leftNum+rightNum);//524
73
return returnUnneed_list;
77
function refreshFcitxtool(){
78
leftFcitxModel.clear();
79
rightFcitxModel.clear();
80
leftFcitxModelindex = 0;
81
rightFcitxModelindex = 0;
83
downBtn.enabled =true;
86
var unneed_data = fcitxcfgwizard.get_im_list();
87
for (var i=0; i< unneed_data.length; i++) {
88
var chooseList = unneed_data[i].split(m_separator);
89
if(chooseList[3]=="true")
92
leftFcitxModel.append({"itemTitle": chooseList[0],"uniqueName":chooseList[1],"langClde":chooseList[2]});
97
rightFcitxModel.append({"itemTitle": chooseList[0],"uniqueName":chooseList[1],"langClde":chooseList[2]});
101
pageStack.push(functioncollection);
104
target: fcitxcfgwizard
109
Component.onCompleted: {
110
leftFcitxModel.clear();
111
rightFcitxModel.clear();
112
leftFcitxModelindex = 0;
113
rightFcitxModelindex = 0;
114
var unneed_data = fcitxcfgwizard.get_im_list();
115
if (unneed_data == "" || unneed_data.length == 0)
116
unneed_data = fcitxcfgwizard.get_im_list();
117
for (var i=0; i< unneed_data.length; i++) {
118
var chooseList = unneed_data[i].split(m_separator);
119
if(chooseList[3]=="true")
122
leftFcitxModel.append({"itemTitle": chooseList[0],"uniqueName":chooseList[1],"langClde":chooseList[2]});
126
rightFcitxModel.append({"itemTitle": chooseList[0],"uniqueName":chooseList[1],"langClde":chooseList[2]});
179
border.color: "#b9c5cc"
180
width: 350; height: 240
192
width:350; height: 30
198
verticalCenter: parent.verticalCenter
209
verticalCenter: parent.verticalCenter
218
left: listtext2.right
220
verticalCenter: parent.verticalCenter
231
wrapper.ListView.view.currentIndex = index; //?
232
leftFcitxModelindex = wrapper.ListView.view.currentIndex;
233
if(leftFcitxModelindex==0)
235
upBtn.enabled = false;
239
upBtn.enabled = true;
241
if(leftFcitxModelindex==leftNum-1)
243
downBtn.enabled = false;
247
downBtn.enabled = true;
257
model: leftFcitxModel
258
delegate: leftDelegat
259
highlight: Rectangle{width: 340;height: 30 ; color: "lightsteelblue"}
265
anchors.right: parent.right
266
anchors.rightMargin: -1
267
height: parent.height
274
anchors.right: parent.right
275
anchors.rightMargin: 0
277
y: leftLisv.visibleArea.yPosition * leftScrollbar.height //?
278
height: leftLisv.visibleArea.heightRatio * leftScrollbar.height; //?
282
border.color: "lightgrey"
284
anchors.verticalCenter: parent.verticalCenter
285
anchors.horizontalCenter: parent.horizontalCenter
302
anchors.fill: leftButton
303
drag.target: leftButton
304
drag.axis: Drag.YAxis
306
drag.maximumY: leftScrollbar.height - leftButton.height
308
leftLisv.contentY = leftButton.y / leftScrollbar.height * leftLisv.contentHeight //?
326
border.color: "#b9c5cc"
327
width: 350; height: 240
333
state: "transparentColor"
334
width: 280; height: 30
340
verticalCenter: parent.verticalCenter
351
verticalCenter: parent.verticalCenter
361
left: listtext2.right
363
verticalCenter: parent.verticalCenter
373
// okBtn.enabled = true;
374
// okBtn.hoverimage = "list_item_active.png";
375
wrapper.ListView.view.currentIndex = index; //?
376
state = "lightsteelblueColor";
377
rightFcitxModelindex = index;
386
model: rightFcitxModel
387
delegate: rightDelegat
388
highlightMoveSpeed: 9999999
389
highlight: Rectangle{width: 350;height: 30 ; color: "lightsteelblue"}
395
anchors.right: parent.right
396
anchors.rightMargin: -1
397
height: parent.height
404
anchors.right: parent.right
405
anchors.rightMargin: 0
407
y: rightLisv.visibleArea.yPosition * rightscrollbar.height //?
408
height: 10*(rightLisv.visibleArea.heightRatio * rightscrollbar.height); //?
413
border.color: "lightgrey"
415
anchors.verticalCenter: parent.verticalCenter
416
anchors.horizontalCenter: parent.horizontalCenter
433
anchors.fill: rightbutton
434
drag.target: rightbutton
435
drag.axis: Drag.YAxis
437
drag.maximumY: rightscrollbar.height - rightbutton.height/10
439
rightLisv.contentY = rightbutton.y / rightscrollbar.height * rightLisv.contentHeight //?
454
text: qsTr("提示:'+'可以将可用输入法加入当前输入法,'-'删除当前选中输入法,'▲'和'▼'改变选中输入法的位置")
468
top:leftRectangle.bottom
476
//hoverimage: "list_item_active.png"
479
leftFcitxModel.append({"itemTitle":rightFcitxModel.get(rightFcitxModelindex).itemTitle,
480
"uniqueName" :rightFcitxModel.get(rightFcitxModelindex).uniqueName,
481
"langClde" :rightFcitxModel.get(rightFcitxModelindex).langClde})
482
rightFcitxModel.remove(rightFcitxModelindex);
486
cutBtn.enabled = true;
487
if((leftFcitxModelindex==0)&&(leftNum>1))
488
downBtn.enabled = true;
498
rightFcitxModel.append({"itemTitle":leftFcitxModel.get(leftFcitxModelindex).itemTitle,
499
"uniqueName" :leftFcitxModel.get(leftFcitxModelindex).uniqueName,
500
"langClde" :leftFcitxModel.get(leftFcitxModelindex).langClde})
501
leftFcitxModel.remove(leftFcitxModelindex);
505
if((leftFcitxModelindex==leftNum)&&(leftFcitxModelindex!=0))
507
leftFcitxModelindex--;
509
if(leftFcitxModelindex==0)
511
leftFcitxModelindex =0;
515
cutBtn.enabled = false;
516
upBtn.enabled = false;
517
downBtn.enabled = false;
528
if(leftFcitxModelindex==0)
530
upBtn.enabled = false
532
if(leftFcitxModelindex>0)
534
downBtn.enabled = true
535
leftFcitxModel.move(leftFcitxModelindex,leftFcitxModelindex-1,1)
536
leftFcitxModelindex=leftFcitxModelindex-1;
537
if((leftFcitxModelindex==0)||(leftNum == 0))
539
upBtn.enabled = false
552
if((leftFcitxModelindex==leftNum-1)||(leftNum==0))
554
downBtn.enabled = false;
556
if(leftFcitxModelindex<leftNum-1)
558
upBtn.enabled = true;
559
leftFcitxModel.move(leftFcitxModelindex,leftFcitxModelindex+1,1)
560
leftFcitxModelindex=leftFcitxModelindex+1;
562
if((leftFcitxModelindex==leftNum-1)||(leftNum==0))
564
downBtn.enabled = false
576
anchors.top: parent.top
577
anchors.topMargin: 40
578
anchors.left: parent.left
579
anchors.leftMargin: 40
582
var num = sessiondispatcher.get_page_num();
584
pageStack.push(homepage)
586
pageStack.push(systemset)
588
pageStack.push(functioncollection)
595
height: 50; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
596
// button1Label: qsTr("取消")
597
// button2Label: qsTr("上一步")
598
// button3Label: qsTr("下一步")
599
onCancelBtnClicked: {
600
fcitxcfgwizard.send_fcitx_ok_warn();
602
onGobackBtnClicked: {
603
pageStack.push(functioncollection)
605
onContinueBtnClicked: {
606
pageStack.push(fcitxConfigtoolFontpage);//静态添加页
607
fcitxcfgwizard.set_im_list(returnUnneed_data(),false);