Skip to content

Commit

Permalink
Adds support for light/dark widget theme, adds experiemental support …
Browse files Browse the repository at this point in the history
…for http style sheets.
  • Loading branch information
ikskuh committed Jun 7, 2020
1 parent ec95bb3 commit 425f9d4
Show file tree
Hide file tree
Showing 109 changed files with 7,957 additions and 34 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Just use QtCreator to build `./src/kristall.pro`. Default settings should be fin
- [ ] For favourites
- [ ] For documents
- [ ] Image Zoom and Pan
- [ ] Light/Dark theme for Qt widgets
- [ ] HTML CSS
- [ ] Save/load/share theme preset
- [x] Light/Dark theme for Qt widgets
- [x] HTML CSS
- [ ] Save/load/share theme preset
- [ ] Improve Unicode/Emoji support

## Bugs

> <styan> xq: When using torsocks(1) on kristall QNetworkInterface complains loudly about not being permitted to create an IPv6 socket..
2 changes: 2 additions & 0 deletions lib/BreezeStyleSheets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
*.pyc
26 changes: 26 additions & 0 deletions lib/BreezeStyleSheets/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
The MIT License (MIT)
=====================

Copyright © `<2013-2014>` `<Colin Duquesnoy>`
Copyright © `<2015-2016>` `<Alex Huszagh>`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
96 changes: 96 additions & 0 deletions lib/BreezeStyleSheets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
BreezeStyleSheets
=================

Breeze and BreezeDark-like stylesheets for Qt Applications.

C++ Installation
================

Copy `breeze.qrc`, `dark.qss`, `light.qss` and the `dark` and `light` folders into your project directory and add the qrc file to your project file.

For example:

```qmake
TARGET = app
SOURCES = main.cpp
RESOURCES = breeze.qrc
```

To load the stylesheet in C++, load the file using QFile and read the data. For example, to load BreezeDark, run:

```cpp

#include <QApplication>
#include <QFile>
#include <QTextStream>


int main(int argc, char *argv[])
{
QApplication app(argc, argv);

// set stylesheet
QFile file(":/dark.qss");
file.open(QFile::ReadOnly | QFile::Text);
QTextStream stream(&file);
app.setStyleSheet(stream.readAll());

// code goes here

return app.exec();
}
```
PyQt5 Installation
==================
To compile the stylesheet for use with PyQt5, compile with the following command `pyrcc5 breeze.qrc -o breeze_resources.py`, and import the stylesheets. Afterwards, to load the stylesheet in Python, load the file using QFile and read the data. For example, to load BreezeDark, run:
```python
from PyQt5 import QtWidgets
from PyQt5.QtCore import QFile, QTextStream
import breeze_resources
def main():
app = QtWidgets.QApplication(sys.argv)
# set stylesheet
file = QFile(":/dark.qss")
file.open(QFile.ReadOnly | QFile.Text)
stream = QTextStream(file)
app.setStyleSheet(stream.readAll())
# code goes here
app.exec_()
}
```

License
=======

MIT, see [license](/LICENSE.md).

Example
=======

**Breeze/BreezeDark**

Example user interface using the Breeze and BreezeDark stylesheets side-by-side.

![BreezeDark](/assets/Breeze.gif)

Acknowledgements
================

