AboutSystem, Installer: show light/dark logos

* Use B_DOCUMENT_TEXT_COLOR and B_DOCUMENT_BACKGROUND_COLOR instead
  of black on white in text views.

* Depending on HAIKU_DISTRO_COMPATIBILITY_OFFICIAL build flag, either
  show the official Haiku logo or the Walter logo.

* If the official Haiku logo is used, show a version with black letters
  if B_DOCUMENT_BACKGROUND_COLOR is light, and white letters if it's not.

* Remove the "installer" versions of the black-on-white Haiku logo.
  Instead introduce "black|white-on-transparent" logos with a
  transparent background.

* Fixed the leave shadows in logo Wonderbrush files. Especially the
  yellow leave's shadow appeared too large and blurry.

Change-Id: I6d3ac384d2c96d91d35e6d6e85025c9e2064d59e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7419
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Humdinger 2024-02-20 08:34:31 +01:00 committed by waddlesplash
parent 7644bd25fc
commit 0aede635f1
22 changed files with 52 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -424,14 +424,23 @@ AboutWindow::QuitRequested()
LogoView::LogoView()
:
BView("logo", B_WILL_DRAW),
fLogo(BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo.png"))
BView("logo", B_WILL_DRAW)
{
SetDrawingMode(B_OP_OVER);
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
rgb_color bgColor = ui_color(B_DOCUMENT_BACKGROUND_COLOR);
if (bgColor.IsLight())
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo.png");
else
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo_dark.png");
#else
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "walter_logo.png");
#endif
// Set view color to panel background color when fLogo is NULL
// to prevent a white pixel from being drawn.
if (fLogo != NULL)
SetViewColor(255, 255, 255);
else
if (fLogo == NULL)
SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
}
@ -468,7 +477,11 @@ LogoView::Draw(BRect updateRect)
if (fLogo == NULL)
return;
DrawBitmap(fLogo, BPoint((Bounds().Width() - fLogo->Bounds().Width()) / 2, 0));
BRect bounds(Bounds());
SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
FillRect(bounds, B_SOLID_LOW);
DrawBitmap(fLogo, BPoint((bounds.Width() - fLogo->Bounds().Width()) / 2, 0));
}

View File

@ -20,10 +20,14 @@ resource app_flags B_SINGLE_LAUNCH;
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
#ifdef HAIKU_OFFICIAL_RELEASE
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on white - tiny.png";
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on transparent - tiny.png";
resource(2, "logo_dark.png") #'PNG ' import "../../../data/artwork/HAIKU logo - white on transparent - tiny.png";
#else
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on white - tiny - versioned.png";
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on transparent - tiny - versioned.png";
resource(2, "logo_dark.png") #'PNG ' import "../../../data/artwork/HAIKU logo - white on transparent - tiny - versioned.png";
#endif
#else
resource(1, "walter_logo.png") #'PNG ' import "../../../data/artwork/Walter logo.png";
#endif
resource vector_icon {

View File

@ -19,12 +19,14 @@ resource app_flags B_EXCLUSIVE_LAUNCH;
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
#ifdef HAIKU_OFFICIAL_RELEASE
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on white - installer.png";
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on transparent - installer.png";
resource(2, "logo_dark.png") #'PNG ' import "../../../data/artwork/HAIKU logo - white on transparent - installer.png";
#else
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on white - installer - development.png";
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/HAIKU logo - black on transparent - installer - development.png";
resource(2, "logo_dark.png") #'PNG ' import "../../../data/artwork/HAIKU logo - white on transparent - installer - development.png";
#endif
#else
resource(1, "logo.png") #'PNG ' import "../../../data/artwork/Walter logo.png";
resource(1, "walter_logo.png") #'PNG ' import "../../../data/artwork/Walter logo.png";
#endif
resource vector_icon {

View File

@ -17,6 +17,7 @@
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <ColorConversion.h>
#include <ControlLook.h>
#include <Directory.h>
#include <FindDirectory.h>
@ -107,10 +108,13 @@ LogoView::~LogoView(void)
void
LogoView::Draw(BRect update)
{
BRect bounds(Bounds());
SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
FillRect(bounds, B_SOLID_LOW);
if (fLogo == NULL)
return;
BRect bounds(Bounds());
BPoint placement;
placement.x = (bounds.left + bounds.right - fLogo->Bounds().Width()) / 2;
placement.y = (bounds.top + bounds.bottom - fLogo->Bounds().Height()) / 2;
@ -138,7 +142,18 @@ LogoView::GetPreferredSize(float* _width, float* _height)
void
LogoView::_Init()
{
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo.png");
SetDrawingMode(B_OP_OVER);
#ifdef HAIKU_DISTRO_COMPATIBILITY_OFFICIAL
rgb_color bgColor = ui_color(B_DOCUMENT_BACKGROUND_COLOR);
if (bgColor.IsLight())
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo.png");
else
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "logo_dark.png");
#else
fLogo = BTranslationUtils::GetBitmap(B_PNG_FORMAT, "walter_logo.png");
#endif
}
@ -171,9 +186,10 @@ InstallerWindow::InstallerWindow()
LogoView* logoView = new LogoView();
fStatusView = new BTextView("statusView", be_plain_font, NULL,
rgb_color baseColor = ui_color(B_DOCUMENT_TEXT_COLOR);
fStatusView = new BTextView("statusView", be_plain_font, &baseColor,
B_WILL_DRAW);
fStatusView->SetViewColor(255, 255, 255, 255);
fStatusView->SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
fStatusView->MakeEditable(false);
fStatusView->MakeSelectable(false);
@ -190,7 +206,7 @@ InstallerWindow::InstallerWindow()
// Create a group view with a white background since the logo and status text won't have the
// same height, this background will show in the remaining space
fLogoGroup = new BGroupView(B_HORIZONTAL, 10);
fLogoGroup->SetViewColor(255, 255, 255);
fLogoGroup->SetViewUIColor(B_DOCUMENT_BACKGROUND_COLOR);
fLogoGroup->GroupLayout()->SetInsets(0, 0, 10, 0);
fLogoGroup->AddChild(logoView);
fLogoGroup->AddChild(fStatusView);

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src apps installer ;
UsePrivateHeaders shared storage tracker ;
UsePrivateHeaders interface shared storage tracker ;
UsePrivateSystemHeaders ;
SubDirHdrs [ FDirName $(HAIKU_TOP) src kits tracker ] ;