Skip to content

Fix icon color in dark mode#7953

Closed
JJJoex wants to merge 3 commits into
JabRef:mainfrom
JJJoex:Hsiung
Closed

Fix icon color in dark mode#7953
JJJoex wants to merge 3 commits into
JabRef:mainfrom
JJJoex:Hsiung

Conversation

@JJJoex

@JJJoex JJJoex commented Aug 2, 2021

Copy link
Copy Markdown

A new PR to #7917, fixes #7853
QQ截图20210802082831
by adding this at the end of PreferencesDialog.css and it works. Here's comparison.
BEFORE
QQ截图20210718171836
QQ截图20210718171728
QQ截图20210718171802
QQ截图20210718171824
AFTER
QQ截图20210802081841
QQ截图20210802081849
QQ截图20210802081709
QQ截图20210802081729

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@JJJoex JJJoex changed the title modified Fix icon color in dark mode, a new PR Aug 2, 2021
@calixtus

calixtus commented Aug 2, 2021

Copy link
Copy Markdown
Member

I'm pretty sure we use Ikonli-icons not just in the preferences dialog. So i guess it would be better, to put that into the base.css?

@calixtus

calixtus commented Aug 2, 2021

Copy link
Copy Markdown
Member

Btw, keeping the checkboxes in the PR description and checking them, if applicable, is mandatory!

@calixtus

calixtus commented Aug 2, 2021

Copy link
Copy Markdown
Member

Why did you open a new PR instead of pushing your commit onto the old branch?

@JJJoex

JJJoex commented Aug 2, 2021

Copy link
Copy Markdown
Author

@calixtus I've tried put it in base.css, but it also changes something else, which makes it weird.
QQ截图20210802080608
I think it should look like the following pic.
QQ截图20210802081709
So I just add it on perferencesDialog

@JJJoex JJJoex left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A discription to the work i've done.

@Siedlerchr

Copy link
Copy Markdown
Member

You only need to add it to Dark.css so that it only is applied when you select the Dark theme

@JJJoex

JJJoex commented Aug 2, 2021

Copy link
Copy Markdown
Author

@Siedlerchr I know, but in the figures following:
AFTER
InkedQQ截图20210802080608_LI
BEFORE
InkedQQ截图20210802081709_LI
In this dialog, these icons' color will change, so I think put this code in PreferencesDialog.css would be better.

@Siedlerchr

Siedlerchr commented Aug 2, 2021

Copy link
Copy Markdown
Member

try the following

to .glyph icon add -fx-icon-color: -jr-theme-text;
and before add the ikonli font icon

.ikonli-font-icon {
	-fx-icon-color: red;
}
.glyph-icon {
    /* This adjusts text alignment within the bounds of text nodes so that
       the text is always vertically centered within the bounds. Based on
       the cap height of the text. */
    -fx-bounds-type: logical_vertical_center;

    /* The base color of icons should always be the same as the text. */
    -fx-fill: -fx-text-base-color;
    -fx-icon-color: -jr-theme-text;
}

@JJJoex

JJJoex commented Aug 2, 2021

Copy link
Copy Markdown
Author

@Siedlerchr In this way, it works but still have problems. In the figure, you can see this icon is colored by the theme-color while it should be the text base color.
QQ截图20210802151804

@Siedlerchr

Copy link
Copy Markdown
Member

If you look into IconTheme, you see that there is a method asButton which adds another css class and makes it an icon-button. Seems like you need to add an extra rule for that

@calixtus calixtus changed the title Fix icon color in dark mode, a new PR Fix icon color in dark mode Aug 2, 2021
@Siedlerchr Siedlerchr self-assigned this Aug 16, 2021
@calixtus calixtus mentioned this pull request Aug 16, 2021
5 tasks
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.

Icons in Entry Edit Window not visible in Dark Mode

3 participants