BreezeStyleSheets is a fork of [QDarkStyleSheet](https://github.com/ColinDuquesnoy/QDarkStyleSheet).

Contact
=======

Email: ahuszagh@gmail.com
Twitter: KardOnIce

Binary file added lib/BreezeStyleSheets/assets/Breeze.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions lib/BreezeStyleSheets/breeze.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<RCC>
<qresource>
<file>light/hmovetoolbar.svg</file>
<file>light/vmovetoolbar.svg</file>
<file>light/hsepartoolbar.svg</file>
<file>light/vsepartoolbars.svg</file>
<file>light/stylesheet-branch-end.svg</file>
<file>light/stylesheet-branch-end-closed.svg</file>
<file>light/stylesheet-branch-end-open.svg</file>
<file>light/stylesheet-vline.svg</file>
<file>light/stylesheet-branch-more.svg</file>
<file>light/branch_closed.svg</file>
<file>light/branch_closed-on.svg</file>
<file>light/branch_open.svg</file>
<file>light/branch_open-on.svg</file>
<file>light/down_arrow.svg</file>
<file>light/down_arrow_disabled.svg</file>
<file>light/down_arrow-hover.svg</file>
<file>light/left_arrow.svg</file>
<file>light/left_arrow_disabled.svg</file>
<file>light/right_arrow.svg</file>
<file>light/right_arrow_disabled.svg</file>
<file>light/up_arrow.svg</file>
<file>light/up_arrow_disabled.svg</file>
<file>light/up_arrow-hover.svg</file>
<file>light/sizegrip.svg</file>
<file>light/transparent.svg</file>
<file>light/close.svg</file>
<file>light/close-hover.svg</file>
<file>light/close-pressed.svg</file>
<file>light/undock.svg</file>
<file>light/undock-hover.svg</file>
<file>light/checkbox_checked-hover.svg</file>
<file>light/checkbox_checked.svg</file>
<file>light/checkbox_checked_disabled.svg</file>
<file>light/checkbox_indeterminate.svg</file>
<file>light/checkbox_indeterminate-hover.svg</file>
<file>light/checkbox_indeterminate_disabled.svg</file>
<file>light/checkbox_unchecked-hover.svg</file>
<file>light/checkbox_unchecked_disabled.svg</file>
<file>light/radio_checked-hover.svg</file>
<file>light/radio_checked.svg</file>
<file>light/radio_checked_disabled.svg</file>
<file>light/radio_unchecked-hover.svg</file>
<file>light/radio_unchecked_disabled.svg</file>
<file>dark/hmovetoolbar.svg</file>
<file>dark/vmovetoolbar.svg</file>
<file>dark/hsepartoolbar.svg</file>
<file>dark/vsepartoolbars.svg</file>
<file>dark/stylesheet-branch-end.svg</file>
<file>dark/stylesheet-branch-end-closed.svg</file>
<file>dark/stylesheet-branch-end-open.svg</file>
<file>dark/stylesheet-vline.svg</file>
<file>dark/stylesheet-branch-more.svg</file>
<file>dark/branch_closed.svg</file>
<file>dark/branch_closed-on.svg</file>
<file>dark/branch_open.svg</file>
<file>dark/branch_open-on.svg</file>
<file>dark/down_arrow.svg</file>
<file>dark/down_arrow_disabled.svg</file>
<file>dark/down_arrow-hover.svg</file>
<file>dark/left_arrow.svg</file>
<file>dark/left_arrow_disabled.svg</file>
<file>dark/right_arrow.svg</file>
<file>dark/right_arrow_disabled.svg</file>
<file>dark/up_arrow.svg</file>
<file>dark/up_arrow_disabled.svg</file>
<file>dark/up_arrow-hover.svg</file>
<file>dark/sizegrip.svg</file>
<file>dark/transparent.svg</file>
<file>dark/close.svg</file>
<file>dark/close-hover.svg</file>
<file>dark/close-pressed.svg</file>
<file>dark/undock.svg</file>
<file>dark/undock-hover.svg</file>
<file>dark/checkbox_checked.svg</file>
<file>dark/checkbox_checked_disabled.svg</file>
<file>dark/checkbox_indeterminate.svg</file>
<file>dark/checkbox_indeterminate_disabled.svg</file>
<file>dark/checkbox_unchecked.svg</file>
<file>dark/checkbox_unchecked_disabled.svg</file>
<file>dark/radio_checked.svg</file>
<file>dark/radio_checked_disabled.svg</file>
<file>dark/radio_unchecked.svg</file>
<file>dark/radio_unchecked_disabled.svg</file>
<file>light.qss</file>
<file>dark.qss</file>
</qresource>
</RCC>
Loading

0 comments on commit 425f9d4

Please sign in to comment.