36
33
anchors.fill: parent
36
//使用云配置后,控件状态根据配置发生相应的变化
39
target: sessiondispatcher
40
onTellDownloadCloudConfToQML: {
41
if(download == "touchpad_enable") {
42
if (sessiondispatcher.get_touchpad_enable_qt()) {
43
touchpadswitcher.switchedOn = true;
46
touchpadswitcher.switchedOn = false;
49
else if(download == "touch_horizontal_scrolling") {
50
if (sessiondispatcher.get_touchscrolling_use_horizontal_qt()) {
51
horizontalswitcher.switchedOn = true;
54
horizontalswitcher.switchedOn = false;
57
else if(download == "type_scroll_bar") {
58
touchpadsetpage.scrollbars_mode = sessiondispatcher.get_scrollbars_mode_qt();
59
if (touchpadsetpage.scrollbars_mode == "overlay-auto") {
60
overlay.checked = true;
62
else if(touchpadsetpage.scrollbars_mode == "normal") {
63
legacy.checked = true;
66
else if(download == "touchpad_scrolling_mode") {
67
touchpadsetpage.touchscrolling_mode = sessiondispatcher.get_touchscrolling_mode_qt();
68
if (touchpadsetpage.touchscrolling_mode == "edge-scrolling") {
71
else if(touchpadsetpage.touchscrolling_mode == "two-finger-scrolling") {
72
twofinger.checked = true;
39
78
Component.onCompleted: {
40
79
touchpadsetpage.scrollbars_mode = sessiondispatcher.get_scrollbars_mode_qt();
41
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "scrolltype", touchpadsetpage.scrollbars_mode);
42
80
touchpadsetpage.touchscrolling_mode = sessiondispatcher.get_touchscrolling_mode_qt();//edge-scrolling
43
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "scrollmode", touchpadsetpage.touchscrolling_mode);
44
81
if (sessiondispatcher.get_touchpad_enable_qt()) {
45
82
touchpadswitcher.switchedOn = true;
46
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "enable", "true");
49
85
touchpadswitcher.switchedOn = false;
50
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "enable", "false");
53
87
if (sessiondispatcher.get_touchscrolling_use_horizontal_qt()) {
54
88
horizontalswitcher.switchedOn = true;
55
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "horizontal", "true");
58
91
horizontalswitcher.switchedOn = false;
59
// sessiondispatcher.write_default_configure_to_qsetting_file("touchpad", "horizontal", "false");
199
228
top: scrollrow.bottom
233
spacing: 314 - 16 - 20
238
anchors.verticalCenter: parent.verticalCenter
240
showImage: "../../img/icons/cloud-light.png"
244
text: qsTr("Touchpad horizontal scroll: ")//触摸板横向滚动:
247
anchors.verticalCenter: parent.verticalCenter
250
id: horizontalswitcher
252
anchors.verticalCenter: parent.verticalCenter
254
if (horizontalswitcher.switchedOn) {
255
sessiondispatcher.set_touchscrolling_use_horizontal_qt(true);
257
else if(!horizontalswitcher.switchedOn) {
258
sessiondispatcher.set_touchscrolling_use_horizontal_qt(false);
265
hoverimage: "blue.png"
266
text: qsTr("Restore")//恢复默认
270
anchors.verticalCenter: parent.verticalCenter
272
sessiondispatcher.set_default_system_qt("horiz-scroll-enabled");//触摸板横向滚动
273
if (sessiondispatcher.get_touchscrolling_use_horizontal_qt()) {
274
horizontalswitcher.switchedOn = true;
277
horizontalswitcher.switchedOn = false;
284
spacing: 314 - 16 - 20
289
anchors.verticalCenter: parent.verticalCenter
291
showImage: "../../img/icons/cloud-light.png"
210
295
text: qsTr("Scrollbar type: ")//滚动条类型:
211
296
font.pixelSize: 12
357
text: qsTr("Touchpad horizontal scroll: ")//触摸板横向滚动:
360
anchors.verticalCenter: parent.verticalCenter
363
id: horizontalswitcher
366
if (horizontalswitcher.switchedOn) {
367
sessiondispatcher.set_touchscrolling_use_horizontal_qt(true);
369
else if(!horizontalswitcher.switchedOn) {
370
sessiondispatcher.set_touchscrolling_use_horizontal_qt(false);
376
hoverimage: "blue.png"
377
text: qsTr("Restore")//恢复默认
381
anchors.verticalCenter: parent.verticalCenter
383
sessiondispatcher.set_default_system_qt("horiz-scroll-enabled");//触摸板横向滚动
384
if (sessiondispatcher.get_touchscrolling_use_horizontal_qt()) {
385
horizontalswitcher.switchedOn = true;
388
horizontalswitcher.switchedOn = false;
435
473
pageStack.push(functioncollection);
438
// onRestoreBtnClicked: {
439
// sessiondispatcher.set_default_system_qt("touchpad-enabled");//启用禁用触摸板
440
// if (sessiondispatcher.get_touchpad_enable_qt()) {
441
// touchpadswitcher.switchedOn = true;
444
// touchpadswitcher.switchedOn = false;
447
// sessiondispatcher.set_default_system_qt("scrollbar-mode");//滚动条类型
448
// var default_type = sessiondispatcher.get_scrollbars_mode_qt();
449
// if(default_type == "overlay-auto") {
450
// overlay.checked = true;
452
// else if(default_type == "normal") {
453
// legacy.checked = true;
455
// sessiondispatcher.set_default_system_qt("scroll-method");//触摸板滚动条触发方式
456
// var default_mode = sessiondispatcher.get_touchscrolling_mode_qt();
457
// if(default_mode == "edge-scrolling") {
458
// edge.checked = true;
460
// else if(default_mode == "two-finger-scrolling") {
461
// twofinger.checked = true;
463
// sessiondispatcher.set_default_system_qt("horiz-scroll-enabled");//触摸板横向滚动
464
// if (sessiondispatcher.get_touchscrolling_use_horizontal_qt()) {
465
// horizontalswitcher.switchedOn = true;
468
// horizontalswitcher.switchedOn = false;
471
// statusImage.visible = true;
474
// var defaultenable = sessiondispatcher.read_default_configure_from_qsetting_file("touchpad", "enable");
475
// var defaulthorizontal = sessiondispatcher.read_default_configure_from_qsetting_file("touchpad", "horizontal");
476
// var defaulttype = sessiondispatcher.read_default_configure_from_qsetting_file("touchpad", "scrolltype");
477
// var defaultmode = sessiondispatcher.read_default_configure_from_qsetting_file("touchpad", "scrollmode");
480
// var horizontalFlag;
481
// if(touchpadswitcher.switchedOn) {
482
// enableFlag = "true";
485
// enableFlag = "false";
487
// if(horizontalswitcher.switchedOn) {
488
// horizontalFlag = "true";
491
// horizontalFlag = "false";
494
// if((defaultenable == enableFlag) && (defaulthorizontal == horizontalFlag) && (touchpadsetpage.scrollbars_mode == defaulttype) && (touchpadsetpage.touchscrolling_mode == defaultmode)) {
495
// //友情提示: 触摸板配置已经为默认配置!
496
// sessiondispatcher.showWarningDialog(qsTr("Tips: "), qsTr("Touchpad configure has been restored to the default configuration!"), mainwindow.pos.x, mainwindow.pos.y);//触摸板配置已经为默认配置!
499
// if(defaultenable != enableFlag) {
500
// if(defaultenable == "true") {
501
// touchpadswitcher.switchedOn = true;
502
// sessiondispatcher.set_touchpad_enable_qt(true);
505
// touchpadswitcher.switchedOn = false;
506
// sessiondispatcher.set_touchpad_enable_qt(false);
509
// if(defaulthorizontal != horizontalFlag) {
510
// if(defaulthorizontal == "true") {
511
// horizontalswitcher.switchedOn = true;
512
// sessiondispatcher.set_touchscrolling_use_horizontal_qt(true);
515
// horizontalswitcher.switchedOn = false;
516
// sessiondispatcher.set_touchscrolling_use_horizontal_qt(false);
519
// if(touchpadsetpage.scrollbars_mode != defaulttype) {
520
// if(defaulttype == "overlay-auto") {
521
// sessiondispatcher.set_scrollbars_mode_overlay_qt();
522
// overlay.checked = true;
524
// else if(defaulttype == "normal") {
525
// sessiondispatcher.set_scrollbars_mode_legacy_qt();
526
// legacy.checked = true;
528
// touchpadsetpage.scrollbars_mode = defaulttype;
530
// if(touchpadsetpage.touchscrolling_mode != defaultmode) {
531
// if(defaultmode == "edge-scrolling") {
532
// sessiondispatcher.set_touchscrolling_mode_edge_qt();
533
// edge.checked = true;
535
// else if(defaultmode == "two-finger-scrolling") {
536
// sessiondispatcher.set_touchscrolling_mode_twofinger_qt();
537
// twofinger.checked = true;
539
// touchpadsetpage.touchscrolling_mode = defaultmode;
541
// statusImage.visible = true;
546
interval: 5000; running: true; repeat: true
547
onTriggered: statusImage.visible = false