Skip to content

Commit 3573e9c

Browse files
authored
Use entry's accent color for release notes title bar (#176)
1 parent 5d33fbe commit 3573e9c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

include/store/storeUtils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace StoreUtils {
9595
size_t FindSplitPoint(const std::string &str, const std::vector<std::string> splitters);
9696
void ProcessReleaseNotes(std::string ReleaseNotes);
9797

98-
void DrawReleaseNotes(const int &scrollOffset, const std::string &title);
98+
void DrawReleaseNotes(const int &scrollOffset, const std::unique_ptr<StoreEntry> &entry);
9999
void ReleaseNotesLogic(int &scrollOffset, int &scrollDelta, int &storeMode);
100100

101101
bool compareTitleDescending(const std::unique_ptr<StoreEntry> &a, const std::unique_ptr<StoreEntry> &b);

source/menu/releaseNotes.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void StoreUtils::ProcessReleaseNotes(std::string releaseNotes) {
7878
} while (splitPos != std::string::npos);
7979
}
8080

81-
void StoreUtils::DrawReleaseNotes(const int &scrollOffset, const std::string &title) {
82-
if (title != "" && StoreUtils::store) {
81+
void StoreUtils::DrawReleaseNotes(const int &scrollOffset, const std::unique_ptr<StoreEntry> &entry) {
82+
if (entry && StoreUtils::store) {
8383
Gui::ScreenDraw(Bottom);
8484
Gui::Draw_Rect(0, 26, 320, 214, UIThemes->BGColor());
8585

@@ -88,10 +88,11 @@ void StoreUtils::DrawReleaseNotes(const int &scrollOffset, const std::string &ti
8888
if (25 + i * fontHeight > scrollOffset && 25 + i * fontHeight < scrollOffset + 240.0f)
8989
Gui::DrawString(5, 25 + i * fontHeight - scrollOffset, 0.5f, UIThemes->TextColor(), wrappedNotes[i], 310, 0, font);
9090
}
91+
uint32_t accentColor = config->useAccentColor() && !config->changelog() ? entry->GetAccentColor() : 0;
9192

92-
Gui::Draw_Rect(0, 0, 320, 25, UIThemes->BarColor());
93+
Gui::Draw_Rect(0, 0, 320, 25, accentColor ? accentColor : UIThemes->EntryBar());
9394
Gui::Draw_Rect(0, 25, 320, 1, UIThemes->BarOutline());
94-
Gui::DrawStringCentered(0, 1, 0.7f, UIThemes->TextColor(), title, 310, 0, font);
95+
Gui::DrawStringCentered(0, 1, 0.7f, accentColor ? WHITE : UIThemes->TextColor(), config->changelog() ? std::string("Universal-Updater ") + C_V : entry->GetTitle(), 310, 0, font);
9596

9697
GFX::DrawIcon(sprites_arrow_idx, back.x, back.y, UIThemes->TextColor());
9798

source/screens/mainScreen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ void MainScreen::Draw(void) const {
170170
StoreUtils::DrawSideMenu(this->storeMode);
171171
if (this->storeMode == 7) {
172172
/* Release Notes. */
173-
std::string title = config->changelog() ? std::string("Universal-Updater ") + C_V : StoreUtils::entries[StoreUtils::store->GetEntry()]->GetTitle();
174-
StoreUtils::DrawReleaseNotes(this->scrollOffset, title);
173+
StoreUtils::DrawReleaseNotes(this->scrollOffset, StoreUtils::entries[StoreUtils::store->GetEntry()]);
175174
return;
176175
}
177176
if (this->showMarks && StoreUtils::store && StoreUtils::store->GetValid()) StoreUtils::DisplayMarkBox(StoreUtils::entries[StoreUtils::store->GetEntry()]->GetMarks());

0 commit comments

Comments
 (0)