-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add a Spyder dark theme #2350
Comments
Something like that would be amazing. I am far from experienced enough of a coder to implement something like this, but if there is any testing I can do or help in any other way, please let me know. |
This was a one liner (using https://github.com/ColinDuquesnoy/QDarkStyleSheet)! It would need a bit of tweaking to get it to work with the rest ... but what do you guys think? |
👍 |
I really like it and I'm also +1 for it, but:
|
It seems like too much work for 3.0. Maybe for 3.1 if @goanpeca wants to tackle it? |
I agree with all the todos but:
|
(4.) Because it can become unmaintained at any time :-) Well, we'll fork it when that happens :-p |
@ccordoba12 how are the css/style defined in the object inspector? |
They're defined in |
@goanpeca it should be easy to parameterize the qtawesome colors in the new icon manager, but (I think) that you would need to restart Spyder to change themes. |
Hmmmm I think we should avoid that :p if possible. Also... why do we need to restart spyder to change themes? |
In you screenshot, the icons having grey components don't show well.
|
We should be able to trigger it if it is not the case already. |
Yes, except that in our case this would be re-instantiating all the QIcons. I hope it works though. |
I think that's unavoidable :-) I really doubt Qt |
@ccordoba12 Yes you can, not directly, but what I have done is overload the paint method so that if it detects that the style has change it will repaint (using the new css you select). This could be added as a decorator on the paint method to avoid a lot of code repetition. This is how I managed to get the new global directory combobox to update based on style change |
Ok, didn't know that :-) |
But it seems that it would not recompute the QIcons? |
Yes they will :-) |
Hmm yes... maybe not :s will look further into it |
Dear @goanpeca, How can I get rid of this terrible editor and console grey borders and make top tabs looks like bottom tabs on Mac? I've added lines: import qdarkstyle
MAIN_APP.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False)) Version and main components
Dependencies
|
@azenin, there's nothing you can do about it for now, sorry :-( We use our own style customizations on Mac. We need to adapt them to make Spyder work with |
Here are some results I have using QDarkStyle, some changes in QDarkStyle also can provide better visualization for the dropdown, and textbox. ColinDuquesnoy/QDarkStyleSheet#90 To use QDarkStyle is two line changes in the spyder/app/mainwindow (not the best place, just for testing) highlighted inside the screenshoots. I think it is a nice and simple idea to have this as an option inside the Spyder (window theme selection dropdown menu). It should be a optional package. And now we (QDarkStyle) are using QtPy also. So, no compatibility problems. I've tested using Spyder 3.3.2-dev, Anaconda 4.4, Python 3.6, Linux Ubuntu 16.04. The problems reported before in this post may have been corrected. @jnsebgosselin, @olundberg The most problematic is the new icon package (spyder3) that does not work with the dark background. Using the version Two it is pretty nice. Some adjusts should be make in the editor style to match the backgroud...may providing a QDarkSytle theme for the editors too. Check these screenshoots, using icon package Spyder v2 Configuration Editor theme selected, I've changed the background to match Then using the Icon package Spyder v3 Configuration Tnksss |
@dpizetta, QDarkStyle looks really good in Spyder! I'll assign some resources to implement this solution for Spyder 4 and make it work with the Spyder 3 icon theme. |
Just a note: I've used an old version call in the screenshot. As I mentioned, we are using qtpy. Thus, you need to use qdarkstyle.load_stylesheet_from_environment(), it gets from the qtpy. No need for qdarkstyle.load_stylesheet_from_pyqt5() as in the example. In the QDarkStyle V3 it would be qdarkstyle.load_stylesheet(). Black themes are the best for the programmers' eyes heheh. TKs |
Totally agreed! |
I am using Anaconda to launch spyder. I used
Please Help! |
To add to this topic: On macOS, there is the option to call |
Hey everyone, worked perfectly for me. Thanks so much! The background colour for the code/text, however, did not align with the style sheet and I did not know how to check the background colour in terms of HEX or HTML. So, if you struggle, try this:
|
As @Wurtzinator said, background color set to #232629 worked for me for the syntax coloring. |
Much,much better.Thanx |
Anaconda3 users on Windows 10 (last step makes it chill!!!)
|
It is better to use int he final version
So, it gets the qt_api from QtPy environment variable. Thus, people not get problems with they use pyside2 in place of pyqt5 |
Ok people, I need help: I got the qdarkstyle to work in Spyder 3 for Python 2 and then 3 a while back, but then had to reinstall the entire conda environment. conda info here: After a fresh install, I now tried to get it to work again, but it does not work, and I do not know why.The code just seems to break: When I add the 'import qdarkstyle' line, it is all fine until then and Spyder 3 opens normally. The moment I add the 'self.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())' line, Spyder 3 will not start. When I delete that line again, it starts normally. What am I missing? @dpizetta I tried your suggestion instead, but do not know where I should put this: I tried it at the same spot as the other command, i.e. under the section ofinit****(self, options=None):
|
@Wurtzinator That second location made the difference for whatever reason be sure to select spyder2 and Spyder dark themes....and a restart. hope it works. |
I had the same issue when I changed the file several months ago, and then it worked. But I made sure this time to change the correct file, i.e. \Anaconda3\Lib\site-packages\spyder\app\mainwindow.py and it still does not work :( |
Hi @kaneman100 and @Wurtzinator, did you have some more info from logging from the debug mode? If not, try to add some
Note the change: qdarkstyle.load_from_environment(), so it gets the qt api (pyside, pyqt, etc) from the QT_API environment variable, same used for QtPy, so you need to make sure that this variable is set before setting using this function (qdarkstyle.load_from_environment()). I'm using in spyer/app/mainwindow.py
|
In the Python 3.6.6, Qt5.9.3, PyQt5.9.2 both your and my code are working, may is something with Py2. I'm waiting for your reply |
Mine is working fine. I just had to switch the folder I modified main in.
Wurtinator was having a tougher issue.
…On Mon, Nov 12, 2018, 3:37 PM Daniel Pizetta ***@***.*** wrote:
In the Python 3.6.6, Qt5.9.3, PyQt5.9.2 both your and my code are working,
may is something with Py2. I'm waiting for your reply
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2350 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ap57ESdIJxFh-7uFwgEf5TwbqsF7oarAks5uudvrgaJpZM4EG0he>
.
|
@dpizetta THANK YOU SO MUCH! It finally worked, yeahiiiiiiiii! Thanks also for the code placement, otherwise I would have been lost. :D I am now wondering whether it is also possible to get the help windows as well as the JupyterNotebook extension dark? Is that possible? Again, thanks big time!!! |
Tks. May they are not applying the style sheet in the notebook. It should use the same widget, as they have menus and toolbars. I saw something mentioned here. Some of them I saw they fixed. |
QDarkStyleSheet was a bit too blue for me. I've been trying to recreate Qt Creator's dark flat theme and stumbled on this post
just before the return of initialize function in app/mainwindow.py It turned out just as I like, but some dark icons became barely visible. So I dug a bit deeper into the code and edited icon function in utils/icon_manager.py
|
We already implemented a full dark theme for Spyder 4, and that's going to be available since our next beta (4.0beta2). For now I'm going to lock this issue because we don't support, endorse, or want people to use hacks against any of our Thanks for understanding! |
There are some minor details to be worked out, but I'd say this issue is solved now. |
I guess this can be achieved bu having custom themes on a OS level, but it would be nice to be able to set Spyder to a dark theme directly in Spyder.
Something like what Dark style sheet provides...
The text was updated successfully, but these errors were encountered: