Skip to content

Conversation

@jasonyang-ee
Copy link

@jasonyang-ee jasonyang-ee commented Jul 29, 2024

Description

It is impossible to use any reading app without custom background and text color setting. The current PR code is not complete. Feel free to reject this PR.

However, this change has demonstrated the method on changing background color using mupdf API. The current implementation is to hard code a color.

If you like this change, please continue the work to expend qml to allow user to input hex color code and be passed down to page_controller.cpp line:63 for a completed feature.

The text color, on the other hand, is impossible to change with this dependency choice (mupdf). So, I have gave up on using this app for eBook reading. This PR is only to document the effort that I have spend to fix the issue I initiated.

Related Tickets & Documents

How Has This Been Tested?

Compiled locally on Windows using Qt 6.7.2 + MSVC 2019 with self hosted server.

  • 1st Stage: Background color change using mupdf color space setting.
  • 2nd Stage: Tried to find text color change API, but there's none. Please refer to this topic.
  • 3rd Stage: Attempt to use tint function to replace black text, but it will fuck up book images. The attempt is commented out but left in code for future reference.

2024-31-0230

2024-31-0231

2024-31-0232

Added or Updated Tests?

  • 👍 Yes
  • 🙅 No, and this is why: Minor changes only. No logic update.
  • 🙋 I need help with writing tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added proof(eg. screenshots) that prove my fix is effective or that my feature works
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@DavidLazarescu
Copy link
Member

Thanks for the PR. I'll definitely add the qml functionality to set a color when I have some free time.

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.

[Feature]: Custom color for font and background and granular zoom setting

2 participants