@@ -417,59 +417,31 @@ function getWidgetRootDir() {
417
417
return path . join ( '/' )
418
418
}
419
419
420
- function getPanelPosition ( ) {
421
- var location
422
- var screen = main . screen
423
-
424
- switch ( plasmoid . location ) {
425
- case PlasmaCore . Types . TopEdge :
426
- location = "top"
427
- break
428
- case PlasmaCore . Types . BottomEdge :
429
- location = "bottom"
430
- break
431
- case PlasmaCore . Types . LeftEdge :
432
- location = "left"
433
- break
434
- case PlasmaCore . Types . RightEdge :
435
- location = "right"
436
- break
437
- }
438
-
439
- console . log ( "location:" + location + " screen:" + screen ) ;
440
- return { "screen" : screen , "location" : location }
441
- }
442
-
443
- function setPanelModeScript ( panelPosition , panelSettings ) {
420
+ function setPanelModeScript ( panelId , panelSettings ) {
444
421
var setPanelModeScript = `
445
- for (var id of panelIds) {
446
- var panel = panelById(id);
447
- if (panel.screen === ${ panelPosition . screen } && panel.location === "${ panelPosition . location } " ) {
448
- if (${ panelSettings . visibility . enabled } ) {
449
- panel.hiding = "${ panelSettings . visibility . value } "
450
- }
451
- if (${ panelSettings . thickness . enabled } ) {
452
- panel.height = ${ panelSettings . thickness . value }
453
- }
454
- if (${ panelSettings . lengthMode . enabled } ) {
455
- panel.lengthMode = "${ panelSettings . lengthMode . value } "
456
- }
457
- if (${ panelSettings . position . enabled } ) {
458
- panel.location = "${ panelSettings . position . value } "
459
- }
460
- if (${ panelSettings . floating . enabled } ) {
461
- panel.floating = ${ panelSettings . floating . value }
462
- }
463
- if (${ panelSettings . alignment . enabled } ) {
464
- panel.alignment = "${ panelSettings . alignment . value } "
465
- }
466
- if (${ panelSettings . opacity . enabled } ) {
467
- panel.opacity = "${ panelSettings . opacity . value } "
468
- }
469
- break
470
- }
471
- }`
472
- return setPanelModeScript
422
+ var panel = panelById(${ panelId } );
423
+ if (${ panelSettings . visibility . enabled } ) {
424
+ panel.hiding = "${ panelSettings . visibility . value } "
425
+ }
426
+ if (${ panelSettings . thickness . enabled } ) {
427
+ panel.height = ${ panelSettings . thickness . value }
428
+ }
429
+ if (${ panelSettings . lengthMode . enabled } ) {
430
+ panel.lengthMode = "${ panelSettings . lengthMode . value } "
431
+ }
432
+ if (${ panelSettings . position . enabled } ) {
433
+ panel.location = "${ panelSettings . position . value } "
434
+ }
435
+ if (${ panelSettings . floating . enabled } ) {
436
+ panel.floating = ${ panelSettings . floating . value }
437
+ }
438
+ if (${ panelSettings . alignment . enabled } ) {
439
+ panel.alignment = "${ panelSettings . alignment . value } "
440
+ }
441
+ if (${ panelSettings . opacity . enabled } ) {
442
+ panel.opacity = "${ panelSettings . opacity . value } "
443
+ }` ;
444
+ return setPanelModeScript ;
473
445
}
474
446
475
447
function evaluateScript ( script ) {
0 commit comments