mirror of
https://github.com/TheUltimateHacker/shiftos-next.git
synced 2025-01-22 09:02:00 -05:00
424931951b
Alright, I've added the Draggable Windows upgrade to the Shiftorium, as well as fixed a quick bug causing "No Items Available" to display when there were items clearly available. I've also fixed a positioning bug with BWM windows causing them to start in the center of the screen, relative to the titlebar, rather than the form. I've also re-arranged the code a bit, organizing files in folders. APIs are in the APIs folder, Desktop Environments are in the Desktop Environments folder, etc. The shiftorium still doesn't have draggable window functionality yet...
49 lines
1.6 KiB
VB.net
49 lines
1.6 KiB
VB.net
Public Class Titlebar
|
|
|
|
Public Property AppName As String
|
|
Set(value As String)
|
|
lbtitle.Text = value
|
|
End Set
|
|
Get
|
|
Return lbtitle.Text
|
|
End Get
|
|
End Property
|
|
|
|
Friend WithEvents prnt As Form = ParentForm
|
|
|
|
Private Sub Titlebar_Load(sender As Object, e As EventArgs) Handles Me.Load
|
|
Me.Dock = DockStyle.Top
|
|
Me.BringToFront()
|
|
End Sub
|
|
|
|
Private Sub titlebar_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown, lbtitle.MouseDown
|
|
' Handle Draggable Windows
|
|
If boughtdraggablewindows = True Then
|
|
If e.Button = MouseButtons.Left Then
|
|
Me.Capture = False
|
|
lbtitle.Capture = False
|
|
Const WM_NCLBUTTONDOWN As Integer = &HA1S
|
|
Const HTCAPTION As Integer = 2
|
|
Dim msg As Message = _
|
|
Message.Create(ParentForm.Handle, WM_NCLBUTTONDOWN, _
|
|
New IntPtr(HTCAPTION), IntPtr.Zero)
|
|
Me.DefWndProc(msg)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub DetermineMyVisibility()
|
|
If boughtbasicwm = True Then
|
|
Me.Show()
|
|
ParentForm.WindowState = FormWindowState.Normal
|
|
ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - ParentForm.Width) / 2
|
|
ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - ParentForm.Height) / 2
|
|
ParentForm.TopMost = True
|
|
Else
|
|
Me.Hide()
|
|
ParentForm.WindowState = FormWindowState.Maximized
|
|
ParentForm.TopMost = False
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|