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 Style and Colors #1080

Merged
merged 22 commits into from
Nov 10, 2021
Merged

GUI Style and Colors #1080

merged 22 commits into from
Nov 10, 2021

Conversation

notshillo
Copy link
Contributor

PR intention

Update the GUI colors and styling

Added new image assets
Added image assets and removed duplicate entries
moved to dedicated stylesheet
Set weekend color here as it cannot be done in the stylesheet
Fixed name conflict during compile
Clearer element names and small tweaks in UI consistency
Colorize icons uniformly across platforms and move text customization to stylesheet
Remove icons from buttons that already have text
fixed alignment issue
added stylesheet
moved styling to stylesheet
Prevent colorization of certain icons
Add logo to main toolbar
read and load stylesheet
Icons removed from main toolbar and menu
removed a few more icons from buttons with test
changed color
stylesheet
Update Makefile.qt.include

forgot to add the css
@lgtm-com
Copy link

lgtm-com bot commented Oct 27, 2021

This pull request fixes 2 alerts when merging 1b69f13 into 901ddd1 - view on LGTM.com

fixed alerts:

  • 2 for Commented-out code

@a-bezrukov
Copy link
Contributor

a-bezrukov commented Nov 1, 2021

image
image

This is HiDPI image (4k with 1.75 menus and bars scaling)

@a-bezrukov a-bezrukov self-requested a review November 1, 2021 17:25
@notshillo
Copy link
Contributor Author

image image

This is HiDPI image (4k with 1.75 menus and bars scaling)

apparently QSS and hiDPI don't mix well with font size. I'll look into it

@notshillo
Copy link
Contributor Author

As far as I can see the problem lies with element sizes set in the stylesheet which do not scale. My Qt experience is from before they introduced all the HiDPI scaling stuff so I am unsure of the best way forward.

The tableview header columns can be dragged to size (which I also need to do with the original GUI if I set my monitor to use 175% scaling at 4k).

