transgui icon indicating copy to clipboard operation
transgui copied to clipboard

Black Theme.

Open b0xBR opened this issue 7 years ago • 24 comments

Hi. Is possible to have any option of themes in a short time?

BTW, great project.

b0xBR avatar Aug 14 '17 01:08 b0xBR

Hi! Not, I don't know how to implement this into the Lazarus (pascal). Maybe later.

leonsoft-kras avatar Aug 14 '17 10:08 leonsoft-kras

for my eyes, i want to have it be black, not just an option to have a black theme

rzcat avatar Oct 15 '17 05:10 rzcat

I'd love this as well

OwiWanKenobe avatar Mar 09 '18 22:03 OwiWanKenobe

That would be perfect.

SoiledBrush avatar Jan 25 '19 06:01 SoiledBrush

Looking at the screenshot it can respond to a theme, but on Windows, it doesn't... Some other applications have started to do it, so it seems very possible.

thany avatar Feb 04 '19 10:02 thany

A dark theme would be lovely.

UltimateByte avatar May 09 '19 20:05 UltimateByte

It seems this won't happen unless Lazarus makes it happen, this project changes to a different compiler, or Windows applies its dark theme to more than just explorer.exe.

https://forum.lazarus.freepascal.org/index.php?topic=40444.0

ChaosBlades avatar Sep 14 '19 22:09 ChaosBlades

@ChaosBlades Linux client and the next release of macOS client will be able to do it, affected by system theme.

PeterDaveHello avatar Sep 15 '19 05:09 PeterDaveHello

Sorry I was not clear. I was talking specifically about Windows.

ChaosBlades avatar Sep 15 '19 11:09 ChaosBlades

@ChaosBlades yeah, no problem, just trying to clearify that Linux and macOS users will get it easier and earlier (as you can see in the README, the black screenshot is from Linux Mint)

PeterDaveHello avatar Sep 15 '19 11:09 PeterDaveHello

Why is it harder on Windows? Windows has a dark theme setting, too.

thany avatar Sep 15 '19 15:09 thany

Only for explorer.exe and UWP apps (newer ones) which this project is neither of. When you see things like control panel and Device Manager getting a dark theme then you can be excited.

ChaosBlades avatar Sep 15 '19 15:09 ChaosBlades

They are legacy and will likely never get updated. You know that.

Shall I name a few more programs with dark mode? Firefox, Chrome, Slack, Photoshop, Lightroom, Visual Studio, Visual Studio Code, Microsoft Office, Steam, Postman.

None of those are UWP, and all of them are dark, or can be dark, on both Windows and macOS. Yes, they are "big guys", but I'm sure they use some sort of standardized way to darktheme their applications. If I'm not mistaken, transgui does as well, proven by the fact that it does already pick up darkmode colours on macOS.

thany avatar Sep 25 '19 21:09 thany

Is there any need to rely on windows features to make it black? I don't think so, there must be a way to add a parameter for color. Oh and by the way, there is already a night mode in the Android app, it's toggle that doesn't rely on Android system to set its color.

UltimateByte avatar Sep 25 '19 22:09 UltimateByte

Are those programs you listed using Lazarus (pascal)? If they are find out how they are making there theme and post it here and we will get a dark theme. If they are not then we are back to my comment about "this project changes to a different compiler".

ChaosBlades avatar Sep 25 '19 22:09 ChaosBlades

Dunno. But in the end, you're just drawing Windows controls onto the screen. I don't think a compiler has much say in how that happens, so even if you're writing the program in C or Perl or what have you, my argument wouldn't change - if other programs can do it, all programs can do it.

thany avatar Sep 27 '19 08:09 thany

Sad to see dark mode not supported under windows as a new user to transmission and transmission remote GUI. Its hard for me to understand how it is not implemented, or at least on the road map. In this day and age i think the majority of users wants to be able to control their workstation environment, this includes Windows users. Having a white screen glaring in your face isnt exactly comfortable, even more so when everything else is dark.

nem8 avatar Mar 15 '20 20:03 nem8

Even Total Commander now has a (very rudimentary) dark mode, which is compiled through Delphi, I belive, which is also Pascal in the end. So it's possible alright.

