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

Use system colors #49

Merged
merged 4 commits into from
May 7, 2024
Merged

Conversation

dospuntos
Copy link
Contributor

@dospuntos dospuntos commented May 1, 2024

Fixes #48 - all windows are using color constants.
Fixes #23 - using default Haiku icons for alerts.

Additional changes:

  • App menu with app icon (About, Quit, etc.)
  • Alert modals are using default Haiku icons instead of the previous custom icons. The old icons did not work well with dark backgrounds.
  • Alert modals are centered in main window when displayed. Enter a transaction without Payee or Category to see examples.

Notes:

  • About-modal is also centered in main window, is this OK? Most native apps seem to center it on screen.
  • A few sections in the main window (QuickTracker and Add Transaction form) will not live-update the text/background color when system colors are changed. Restarting the app brings in the right colors.

capitalBe dark

@dospuntos dospuntos force-pushed the gui-changes branch 2 times, most recently from d5d1708 to be15e63 Compare May 1, 2024 05:03
owner->SetHighColor(255, 255, 255, 128);
owner->SetLowColor(255, 255, 255, 128);
owner->SetHighUIColor(B_LIST_BACKGROUND_COLOR);
owner->SetLowUIColor(B_LIST_ITEM_TEXT_COLOR);
}
}
owner->FillRect(frame);
Copy link
Member

Choose a reason for hiding this comment

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

Something isn't right here. We go through all the effort to determine the right High- and LowColors, depending on selection, enabled and account-closed. Only to draw a rectangle.
Then in line 59 we potentially change the HighColor to stroke the frame.
Then we change the HighColor again in line 64 to draw the text.

I think the text drawing should be done right after filling the rect, when the colours to use are still valid.
Drawing the rect only needs the HighColor set. Maybe it can be simplified by using rgb_color variables and set them to either selected/unselected and then tint them if needed (enabled/disabled, account-closed).

This may be applicable to other drawing code as well...

Currently, the drawing isn't correct. Try using a white on blue text for selected list items:
screenshot

Added some missing translation strings
Minor code cleanup
@dospuntos
Copy link
Contributor Author

@humdingerb I've updated the PR. Quite a lot of changes, but they are (almost) all related to the display colors.

I can't seem to get the code formatting right, even when running git-haiku-format?

@korli
Copy link
Contributor

korli commented May 6, 2024

I can't seem to get the code formatting right, even when running git-haiku-format?

This isn't a problem, the code will be automatically formatted after the merge.

@humdingerb
Copy link
Member

Thanks @dospuntos ! Weird that when changing system colours some things only appear right after restarting the app. Let's merge this now to get it off your plate. :)

@humdingerb humdingerb merged commit f79ccc3 into HaikuArchives:master May 7, 2024
2 of 3 checks passed
@dospuntos dospuntos deleted the gui-changes branch May 7, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use system colors Change icon style
3 participants