Skip to content

Commit c6ee057

Browse files
authored
Merge pull request #10 from C0rvust/1.2.0
1.2.0
2 parents a5ae608 + 4905e6d commit c6ee057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+532
-235
lines changed

Modular Taskbar.rmskin

35.6 KB
Binary file not shown.

Modular Taskbar/@Resources/Includes/NowPlaying/Player/NowPlaying.inc

Lines changed: 0 additions & 80 deletions
This file was deleted.

Modular Taskbar/@Resources/Includes/NowPlaying/Player/WebNowPlaying.inc

Lines changed: 0 additions & 74 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
$MeterPrefix="module.Taskbar.Icon."
2+
$RootConfigPath=$RmApi.VariableStr("RootConfigPath")
3+
$RootConfig=$RmApi.VariableStr("RootConfig")
4+
5+
function MaxProgramCount { # Retrieves the #MasProgramCount# Variable
6+
$Count=$RmAPI.VariableStr("module.Taskbar.ProgramCount")
7+
return $Count
8+
}
9+
10+
function StockIcons { # Retrieves an array of the avaliable png files in the path specified by #StockIconPath#
11+
$Path=$RmAPI.VariableStr("module.Taskbar.StockIconPath")
12+
$List=@()
13+
14+
Get-ChildItem $Path -File | Where-Object Name -Match "png$" | ForEach-Object {
15+
$List+=$_.BaseName
16+
}
17+
Return $List
18+
}
19+
20+
function RunGetIcons { # Runs the GetIcon.exe executable to get icon images of all currently running processes
21+
$GetIconsPath=$RmAPI.VariableStr("module.Taskbar.GetIconsPath") + "\getIcons.exe"
22+
$AddDepPath=$RmAPI.VariableStr("module.Taskbar.AddDep")
23+
& "$GetIconsPath" "$AddDepPath"
24+
}
25+
26+
function GetProgramName { # Get the ProgramName of a particular program
27+
Param([int] $ID)
28+
29+
$ProgramName=$RmAPI.VariableStr("ProgramName" + $ID)
30+
return $ProgramName
31+
}
32+
function GetProgramCount { # Get the number of children (instances) of a particular program
33+
Param([int] $ID)
34+
35+
$ProgramCount=$RmAPI.VariableStr("ProgramsCount" + $ID)
36+
return $ProgramCount
37+
}
38+
39+
function SetProgramCoord {
40+
Param([Int] $ID)
41+
42+
$Width=$RmAPI.VariableStr("module.Taskbar.ProgramW")
43+
$Size=$RmAPI.VariableStr("module.Taskbar.IconSize")
44+
$Coord="($ID*$Width+($Width-$Size)*0.5)"
45+
46+
$RmAPI.Bang("!SetOption $MeterPrefix$ID x $Coord")
47+
}
48+
49+
function SetProgramImage { # Set the icon image of a particular program
50+
Param([Int] $ID)
51+
52+
$ProgramName=GetProgramName($ID)
53+
$StockIcons=StockIcons
54+
$StockIconPath=$RmAPI.VariableStr("module.Taskbar.StockIconPath")
55+
$GenIconPath=$RmAPI.VariableStr("module.Taskbar.GetIconsPath") + "\Icons"
56+
57+
If($ProgramName -Match "Empty") {
58+
$RmAPI.Bang("!SetOption $MeterPrefix$ID ImageName "" ")
59+
}
60+
Else {
61+
If($StockIcons -clike $ProgramName){ # if there exist a stock icon, then use the stock icon instead, if not use the generated one
62+
$RmAPI.Bang("!SetOption $MeterPrefix$ID ImageName `"`"`"$StockIconPath\$ProgramName.png`"`"`" ")
63+
}
64+
Else{
65+
$RmAPI.Bang("!SetOption $MeterPrefix$ID ImageName `"`"`"$GenIconPath\$ProgramName.png`"`"`" ")
66+
}
67+
}
68+
}
69+
70+
function SetProgramMouseAction { #Set the relevant mouse actions of a particular program
71+
Param([Int] $ID)
72+
73+
$ProgramName=GetProgramName($ID)
74+
If($ProgramName -Match "Empty"){ # Not in use
75+
$RmAPI.Bang("!SetOption $MeterPrefix$ID LeftMouseUpAction `"`"`"$Null`"`"`" ")
76+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseOverAction `"`"`"$Null`"`"`" ")
77+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseLeaveAction `"`"`"$Null`"`"`" ")
78+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MiddleMouseUpAction `"`"`"$Null`"`"`" ")
79+
}
80+
else{
81+
$ProgramCount=GetProgramCount($ID)
82+
if($ProgramCount -gt 0) { # Has open windows
83+
$RmAPI.Bang("!SetOption $MeterPrefix$ID LeftMouseUpAction `"`"`"[!CommandMeasure module.Taskbar.ProgramOptions ToFront|Main|$ID]`"`"`" ")
84+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseOverAction `"`"`"!CommandMeasure module.Taskbar.PSRM `"`"`"MouseOverIconAction $ID`"`"`"`"`"`" ")
85+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseLeaveAction `"`"`"!CommandMeasure module.Taskbar.PSRM `"`"`"MouseLeaveIconAction $ID`"`"`"`"`"`" ")
86+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MiddleMouseUpAction `"`"`"!CommandMeasure module.Taskbar.ProgramOptions `"`"`"StartNew|$ID`"`"`"`"`"`" ")
87+
}
88+
else{ # Pinned Program but no open windows
89+
$RmAPI.Bang("!SetOption $MeterPrefix$ID LeftMouseUpAction `"`"`"[!CommandMeasure module.Taskbar.ProgramOptions StartNew|$ID]`"`"`" ")
90+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseOverAction `"`"`"$Null`"`"`" ")
91+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MouseLeaveAction `"`"`"$Null`"`"`" ")
92+
$RmAPI.Bang("!SetOption $MeterPrefix$ID MiddleMouseUpAction `"`"`"!CommandMeasure module.Taskbar.ProgramOptions `"`"`"StartNew|$ID`"`"`"`"`"`" ")
93+
}
94+
}
95+
}
96+
97+
function MouseOverIconAction {
98+
Param([Int] $ID)
99+
100+
# MouseOver Animation
101+
$RmAPI.Bang("!SetOption $MeterPrefix$ID ImageTint `"`"`"255,255,255`"`"`" ")
102+
$RmAPI.Bang("!UpdateMeter $MeterPrefix$ID ")
103+
104+
# Update coords
105+
$UpdateCoord=$RmAPI.ReplaceVariablesStr("#UpdateCoord#")
106+
$RmAPI.Bang("$UpdateCoord")
107+
108+
# Set PopUp Coord
109+
$ContainerCoord=$RmAPI.ReplaceVariables("[module.Taskbar.Container:x]")
110+
$Width=$RmAPI.VariableStr("module.Taskbar.ProgramW")
111+
$Size=$RmAPI.VariableStr("module.Taskbar.IconSize")
112+
$Coord="($ContainerCoord+$ID*$Width+($Width-$Size)*0.5+$Width*0.5)"
113+
$RmAPI.Bang("!WriteKeyValue Variables Parent.Position `"`"`"$Coord`"`"`" `"`"`"$($RootConfigPath)PopUp\Taskbar_PopUp.ini`"`"`" ")
114+
115+
#EstablishPopUp
116+
EstablishPopUp($ID)
117+
}
118+
119+
function MouseLeaveIconAction {
120+
Param([Int] $ID)
121+
122+
# MouseLeave Animation
123+
$RmAPI.Bang("!SetOption $MeterPrefix$ID ImageTint `"`"`"180,180,180`"`"`" ")
124+
$RmAPI.Bang("!UpdateMeter $MeterPrefix$ID ")
125+
126+
# Start Deactivate queue
127+
$RmAPI.Bang("!CommandMeasure module.Taskbar.PopUpTimer `"`"`"Execute 1`"`"`" ")
128+
}
129+
130+
function EstablishPopUp {
131+
Param([Int] $ID)
132+
133+
# Stop Deactivate queue
134+
$RmAPI.Bang("!CommandMeasure module.Taskbar.PopUpTimer `"`"`"Stop 1`"`"`" ")
135+
136+
$ProgramCount=GetProgramCount($ID)
137+
If($ProgramCount -gt 0){ # If a popup is needed
138+
# Set size
139+
$ProgramCount=GetProgramCount($ID)
140+
$RmAPI.Bang("!WriteKeyValue Variables Module.Taskbar.NumProgram `"`"`"$ProgramCount`"`"`" `"`"`"$($RootConfigPath)PopUp\Taskbar_PopUp.ini`"`"`" ")
141+
142+
# Activate Popup
143+
$RmAPI.Bang("!DeactivateConfig `"`"`"$RootConfig\Popup`"`"`" `"`"`"Taskbar_PopUp.ini`"`"`" ")
144+
$RmAPI.Bang("!ActivateConfig `"`"`"$RootConfig\Popup`"`"`" `"`"`"Taskbar_PopUp.ini`"`"`" ")
145+
146+
# Set ID
147+
$RmAPI.Bang("!SetVariable Module.Taskbar.ProgramID `"`"`"$ID`"`"`" `"`"`"$RootConfig\PopUp`"`"`" ")
148+
149+
# Set window names
150+
for($i=0; $i -lt $ProgramCount; $i++) {
151+
$RmAPI.Bang("!CommandMeasure module.Taskbar.ProgramOptions `"`"`"SetVariable|module.Taskbar.WindowName|ChildWindowName|$ID|$i`"`"`" ")
152+
$WinName=$RmAPI.VariableStr("module.Taskbar.WindowName")
153+
$RmAPI.Bang("!SetOption $i Text `"`"`"$WinName`"`"`" `"`"`"$RootConfig\PopUp`"`"`" ")
154+
}
155+
$RmAPI.Bang("!UpdateMeterGroup TaskbarChildString `"`"`"$RootConfig\PopUp`"`"`" ")
156+
$RmAPI.Bang("!Redraw `"`"`"$RootConfig\PopUp`"`"`" ")
157+
}
158+
}
159+
160+
function UpdateNow {
161+
RunGetIcons
162+
$MaxProgramCount=MaxProgramCount
163+
for($i=0; $i -lt $MaxProgramCount; $i++) { # iterate through all programs
164+
SetProgramCoord($i)
165+
SetProgramImage($i)
166+
SetProgramMouseAction($i)
167+
}
168+
$RmAPI.Bang("!UpdateMeterGroup module.Taskbar.Icon")
169+
$RmAPI.Bang("!Redraw")
170+
}
171+
172+
function Update {
173+
$NeedsUpdate=$RmAPI.VariableStr("NeedsUpdate") # Checks if an update is required
174+
If($NeedsUpdate -eq 1){
175+
UpdateNow # If so, run all relevant instructions
176+
$RmAPI.Bang("!SetVariable NeedsUpdate 0") # Reset variable
177+
}
178+
}

