Skip to content

Fix theme switching exception#8939

Merged
koppor merged 6 commits intoJabRef:mainfrom
HoussemNasri:fix-theme-switching
Jul 3, 2022
Merged

Fix theme switching exception#8939
koppor merged 6 commits intoJabRef:mainfrom
HoussemNasri:fix-theme-switching

Conversation

@HoussemNasri
Copy link
Copy Markdown
Member

@HoussemNasri HoussemNasri commented Jun 30, 2022

Remove installCss(dialogScene) from dialogs because JavaFX already handle that

  • If we update dialog stylesheet ourselves then we're breaking the binding made by JavaFX and thus unexpected behaviors may/will happen

Screenshot 2022-06-30 120301

Screenshot 2022-06-30 120335

Exception

java.lang.IndexOutOfBoundsException: toIndex = 3
	at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:507)
	at java.base/java.util.AbstractList.subList(AbstractList.java:497)
	at javafx.base@18/javafx.collections.ModifiableObservableListBase.subList(ModifiableObservableListBase.java:196)
	at javafx.base@18/com.sun.javafx.binding.ContentBinding$ListContentBinding.onChanged(ContentBinding.java:114)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
	at javafx.base@18/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
	at javafx.base@18/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
	at javafx.base@18/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
	at javafx.base@18/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
	at javafx.base@18/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
	at javafx.base@18/javafx.collections.ModifiableObservableListBase.setAll(ModifiableObservableListBase.java:98)
	at org.jabref@100.0.0/org.jabref.gui.theme.ThemeManager.updateAdditionalCss(ThemeManager.java:161)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at java.base/java.util.Collections$SetFromMap.forEach(Collections.java:5700)
	at org.jabref@100.0.0/org.jabref.gui.theme.ThemeManager.lambda$additionalCssLiveUpdate$10(ThemeManager.java:138)
	at org.jabref@100.0.0/org.jabref.gui.theme.ThemeManager.lambda$additionalCssLiveUpdate$11(ThemeManager.java:137)
	at javafx.graphics@18/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@18/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
	at javafx.graphics@18/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at javafx.graphics@18/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@18/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
	at java.base/java.lang.Thread.run(Thread.java:833)

  • 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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

…ndle that

- If we update dialog stylesheet ourselves than we're breaking the binding made by JavaFX and thus unexpected behaviours may/will happen
@Siedlerchr
Copy link
Copy Markdown
Member

Yeah, works fine!

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 1, 2022
@koppor koppor merged commit 050cd3f into JabRef:main Jul 3, 2022
Siedlerchr added a commit to LIM0000/jabref that referenced this pull request Jul 9, 2022
* upstream/main:
  Disable ResearchGateTest on CI (JabRef#8955)
  Bump checkstyle from 10.1 to 10.3.1 (JabRef#8950)
  Bump checkstyle from 10.1 to 10.3.1 (JabRef#8950)
  Bump mariadb-java-client from 2.7.5 to 2.7.6 (JabRef#8953)
  Add notification when adding previous entries to new group configuration (JabRef#8919)
  Remember Sidepane width after restart (JabRef#8936)
  move "Warn about duplicates on import" preferences option (JabRef#8937)
  Fix theme switching exception (JabRef#8939)
  fix merge conflict
  Squashed 'buildres/csl/csl-locales/' changes from 969d9567ac..55459cd79f
  Squashed 'buildres/csl/csl-styles/' changes from e740261..3d3573c
  Show pdf icon for mime type in maintable (JabRef#8935)
  Fix for Dark theme not readable (JabRef#8929)
  Find Unlinked files should ignore Thumbs.db, etc (JabRef#8800)
  Try to  make reproducible builds (JabRef#8925)
  Link to new board (and refine text)
Siedlerchr added a commit that referenced this pull request Jul 10, 2022
* upstream/main:
  Bump checkstyle from 10.1 to 10.3.1 (#8950)
  Bump mariadb-java-client from 2.7.5 to 2.7.6 (#8953)
  Add notification when adding previous entries to new group configuration (#8919)
  Remember Sidepane width after restart (#8936)
  move "Warn about duplicates on import" preferences option (#8937)
  Fix theme switching exception (#8939)
Siedlerchr added a commit that referenced this pull request Jul 14, 2022
…failure-dialog

* upstream/main: (76 commits)
  New Crowdin updates (#8972)
  New Crowdin updates (#8969)
  Fix .bat errorlevel handling with pwsh.exe check (#8965)
  revert jsoup version upgrade
  Fix charset detection with utf16 and others (#8947)
  Bump classgraph from 4.8.147 to 4.8.149 (#8968)
  Bump jsoup from 1.15.1 to 1.15.2 (#8967)
  Keep UTF-8 encoding header if present (#8964)
  Cleanup index when opening a library (#8962)
  Refactor context menu entry types changing (#8957)
  Improvement on check for missing commas when importing or opening a .bib file (#8840)
  Disable ResearchGateTest on CI (#8955)
  Bump checkstyle from 10.1 to 10.3.1 (#8950)
  Bump checkstyle from 10.1 to 10.3.1 (#8950)
  Bump mariadb-java-client from 2.7.5 to 2.7.6 (#8953)
  Add notification when adding previous entries to new group configuration (#8919)
  Remember Sidepane width after restart (#8936)
  move "Warn about duplicates on import" preferences option (#8937)
  Fix theme switching exception (#8939)
  fix merge conflict
  ...

# Conflicts:
#	src/main/resources/l10n/JabRef_en.properties
Siedlerchr added a commit to LIM0000/jabref that referenced this pull request Jul 15, 2022
* upstream/main: (28 commits)
  [Bot] Update CSL styles (JabRef#8978)
  New Crowdin updates (JabRef#8972)
  New Crowdin updates (JabRef#8969)
  Fix .bat errorlevel handling with pwsh.exe check (JabRef#8965)
  revert jsoup version upgrade
  Fix charset detection with utf16 and others (JabRef#8947)
  Bump classgraph from 4.8.147 to 4.8.149 (JabRef#8968)
  Bump jsoup from 1.15.1 to 1.15.2 (JabRef#8967)
  Keep UTF-8 encoding header if present (JabRef#8964)
  Cleanup index when opening a library (JabRef#8962)
  Refactor context menu entry types changing (JabRef#8957)
  Improvement on check for missing commas when importing or opening a .bib file (JabRef#8840)
  Disable ResearchGateTest on CI (JabRef#8955)
  Bump checkstyle from 10.1 to 10.3.1 (JabRef#8950)
  Bump checkstyle from 10.1 to 10.3.1 (JabRef#8950)
  Bump mariadb-java-client from 2.7.5 to 2.7.6 (JabRef#8953)
  Add notification when adding previous entries to new group configuration (JabRef#8919)
  Remember Sidepane width after restart (JabRef#8936)
  move "Warn about duplicates on import" preferences option (JabRef#8937)
  Fix theme switching exception (JabRef#8939)
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ui status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants