Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/theming/lib/ImageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(IConfig $config,
$this->tempManager = $tempManager;
}

public function getImageUrl(string $key, bool $useSvg = true): string {
public function getImageUrl(string $key, bool $useSvg = true, string $primaryColor = '#0082c9'): string {
$cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0');
if ($this->hasImage($key)) {
return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter;
Expand All @@ -88,7 +88,8 @@ public function getImageUrl(string $key, bool $useSvg = true): string {
case 'favicon':
return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter;
case 'background':
return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter;
$primaryColor = ltrim($primaryColor, '#');
return $this->urlGenerator->imagePath('core', 'background.php') . '?v=' . $cacheBusterCounter . '&color=' . $primaryColor;
}
return '';
}
Expand Down
4 changes: 2 additions & 2 deletions apps/theming/lib/Themes/DefaultTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ public function getCSSVariables(): array {
$variables["--image-background-plain"] = 'true';
continue;
} else if ($image === 'background') {
$variables['--image-background-size'] = 'cover';
$variables['--image-background-size'] = !$this->imageManager->hasImage($image) ? '275px, contain' : 'cover';
}
$variables["--image-$image"] = "url('".$this->imageManager->getImageUrl($image)."')";
$variables["--image-$image"] = "url('".$this->imageManager->getImageUrl($image, true, $this->primaryColor)."')";
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, but no.
This is a weird feature. If I select my own image as a login, I do not want this weird overlay containing apps icons

}
$variables["--image-login-background"] = $variables["--image-background"];

Expand Down
2 changes: 1 addition & 1 deletion core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body {
color: var(--color-primary-text);
text-align: center;
background-color: var(--color-primary);
background-image: var(--image-background, var(--image-background-plain, url('../../../core/img/background.svg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)));
background-image: var(--image-background, url('../img/background.png')), var(--gradient-primary-background);;
Copy link
Member

@skjnldsv skjnldsv Aug 16, 2022

Choose a reason for hiding this comment

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

You're removing features here.
The login page has 3 options (by order of priority):

  1. the user uploaded a custom background image
  2. the user disabled the background image for primary only
  3. the default Nextcloud background.svg with Nextcloud default linear gradient

With your changes, I cannot remove the background image anymore

If I revert ba3f533 from #33452, this works again
Peek 16-08-2022 08-31

Copy link
Member

Choose a reason for hiding this comment

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

background-position: 50% 50%;
background-repeat: repeat;
background-size: var(--image-background-size, 275px, contain);
Expand Down
4 changes: 4 additions & 0 deletions core/img/background.php

Large diffs are not rendered by default.