And that's not nearly the only classical win32/win64 program that has a dark mode.

I really don't think the compiler, development tool, or language, has anything to do with whether a dark mode is supported, or can be supported. I also don't think it's any excuse that other programs aren't doing it either (such as legacy Windows settings panels, and other old software).

It's just awesome to provide a darkmode, and Transmission is awesome. Let's keep it that way 😎

thany avatar Mar 17 '20 10:03 thany

mkvtoolnix GUI and Process Lasso are also some classical Windows programs that got a dark theme months ago. Really all I'm waiting for now is transmission remote GUI and FileZilla to not burn the retinas out of my eyes every time I open them.

ChaosBlades avatar Mar 17 '20 10:03 ChaosBlades

For me personally, this is TransGui's only imperfection. It's the only application I use frequently that's glaringly white. My fingers and toes are crossed for a work around to be... Worked around.

Sh4d3d avatar Mar 27 '20 03:03 Sh4d3d

; This will let you hit F11 to invert any window. Usable with AutoHotKey 1.1

DllCall("GetWindowBand", "ptr", hGui, "uint*", band)
Gui, Destroy
hGui := ""

#SingleInstance Force
#MaxThreadsPerHotkey 2
DetectHiddenWindows, On
SetBatchLines -1
SetWinDelay -1
OnExit, Uninitialize
return

f11::
   hTarget := WinExist("A")
   if (hTarget = hTargetPrev)
   {
      hTargetPrev := ""
      count--
      return
   }

   count++

   hTargetPrev := hTarget

   if (hGui = "")
   {
      DllCall("LoadLibrary", "str", "magnification.dll")
      DllCall("magnification.dll\MagInitialize")
      Matrix := "-1|0|0|0|0|"
            . "0|-1|0|0|0|"
            . "0|0|-1|0|0|"
            . "0|0|0|1|0|"
            . "1|1|1|0|1"
      VarSetCapacity(MAGCOLOREFFECT, 100, 0)
      Loop, Parse, Matrix, |
         NumPut(A_LoopField, MAGCOLOREFFECT, (A_Index - 1) * 4, "float")
      loop 2
      {
         if (A_Index = 2)
            Gui, %A_Index%: +AlwaysOnTop   ; needed for ZBID_UIACCESS
            
         Gui, %A_Index%: +HWNDhGui%A_Index% -DPIScale +toolwindow -Caption +E0x02000000 +E0x00080000 +E0x20 ;  WS_EX_COMPOSITED := E0x02000000  WS_EX_LAYERED := E0x00080000  WS_EX_CLICKTHROUGH := E0x20
         hChildMagnifier%A_Index% := DllCall("CreateWindowEx", "uint", 0, "str", "Magnifier", "str", "MagnifierWindow", "uint", WS_CHILD := 0x40000000, "int", 0, "int", 0, "int", 0, "int", 0, "ptr", hGui%A_Index%, "uint", 0, "ptr", DllCall("GetWindowLong" (A_PtrSize=8 ? "Ptr" : ""), "ptr", hGui%A_Index%, "int", GWL_HINSTANCE := -6 , "ptr"), "uint", 0, "ptr")
         DllCall("magnification.dll\MagSetColorEffect", "ptr", hChildMagnifier%A_Index%, "ptr", &MAGCOLOREFFECT)
      }
   }

Gui, 2: Show, NA   ; needed for removing flickering
   hGui := hGui1
   hChildMagnifier := hChildMagnifier1
   loop
   {
      if (count != 1)   ; target window changed
      {
         if (count = 2)
            count--
         WinHide, ahk_id %hGui%
         return
      }

      VarSetCapacity(WINDOWINFO, 60, 0)
      if (DllCall("GetWindowInfo", "ptr", hTarget, "ptr", &WINDOWINFO) = 0) and (A_LastError = 1400)   ; destroyed
      {
         count--
         WinHide, ahk_id %hGui%
         return
      }
      
      if (NumGet(WINDOWINFO, 36, "uint") & 0x20000000) or !(NumGet(WINDOWINFO, 36, "uint") & 0x10000000)  ; minimized or not visible
      {
         if (wPrev != 0)
         {
            WinHide, ahk_id %hGui%
            wPrev := 0
         }
         sleep 10
         continue
      }
      
      x := NumGet(WINDOWINFO, 20, "int")
      y := NumGet(WINDOWINFO, 8, "int")
      w := NumGet(WINDOWINFO, 28, "int") - x
      h := NumGet(WINDOWINFO, 32, "int") - y
      
      if (hGui = hGui1) and ((NumGet(WINDOWINFO, 44, "uint") = 1) or (DllCall("GetAncestor", "ptr", WinExist("A"), "uint", GA_ROOTOWNER := 3, "ptr") = hTarget))   ; activated
      {
         hGui := hGui2
         hChildMagnifier := hChildMagnifier2
         WinMove, ahk_id %hGui%,, x, y, w, h
         WinMove, ahk_id %hChildMagnifier%,, 0, 0, w, h
         WinShow, ahk_id %hChildMagnifier%
         WinShow, ahk_id %hGui%
         hideGui := hGui1
      }
            else if (hGui = hGui2) and (NumGet(WINDOWINFO, 44, "uint") != 1) and ((hr := DllCall("GetAncestor", "ptr", WinExist("A"), "uint", GA_ROOTOWNER := 3, "ptr")) != hTarget) and hr   ; deactivated
      {
         hGui := hGui1
         hChildMagnifier := hChildMagnifier1
         WinMove, ahk_id %hGui%,, x, y, w, h
         WinMove, ahk_id %hChildMagnifier%,, 0, 0, w, h
         WinShow, ahk_id %hChildMagnifier%
         DllCall("SetWindowPos", "ptr", hGui, "ptr", hTarget, "int", 0, "int", 0, "int", 0, "int", 0, "uint", 0x0040|0x0010|0x001|0x002)
         DllCall("SetWindowPos", "ptr", hTarget, "ptr", 1, "int", 0, "int", 0, "int", 0, "int", 0, "uint", 0x0040|0x0010|0x001|0x002)   ; some windows can not be z-positioned before setting them to bottom
         DllCall("SetWindowPos", "ptr", hTarget, "ptr", hGui, "int", 0, "int", 0, "int", 0, "int", 0, "uint", 0x0040|0x0010|0x001|0x002)
         hideGui := hGui2 
      }
      else if (x != xPrev) or (y != yPrev) or (w != wPrev) or (h != hPrev)   ; location changed
      {
         WinMove, ahk_id %hGui%,, x, y, w, h
         WinMove, ahk_id %hChildMagnifier%,, 0, 0, w, h
         WinShow, ahk_id %hChildMagnifier%
         WinShow, ahk_id %hGui%
      }
      
      if (A_PtrSize = 8)
      {
         VarSetCapacity(RECT, 16, 0)
         NumPut(x, RECT, 0, "int")
         NumPut(y, RECT, 4, "int")
         NumPut(w, RECT, 8, "int")
         NumPut(h, RECT, 12, "int")
         DllCall("magnification.dll\MagSetWindowSource", "ptr", hChildMagnifier, "ptr", &RECT)
      }
      else
         DllCall("magnification.dll\MagSetWindowSource", "ptr", hChildMagnifier, "int", x, "int", y, "int", w, "int", h)
      xPrev := x, yPrev := y, wPrev := w, hPrev := h
      
      if hideGui
      {
         WinHide, ahk_id %hideGui%
         hideGui := ""
      }
   }
return

Uninitialize:
   if (hGui != "")
      DllCall("magnification.dll\MagUninitialize")
   ExitApp

;```

; found at : https://www.ahkscript.org/boards/viewtopic.php?f=6&t=94264

PockyBum522 avatar Dec 25 '21 14:12 PockyBum522

@PockyBum522 Inversion !== Darkmode

Think of it this way: is a photo taken in the dark the exact inverted version of the same photo taken in daylight?

thany avatar Dec 26 '21 15:12 thany

That is correct. I offered it not as a solution, but a stopgap. I too still want dark theme.

PockyBum522 avatar Dec 28 '21 22:12 PockyBum522

To which I will add there is little or no active development going on, regretfully. Unless a person of good will forks the project and puts in some effort, dark mode is never going to materialize.

Mrnofish avatar Dec 28 '21 23:12 Mrnofish