summaryrefslogtreecommitdiff
path: root/shiftos_next/APIs
diff options
context:
space:
mode:
authorTheUltimateHacker <[email protected]>2015-05-29 09:57:53 -0400
committerTheUltimateHacker <[email protected]>2015-05-29 09:57:53 -0400
commitccdbbbed1898c5073dc460a737cdd4b7c7036bb5 (patch)
tree8116d7794ad400533939128f958994e0782f7678 /shiftos_next/APIs
parent424931951bf55c2db7a7cb3228bfccc03ea62287 (diff)
downloadshiftos-next-ccdbbbed1898c5073dc460a737cdd4b7c7036bb5.tar.gz
shiftos-next-ccdbbbed1898c5073dc460a737cdd4b7c7036bb5.tar.bz2
shiftos-next-ccdbbbed1898c5073dc460a737cdd4b7c7036bb5.zip
BWM - Skinning!
Yay! ShiftOS Next can finally be Shifted! Yes, that's true. I've added basic skinning to the Basic Window Manager. Currently, the only way to get to it is by typing "open shifter" in the Terminal, and the Shifter will open. Choose the settings you want and hit Apply! This is also the Alpha 3 commit, so after this I'll make the next release.
Diffstat (limited to 'shiftos_next/APIs')
-rw-r--r--shiftos_next/APIs/API.vb5
-rw-r--r--shiftos_next/APIs/Skins.vb53
-rw-r--r--shiftos_next/APIs/filesystem.vb3
3 files changed, 60 insertions, 1 deletions
diff --git a/shiftos_next/APIs/API.vb b/shiftos_next/APIs/API.vb
index d3a70fe..af6474d 100644
--- a/shiftos_next/APIs/API.vb
+++ b/shiftos_next/APIs/API.vb
@@ -73,6 +73,8 @@
Public Sub OpenProgram(progtoopen As String)
Select Case progtoopen
+ Case "shifter", "skin", "shift"
+ Shifter.Show()
Case "shiftorium", "packages", "pacman", "code shop"
shiftorium_cmd.Show()
Case "files", "fileskimmer", "file skimmer", "fs", "file browser"
@@ -108,7 +110,8 @@
Else
AddLine("close: Invalid program """ & progtoclose & """.")
End If
-
+ Case "shifter", "skin", "shift"
+ Shifter.Hide()
Case Else
AddLine("close: Invalid program """ & progtoclose & """.")
End Select
diff --git a/shiftos_next/APIs/Skins.vb b/shiftos_next/APIs/Skins.vb
new file mode 100644
index 0000000..7b87a5c
--- /dev/null
+++ b/shiftos_next/APIs/Skins.vb
@@ -0,0 +1,53 @@
+Module Skins
+ '<summary>
+ ' This module allows for skinning. Simply that.
+ '</summary>
+
+#Region "Basic Window Manager"
+ Public titlebarcolor As Color = Color.Gray
+ Public titlebartextcolor As Color = Color.White
+ Public desktopbackcolor As Color = Color.Black
+ Public newterminalbuttonbackcolor As Color = Color.Black
+ Public newterminalbuttontextcolor As Color = Color.White
+
+ 'Load Skin from Save File
+
+ Public Sub loadskindata()
+ Try
+ Dim loadlines() As String = IO.File.ReadAllLines(bwmskin + "data.bsk")
+ titlebarcolor = Color.FromArgb(loadlines(0))
+ titlebartextcolor = Color.FromArgb(loadlines(1))
+ desktopbackcolor = Color.FromArgb(loadlines(2))
+ newterminalbuttonbackcolor = Color.FromArgb(loadlines(3))
+ newterminalbuttontextcolor = Color.FromArgb(loadlines(4))
+ BasicWM.Desktop.Redraw()
+ Catch ex As Exception
+ saveskindata()
+ loadskindata()
+ End Try
+
+
+ End Sub
+
+ 'Save to save data
+
+ Public Sub saveskindata()
+ Dim savelines(200) As String
+ savelines(0) = titlebarcolor.ToArgb
+ savelines(1) = titlebartextcolor.ToArgb
+ savelines(2) = desktopbackcolor.ToArgb
+ savelines(3) = newterminalbuttonbackcolor.ToArgb
+ savelines(4) = newterminalbuttontextcolor.ToArgb
+ Try
+ IO.File.WriteAllLines(bwmskin + "data.bsk", savelines)
+ Catch ex As Exception
+ IO.Directory.CreateDirectory(bwmskin)
+ IO.File.WriteAllLines(bwmskin + "data.bsk", savelines)
+ End Try
+ BasicWM.Desktop.Redraw()
+ End Sub
+
+#End Region
+
+
+End Module
diff --git a/shiftos_next/APIs/filesystem.vb b/shiftos_next/APIs/filesystem.vb
index 61e8053..edce1c3 100644
--- a/shiftos_next/APIs/filesystem.vb
+++ b/shiftos_next/APIs/filesystem.vb
@@ -12,6 +12,9 @@
Public systemdir As String = root + "\Shiftum42\"
Public drivers As String = systemdir + "Drivers\"
+ Public skindir As String = systemdir + "Skins\"
+
+ Public bwmskin As String = skindir + "BWM\"
Public save As String = drivers + "HDD.dri"