Modular Taskbar/@Resources/Modules/Battery.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OnChangeAction=[!UpdateMeterGroup Module.Battery.Display][!Redraw]
3737
[module.Battery.Container]
3838
Meter=Image
3939
x=(#module.Battery.Position#-(#module.Battery.Anchor#*0.5)*#module.Battery.Width#)
40-
y=#body.Padding#
40+
y=((#body.Height#-#body.ElementSize#)/2)
4141
w=#module.Battery.Width#
4242
h=#body.ElementSize#
4343
SolidColor=0,0,0

Modular Taskbar/@Resources/Modules/NowPlaying.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ OnChangeAction=[!UpdateMeterGroup Module.NowPlaying.InfoActual][!Redraw]
9999
Group=Module.NowPlaying.Info
100100
Meter=Image
101101
x=(#module.NowPlaying.Position#-(#module.NowPlaying.Anchor#*0.5)*#module.NowPlaying.Width#)
102-
y=#body.Padding#
102+
y=((#body.Height#-#body.ElementSize#)/2)
103103
w=#module.NowPlaying.Width#
104104
h=#body.ElementSize#
105105
SolidColor=0,0,0

Modular Taskbar/@Resources/Modules/Power.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DynamicVariables=1
2020
[Module.Power.Container]
2121
Meter=Image
2222
x=(#module.Power.Position#-(#module.Power.Anchor#*0.5)*#module.Power.Width#)
23-
y=#body.Padding#
23+
y=((#body.Height#-#body.ElementSize#)/2)
2424
w=#module.Power.Width#
2525
h=#body.ElementSize#
2626
SolidColor=0,0,0

Modular Taskbar/@Resources/Modules/Start.inc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ Plugin=PowerShellRM
2323
ScriptFile=#@#Includes\Start\Generate.ps1
2424
DynamicVariables=1
2525
IfCondition=#CurrentSection#=0
26-
IfFalseAction=[!WriteKeyValue Variables Module.Start.ItemSlots "[#CurrentSection#]" "#RootConfigPath#\PopUp\Start_PopUp.ini"]
26+
IfFalseAction=[!WriteKeyValue Variables Module.Start.NumProgram "[#CurrentSection#]" "#RootConfigPath#\PopUp\Start_PopUp.ini"]
2727
2828
[module.Start.Container]
2929
Meter=Image
3030
x=(#module.Start.Position#-(#module.Start.Anchor#*0.5)*#module.Start.Width#)
31-
y=#body.Padding#
31+
y=((#body.Height#-#body.ElementSize#)/2)
3232
w=#module.Start.Width#
3333
h=#body.ElementSize#
3434
SolidColor=0,0,0
3535
DynamicVariables=1
36-
OnUpdateAction=[!WriteKeyValue Variables Parent.Position "([#CurrentSection#:x]+[#CurrentSection#:w]/2)" "#RootConfigPath#\PopUp\Start_PopUp.ini"][!UpdateMeasure module.Start.PSRM]
37-
LeftMouseUpAction=#UpdateCoord#[!ToggleConfig "#RootCOnfig#\PopUp" "Start_PopUp.ini"]
36+
LeftMouseUpAction=#UpdateCoord#[!WriteKeyValue Variables Parent.Position "([#CurrentSection#:x]+[#CurrentSection#:w]/2)" "#RootConfigPath#\PopUp\Start_PopUp.ini"][!ToggleConfig "#RootCOnfig#\PopUp" "Start_PopUp.ini"]
3837
3938
[module.Start.StartIcon]
4039
MeterStyle=module.Start.StyleIconString

0 commit comments

Comments
 (0)