Dark Theme for LINQPad
Hi all,
New to the forum, thought I would share something with anyone who is interested to try it out.
I read a few posts in the LINQPad User Voice about a Dark Theme and took a crack at making one for the editor AND results window.
I've skinned the results grid, dump container headers and search highlighting, try CTRL SHIFT F :-)
You'll notice the background is not fully black rgb(0,0,0), it's rgb(30,30,30) which is a little easier on the eyes when contrast with the eye-gouging white of the non-skinned windows.
The Grid (cue Daft Punk now)
Dump Container Headers and some code
Search Results
How to set it up
First job:
Choose Edit > Preferences.
On the "Editor" tab in the "Editor Background" fieldset,
choose "Custom" then click the "Choose" button
and click "Define Custom Colors >>" and enter the RGB values as 30,30,30.
Second job (stay in Preferences):
Over in the "Results" tab in the "Style sheet for text (HTML) results" fieldset,
choose "Custom" then click the "Launch Editor" button and then click the "Ok"
button to close Preferences (the LINQPad Stylesheet Editor will remain open).
Now copy and paste the CSS from the bottom of this post into
the "Customizations" window and click the "Apply Changes" button at
the bottom of the editor.
Move the stylesheet editor out of the way (or close it) and then query some data.
You should now have a code editor and results window with a quasi-dark-theme
Enjoy.
PS. To remove it, just clear out all the CSS from the Customizations section of the LINQPad Stylesheet editor window.
PPS. You might notice a few full colours (like #0f0) in the CSS, they're left over from me trying to find where they're used. Let me know what triggers them and I will tweak those colours as well.
PPPS. Yes, I live in one of those countries where we put a "u" in the word color
The CSS
New to the forum, thought I would share something with anyone who is interested to try it out.
I read a few posts in the LINQPad User Voice about a Dark Theme and took a crack at making one for the editor AND results window.
I've skinned the results grid, dump container headers and search highlighting, try CTRL SHIFT F :-)
You'll notice the background is not fully black rgb(0,0,0), it's rgb(30,30,30) which is a little easier on the eyes when contrast with the eye-gouging white of the non-skinned windows.
The Grid (cue Daft Punk now)
Dump Container Headers and some code
Search Results
How to set it up
First job:
Choose Edit > Preferences.
On the "Editor" tab in the "Editor Background" fieldset,
choose "Custom" then click the "Choose" button
and click "Define Custom Colors >>" and enter the RGB values as 30,30,30.
Second job (stay in Preferences):
Over in the "Results" tab in the "Style sheet for text (HTML) results" fieldset,
choose "Custom" then click the "Launch Editor" button and then click the "Ok"
button to close Preferences (the LINQPad Stylesheet Editor will remain open).
Now copy and paste the CSS from the bottom of this post into
the "Customizations" window and click the "Apply Changes" button at
the bottom of the editor.
Move the stylesheet editor out of the way (or close it) and then query some data.
You should now have a code editor and results window with a quasi-dark-theme
Enjoy.
PS. To remove it, just clear out all the CSS from the Customizations section of the LINQPad Stylesheet editor window.
PPS. You might notice a few full colours (like #0f0) in the CSS, they're left over from me trying to find where they're used. Let me know what triggers them and I will tweak those colours as well.
PPPS. Yes, I live in one of those countries where we put a "u" in the word color
The CSS
/* Dark Theme */ body { background: rgb(30,30,30); color: rgb(220,220,220); } table { border: 2px solid rgb(50,50,50); } table.limit { border-collapse: collapse; border-bottom: 2px solid #f0f; } td, th { border: 1px solid rgb(50,50,50); padding: 0.2em 0.2em; padding-bottom: 0.5em; padding-right: 1em; } th { background-color: rgb(80,80,80); border: 1px solid rgb(50,50,50); color: rgb(220,220,220); } td.typeheader { border: 1px solid rgb(50,50,50); background-color: rgb(80,80,80); color: rgb(220,220,220); padding: 0.2em 0.2em; } a:link.typeheader, a:visited.typeheader, a:link.extenser, a:visited.extenser { background-color: rgb(80,80,80); color: rgb(220,220,220); } span.graphbar { background: #17b; color: #17b; } table.headingpresenter { border-left: 10px solid rgb(232,139,12); } th.headingpresenter { background-color: rgb(30,30,30); color: #17b; } td.summary { background-color: #0f0; color: #f00; } td.columntotal { background-color: rgb(80,80,80); color: rgb(220,220,220); } span.highlight { background: rgb(255,250,13); color: rgb(30,30,30); font-weight: bold; padding: 2px; } tr:hover { background-color: rgb(0,0,0); }
Comments
Type `if`, press Tab, press Down arrow and you will see the foreground colour and the background colour together make a hard to read combination
Hopefully if Joe can spare some CPU cycles, he can make those snippet editing colours adapt based on the chosen background.
Moved the DumpContainer style overrides to the bottom so they are applied last.
This has inspired me to make a few more tweaks and fix a couple of things.
Summaries
Fixed the style to be inline with the rest of the theme.
References and Collections
Ref links show in the native blue with one thin vertical bar next to them, while collections show in orange with two vertical bars next to them (kind of like icons - but without icons)
I've also added a version number to the CSS (I can see more tweaks coming).
Updated CSS
Thanks!
Eric
http://www.linqpad.net/download.aspx#beta5
Go to Edit | Preferences, first tab, and choose 'Dark Theme'.
Let me know how you get on.
Just one very small thing - the white text on lighter grey is really hard to read. In particular the status bar ("Query successful (xx seconds)" I have to really move close to the screen and squint to make out. If the background could be darker that would be perfect.
-Eric
Thanks for the dark panels.
I just purchased my second copy of LINQPad (went with a full v5 license rather than upgrading my v4).
PS. Does that Contact Me form on albahari.com reach you ?
I dropped a few questions in there for you about a week ago.
I can't reproduce it.
PS. I don't work for Joe/LINQPad. I'm just interested in this feature and want to help tweak it.
On that note, I mocked up some minor adjustments (to the LINQPad side of things) and wondered what you Dark Theme fans think?
If people like it, maybe Joe will consider a few more adjustments.
Open image in new tab (it's large).
I think it might happen if the columns are a little narrower than the text that goes in them. I was also trying to copy and paste one row into a new one.
I like your screens -as far as I am concerned the darker the background and lighter the text on it the better.
The main tabs are also now dark and the TreeView scrollbars hide when the mouse isn't over the control.
Unfortunately, I cannot easily replace the Windows title bar because this requires removing the default Windows border and this disables Aero snap.
I'd quite like the language and connection dropdowns to white on black, but it doesn't make a big difference and that's just me being picky.
One thing - when you have a DB selected, next to the dropdown it says "Use xxx_db". I'm finding this pretty impossible to read.
I will try to get around to looking at the datagrids, honest...
Glad you did the tab borders and frames too. I would have asked about those next (small steps ).
It is a thing of beauty.
Firstly, here's a SQL script to setup the DB and some data:
CREATE DATABASE LinqpadTest
GO
USE LinqpadTest
GO
CREATE TABLE Sample
(
SampleID VARCHAR(20) NOT NULL PRIMARY KEY,
Description VARCHAR(100) NOT NULL,
AnotherColumn VARCHAR(50) NULL
)
GO
INSERT INTO Sample VALUES('First Record', 'record number one', 'test')
INSERT INTO Sample VALUES('Second Record', 'record number two', 'test')
INSERT INTO Sample VALUES('Third Record', 'record number three', 'test')
Not sure if it's important that the first column is not an identity primary key. This is similar to the DB I saw the problem with the other day.
Now I opened up a linqpad query, C# statements, switched to datagrid mode and typed in "Samples.Dump();"
Now, click "Edit Data" and type into the new row. For me it's black on black - I can't read it until I select it. (Reproduced at work on Win7 and at home on Win10).
There's another problem (which might be more a feature request I'm not sure..)
Select the whole "Third Record" row by clicking in the margin to the left of it. Press Ctrl+C to copy.
Now click in the margin to the left of the new row and press Ctrl+V. What I would expect is that LinqPad creates a duplicate of the third record row for me to change. What it actually does is paste all the text in the first column with a big bit of indentation at the start (" Third Record recor null null")
This is what I was doing the other day but couldn't read the text so hadn't realised this is what was going on. It would be nice if LinqPad would work more like SQL Management Studio in this respect.
It's also possible to get linqpad a little confused if you really try to abuse it. I managed to get linqpad to show two "new" rows (i.e. two that were just null for everything) and F5 to refresh didn't clear it. But a new tab showed some of the rows weren't there. I can't do this reliably though and it's probably not normal!
Having said all this, I am loving the new theme. Those small changes have made all the difference - it's a joy to use. And the new app config thing is also stunning. This is a really awesome beta.
The border of the tab control seems to flicker back to the default lighter grey colour rather then the new Dark theme colours. The version I am using is v5.08.01.