-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] RDCMAN - add Darkmode #787
Comments
May I ask how were you able to change RDCMAN.exe? I did download DNSPY, and opened RDCMAN.exe, then navigated to RdcMan --> MainForm, but I have no idea how to add those lines of code that you wrote above. |
Hi @Simke771, your first steps were so far correct. On the first function you right click inside the "Function private MainForm() and then click on "Edit method" in the contextmenu. After you have finished the modifications on the Function you click on button "Compile" on the bottom right. When You have made all the changes you wanted. You go in the Menu on File -> Save Module. |
Thank you @xperia-droid for your fast reply, but it seems like I'm still doing something wrong. Even when I just open Edit Method, and don't change anything, Complie will fail with a bunch of errors. Also not sure if I'm adding your code correctly, but like I said, my first problem is that compile doesn't work even when I do zero changes to it. Original looks like this:
If I understand your original post it should be like this:
|
Hi @Simke771, interesting behavior, I can't reproduce it on my side. If you send me your mail adress (or another file transfer link) I can send you my compiled executable to you. Because at the moment I don't know how to fix your issue. An easy idea would be to remove .NET 5.0 from your installed programs, restart DNSPY and try again. |
Hey @xperia-droid You are correct, the problem was because I also have .NET 5.0 on my work computer since it was required for some other software that we are using. I tried to compile it on my other computer without .NET 5.0 and it works exactly as it should. |
Hello @xperia-droid, Thank you for this awesome post! Already 99% better and less painful on my eyes. I was wondering if you could, when time permits, find out where one goes to change the title bar and contextmenus: And for the client area when a "not connected server" is clicked on: As well, can this icon (or a better version of it) be used to replace the current to show it is the dark mode version: Pretty pretty please? |
Hi @karynnglli, I have read your post and I will go trough the easy steps to the hard ones. ThumbnailTo set the background of the thumbnail panels, you need to change the method "AddToClientPanel" in the MainForm class: class MainForm From
To
Then compile the method. TitleBarFor an dark title bar you have to make some code modifications on the class "RdcBaseForm". Copy this code
And insert it under this line:
Then compile the class. Source from here: https://stackoverflow.com/a/64927217 Replace IconsTo replace the Icons, we need to replace 2 different icons. Replace Resource IconThe Resource Icon is the Icon you see in the Title Bar on the left side. In DnSpy scroll on the left side up to the top and open the Resources folder. We have to replace the resource called "RdcMan.Resources.app.ico".
Replace Manifest IconThe Manifest Icon is the Icon you see in the windows explorer. You have to save this file, because we need another programm called Resource Hacker to be able to replace the manifest Icon. After you saved the file, download the good old Resource Hacker from here: Extract the zip file to an destination you like and open the file ResourceHacker.exe. In Resource Hacker open the previous saved RDCMAN executable. On the Left side you have an TreeView structure. After you selected the icon click on the button "Replace". Then in the main window of Resource Hacker click on "File" -> Save. Now the Icon on the RDCMAN executable has been changed. Sometimes after you make some changes with Resource Hacker you see the old Icon. To fix it, you can do one of the 2 following solutions:
For Clearing the Icon cache follow this process:
Custom ContextMenu and MenuStripsThe elephant in the room is the MenuStrips and Contextmenu part. The default MenuStrips / ContextMenus doesn't fit an dark theme and therefore are completly unreadable. As an workaround I set the RenderMode of the MenuStrip to System. I have made the change in the class RdcBaseForm (RdcBaseForm method) (From my first post).
If you switch the RenderMode to any other Option than System, compile the method, save the module and start it you will see what I mean. To be able to set an dark mode RenderMode you have to create an new class and then set the RenderMode of the ToolStrip to the new generated class. I don't know If you can add a new class with DnSpy to the RDCMan executable and then switch the RenderMode I need to test it. For this part I will add an new post regarding my findings. |
Custom MenuStripTo create an dark Mode to the MenuStrip we have to add 2 classes: In the new Window paste this code in:
Then click on compile. For the next class to be added we have to save the Module, because the second class references the added class. So click on File -> "Save Module...". If you use the same name you click under File -> Reload All Assemblies to geload all files. If you don't use the same name click under File -> "Close All" and then File -> "Open..." to open the new created file. The reload / opening of the new file is required to add the new class. Otherwise you get an compile error on the next step. After the reload right click again on the namespace RdcMan and click on "Add Class (C#)...". This time you add this class:
Then again we have to save the module under File -> "Save Module" and execute the same procedure as on the first class to reload the saved file. We have to go trough this process again, because we need to reference the second generated class in the RdcBaseForm class. Open the RdcBaseForm under the RdcMan namespace. Replace this part:
With this
compile the method and save the module for the last time. ContextMenusTo change the ContextMenus style you have to be added the classes from above. ServerTree ContextMenusIn DnSpy move to the class ServerTree in the RdcMan namespace. Then move the the method called Init: In this function we have to add the Renderer to the contextmenu: Replace this code:
with this code:
Then save the method and afterwards save the module. Now are the contextmenus in the ServerTree region in dark mode. Thumbnail ContextMenusWhen you right click on the Thumbnail of an connection there is another Contextmenu we have to change. To set the darkmode for this Contextmenu move to the class "ServerLabel". Replace:
With:
Save the method and save the Module at the last time under File -> "Save Module...". I have tried in the past to set an dark mode on the different windows in RDCMAN, but the result was very hilarious. I tried my best to fix it, but after an hour of trying I let it go. Because the most time I'm using RDCMAN is using the RDP connections, so my main goal was it to have an dark mode on the main window. Which should be now fully working. |
Hello @xperia-droid, Followed the first set of steps you provided and was wondering if the client area while connecting to clients could be put in dark mode as well! Thanks! |
Hi @Jinhova, What I have found out, in the class RdcMan.Server is the function "InitClient()". This function initializes the specific RDP-Client, and the initialized rdp-client connects afterwards to the given RDP-server. In the if-statement at the end it switches the visible control on the panel.
I tried different methods on the object this._client to set an darkmode but without any changes in the result. I tried to change the backcolor of the object this._client._rdpClient9 (which got used on my test), but the result was the same. I hope someone else has an idea or ChatGPT. EDIT: The Background and the ForeColor are correct set, but in the connectng it shows always an white screen. In the past I used this App to connect to the rdp-servers I have: https://github.com/1Remote/1Remote It had in the old code called (https://github.com/VShawn/PRemoteM) an black connecting screen, but the code got removed and replaced with an new behavior. On my side the connecting to screen disappears immediatly and I haven't found a way to set an dark screen when connecting to an server I won't further investigate this. |
@xperia-droid thank you for taking a swing at this request. Thanks, |
Please add an dark mode in RDCMAN.
I made an approach by myself, to change the colors in the main form:
I didn't change the contextmenus and the dialog forms, only the main window.
I have set the darkmode colors via DNSPY.
The following changes were made:
Class Mainform
Class FormTools
Class ServerTree
Class RdcBaseForm
The text was updated successfully, but these errors were encountered: