Page 1 of 1

Space before window title

Posted: Sat Feb 25, 2023 10:49 pm
by itzybitzyspider
Hi guys, simple question here.

https://pasteboard.co/uGMs61mSXSA6.png

how do you set that space before the title of a window? Is this a global icon or can I set it per window?

Re: Space before window title

Posted: Sun Feb 26, 2023 1:24 pm
by Peter
Quick'nDirty:

Code: Select all

EnableExplicit

Procedure SetWindowTitleIcon(Window, Icon.s)
  
  If IsWindow(Window) = #False : ProcedureReturn : EndIf
  
  Protected WID = WindowID(Window)
  
  ! var win = v_wid.window;
  ! var wintitle = $(win).find(".spiderwindow-title");
  ! wintitle.parent().prepend("<div style='position: absolute; top: 2px; left: 2px; height: 22px; width: 22px; line-height: 22px; text-align: center;'>" + v_icon + "</div>");
  
EndProcedure

OpenWindow(0, #PB_Ignore, #PB_Ignore, 600, 400, "WindowIconTest1", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowTitleIcon(0, "😀")

OpenWindow(1, #PB_Ignore, #PB_Ignore, 300, 200, "WindowIconTest2", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowTitleIcon(1, "😎")
Image

Re: Space before window title

Posted: Sun Feb 26, 2023 11:25 pm
by itzybitzyspider
@Peter, much obliged as always!