aboutsummaryrefslogtreecommitdiff
path: root/Src/resources/skins/Winamp Modern/scripts/vis.m
blob: f80f833502bb445677833f75d481f8afc6a91111 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <lib/std.mi>
#include "attribs.m"

Function updateVisCmd();

Global Button btnVisReattach;
Global Layout thislayout;
Global Int evershown;

System.onScriptLoaded() {
	initAttribs();
	thislayout = getScriptGroup().getParentLayout();
	BtnVisReattach = getScriptGroup().findObject("button.vis.reattach");
}

thisLayout.onSetVisible(int show) {
	if (!evershown) {
		evershown = 1;
		updateVisCmd();
	}
}

BtnVisReattach.onLeftClick() {
  Container c = getContainer("main");
  if (c.getLayout("shade").isVisible()) c.switchToLayout("normal");
  vis_detach_attrib.setData("0");
}

viscmd_menu_attrib.onDataChanged() {
  updateVisCmd();
}

updateVisCmd() {
  Button btn = getScriptGroup().findObject("button.vis.misc");
  if (btn) {
    if (viscmd_menu_attrib.getData() == "1") {
      btn.setXmlParam("action", "Vis_Menu");
    } else {
      btn.setXmlParam("action", "Vis_Cfg");
    }
  }
}