The toolbar buttons in the current code are auto-generated when the actions are created and added to the toolbar in bitcoingui.cpp. The size is then set in the stylesheet (which doesn't scale). Ideally the toolbar should be rebuilt as buttons in a horizontal layout which should then allow dynamic sizing based on button content size to occur. This would require a decent amount of work to rewrite. It may be possible to load separate stylesheets or modify values via regex based on the scaling factor.

Also, when I set my monitor to 4k and 175% scaling I do not get the same result as in the images above. Possibly due to different version of Qt? I am using 5.9 (from the depends build).

@notshillo
Copy link
Contributor Author

I'll read up some more and see if I can find an easier solution

@notshillo
Copy link
Contributor Author

Setting the font size made it scale properly for me under win10.
The main toolbar item text will not get cut off anymore. Not an ideal fix as the buttons will not be of equal length (due to the limitation mentioned in #1080 (comment)).

Better support for HiDPI scaling on windows and possibly other platforms
@lgtm-com
Copy link

lgtm-com bot commented Nov 2, 2021

This pull request fixes 5 alerts when merging 98885dc into 634fc2d - view on LGTM.com

fixed alerts:

  • 3 for Unused static function
  • 2 for Commented-out code

@a-bezrukov
Copy link
Contributor

a-bezrukov commented Nov 2, 2021

It's a long living issue that when I start GUI now, I can see a QT warning in the console output:

Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.

If I move setting of this attribute higher in bitcoin.cpp:

diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index db26437bb..2cecde71e 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -658,7 +658,6 @@ int main(int argc, char *argv[])
     Q_INIT_RESOURCE(bitcoin);
     Q_INIT_RESOURCE(bitcoin_locale);
 
-    BitcoinApplication app(argc, argv);
 #if QT_VERSION > 0x050100
     // Generate high-dpi pixmaps
     QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
@@ -666,6 +665,8 @@ int main(int argc, char *argv[])
 #if QT_VERSION >= 0x050600
     QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
 #endif
+
+    BitcoinApplication app(argc, argv);
 #ifdef Q_OS_MAC
     QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
 #endif

the GUI starts looking differently (before it was a real mess):
image

Does it make sense to move it there?

Set Qt attributes before QCoreApplication is created
@notshillo
Copy link
Contributor Author

Yes it should be above BitcoinApplication app(argc, argv);

I missed that warning as for some reason I get zero console output on win10 when running firo-qt.exe via cmd.exe or powershell.

@lgtm-com
Copy link

lgtm-com bot commented Nov 2, 2021

This pull request fixes 6 alerts when merging 0d159d2 into 634fc2d - view on LGTM.com

fixed alerts:

  • 4 for Unused static function
  • 2 for Commented-out code

@reubenyap reubenyap merged commit 1962eac into firoorg:master Nov 10, 2021
notshillo added a commit to notshillo/firo that referenced this pull request Nov 27, 2021
* New Image Assets

Added new image assets

* Update bitcoin.qrc

Added image assets and removed duplicate entries

* Update modaloverlay.ui

moved to dedicated stylesheet

* Customize Calendar Widget

Set weekend color here as it cannot be done in the stylesheet

* Update sigmadialog.ui

Fixed name conflict during compile

* Update UI element names

Clearer element names and small tweaks in UI consistency

* Update platformstyle.cpp

Colorize icons uniformly across platforms and move text customization to stylesheet

* Update UI forms

Remove icons from buttons that already have text

* Update lelantusdialog.ui

fixed alignment issue

* Update bitcoin.qrc

added stylesheet

* Update bitcoingui.cpp

moved styling to stylesheet

* Keep certain icons black

Prevent colorization of certain icons

* Add logo to main toolbar

Add logo to main toolbar

* Load stylesheet

read and load stylesheet

* Remove icons

Icons removed from main toolbar and menu

* Update signverifymessagedialog.cpp

removed a few more icons from buttons with test

* Update chevron.png

changed color

* alignment

* Create firo.css

stylesheet

* Fix testnet splash image and jenkins build error

Update Makefile.qt.include

forgot to add the css

* Update firo.css

Better support for HiDPI scaling on windows and possibly other platforms

* Update bitcoin.cpp

Set Qt attributes before QCoreApplication is created
notshillo added a commit to notshillo/firo that referenced this pull request Dec 8, 2021
Set Qt attributes before QCoreApplication is created

New Image Assets

Added new image assets

Update bitcoin.qrc

Added image assets and removed duplicate entries

Update modaloverlay.ui

moved to dedicated stylesheet

Customize Calendar Widget

Set weekend color here as it cannot be done in the stylesheet

Update sigmadialog.ui

Fixed name conflict during compile

Update UI element names

Clearer element names and small tweaks in UI consistency

Update platformstyle.cpp

Colorize icons uniformly across platforms and move text customization to stylesheet

Update UI forms

Remove icons from buttons that already have text

Update lelantusdialog.ui

fixed alignment issue

Update bitcoin.qrc

added stylesheet

Update bitcoingui.cpp

moved styling to stylesheet

Keep certain icons black

Prevent colorization of certain icons

Add logo to main toolbar

Add logo to main toolbar

Load stylesheet

read and load stylesheet

Remove icons

Icons removed from main toolbar and menu

Update signverifymessagedialog.cpp

removed a few more icons from buttons with test

Update chevron.png

changed color

alignment

Create firo.css

stylesheet

Fix testnet splash image and jenkins build error

Update Makefile.qt.include

forgot to add the css

Update firo.css

Better support for HiDPI scaling on windows and possibly other platforms

GUI Style and Colors (firoorg#1080)

* New Image Assets

Added new image assets

* Update bitcoin.qrc

Added image assets and removed duplicate entries

* Update modaloverlay.ui

moved to dedicated stylesheet

* Customize Calendar Widget

Set weekend color here as it cannot be done in the stylesheet

* Update sigmadialog.ui

Fixed name conflict during compile

* Update UI element names

Clearer element names and small tweaks in UI consistency

* Update platformstyle.cpp

Colorize icons uniformly across platforms and move text customization to stylesheet

* Update UI forms

Remove icons from buttons that already have text

* Update lelantusdialog.ui

fixed alignment issue

* Update bitcoin.qrc

added stylesheet

* Update bitcoingui.cpp

moved styling to stylesheet

* Keep certain icons black

Prevent colorization of certain icons

* Add logo to main toolbar

Add logo to main toolbar

* Load stylesheet

read and load stylesheet

* Remove icons

Icons removed from main toolbar and menu

* Update signverifymessagedialog.cpp

removed a few more icons from buttons with test

* Update chevron.png

changed color

* alignment

* Create firo.css

stylesheet

* Fix testnet splash image and jenkins build error

Update Makefile.qt.include

forgot to add the css

* Update firo.css

Better support for HiDPI scaling on windows and possibly other platforms

* Update bitcoin.cpp

Set Qt attributes before QCoreApplication is created

ui fixes

debug alignment
inverted tool/tab bar colors
fixed visibility of toolbar extension button

font size

alternating tableview colors

Update firo.css
@reubenyap reubenyap added this to the v0.14.9.2 milestone Dec 15, 2021
levonpetrosyan93 pushed a commit that referenced this pull request May 17, 2023
* New Image Assets

Added new image assets

* Update bitcoin.qrc

Added image assets and removed duplicate entries

* Update modaloverlay.ui

moved to dedicated stylesheet

* Customize Calendar Widget

Set weekend color here as it cannot be done in the stylesheet

* Update sigmadialog.ui

Fixed name conflict during compile

* Update UI element names

Clearer element names and small tweaks in UI consistency

* Update platformstyle.cpp

Colorize icons uniformly across platforms and move text customization to stylesheet

* Update UI forms

Remove icons from buttons that already have text

* Update lelantusdialog.ui

fixed alignment issue

* Update bitcoin.qrc

added stylesheet

* Update bitcoingui.cpp

moved styling to stylesheet

* Keep certain icons black

Prevent colorization of certain icons

* Add logo to main toolbar

Add logo to main toolbar

* Load stylesheet

read and load stylesheet

* Remove icons

Icons removed from main toolbar and menu

* Update signverifymessagedialog.cpp

removed a few more icons from buttons with test

* Update chevron.png

changed color

* alignment

* Create firo.css

stylesheet

* Fix testnet splash image and jenkins build error

Update Makefile.qt.include

forgot to add the css

* Update firo.css

Better support for HiDPI scaling on windows and possibly other platforms

* Update bitcoin.cpp

Set Qt attributes before QCoreApplication is created
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.

3 participants