Skip to content
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

GUI Tweaks: Set Qt5 default style to 'Fusion' #96

Merged
merged 2 commits into from Oct 30, 2019
Merged

GUI Tweaks: Set Qt5 default style to 'Fusion' #96

merged 2 commits into from Oct 30, 2019

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Oct 30, 2019

Qt5 will try to set the application GUI style to something system appropriate, which doesn't interfere with the theme on at least Gnome, although it fails to render as intended on Unity, Windows 7/10, and MacOS. Setting the default style to "Fusion" resolves this at least on Windows. Need to test for others.

See Qt5 documentation: https://doc.qt.io/qt-5/qapplication.html#setStyle-1

This PR also adds the --style= flag to novelWriter, so that the default can be overridden by the user. It forwards this flag to QApplication's -style= flag. If the style isn't available, Qt5 handles this gracefully and just prints an error message and continues.

This solves issue #95, at least for Windows. Other OSes need testing.

@codecov-io
Copy link

Codecov Report

Merging #96 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   62.77%   62.77%   +<.01%     
==========================================
  Files          42       42              
  Lines        6627     6630       +3     
==========================================
+ Hits         4160     4162       +2     
- Misses       2467     2468       +1
Impacted Files Coverage Δ
nw/__init__.py 68.18% <50%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30ff34d...ec05986. Read the comment docs.

@vkbo
Copy link
Owner Author

vkbo commented Oct 30, 2019

Confirmed working on Ubuntu 16.04 / Unity as well.

@vkbo vkbo merged commit 886a679 into master Oct 30, 2019
@vkbo vkbo deleted the gui_tweaks branch November 2, 2019 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants