Skip to content

Commit 393f7f8

Browse files
authored
Merge pull request #623 from nextcloud/stable9-fix-searchbox-background
[stable9] fix searchbox background
2 parents 0bda5d1 + 176fbf9 commit 393f7f8

File tree

3 files changed

+68
-5
lines changed

3 files changed

+68
-5
lines changed

apps/theming/lib/controller/themingcontroller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function __construct(
7070
IRootFolder $rootFolder
7171
) {
7272
parent::__construct($appName, $request);
73-
73+
7474
$this->template = $template;
7575
$this->l = $l;
7676
$this->config = $config;
@@ -213,7 +213,7 @@ public function getStylesheet() {
213213
$color = $this->config->getAppValue($this->appName, 'color');
214214
if($color !== '') {
215215
$responseCss .= sprintf(
216-
'#body-user #header,#body-settings #header,#body-public #header {background-color: %s}',
216+
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}',
217217
$color
218218
);
219219
}

apps/theming/tests/lib/controller/ThemingControllerTest.php

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,33 @@ public function testGetLoginBackground() {
305305
}
306306

307307
public function testGetStylesheetWithOnlyColor() {
308+
$this->config
309+
->expects($this->at(0))
310+
->method('getAppValue')
311+
->with('theming', 'cachebuster', '0')
312+
->willReturn('0');
313+
$this->config
314+
->expects($this->at(1))
315+
->method('getAppValue')
316+
->with('theming', 'color', '')
317+
->willReturn('#000');
318+
$this->config
319+
->expects($this->at(2))
320+
->method('getAppValue')
321+
->with('theming', 'logoMime', '')
322+
->willReturn('');
323+
$this->config
324+
->expects($this->at(3))
325+
->method('getAppValue')
326+
->with('theming', 'backgroundMime', '')
327+
->willReturn('');
328+
329+
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #000}', 'style', 'text/css');
330+
$expected->cacheFor(3600);
331+
@$this->assertEquals($expected, $this->themingController->getStylesheet());
332+
}
333+
334+
public function testGetStylesheetWithOnlyColorInvert() {
308335
$this->config
309336
->expects($this->at(0))
310337
->method('getAppValue')
@@ -326,7 +353,7 @@ public function testGetStylesheetWithOnlyColor() {
326353
->with('theming', 'backgroundMime', '')
327354
->willReturn('');
328355

329-
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #fff}', 'style', 'text/css');
356+
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}', 'style', 'text/css');
330357
$expected->cacheFor(3600);
331358
@$this->assertEquals($expected, $this->themingController->getStylesheet());
332359
}
@@ -416,7 +443,43 @@ public function testGetStylesheetWithAllCombined() {
416443
->with('theming', 'backgroundMime', '')
417444
->willReturn('image/png');
418445

419-
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #abc}#header .logo {
446+
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #abc}#header .logo {
447+
background-image: url(\'./logo?v=0\');
448+
background-size: contain;
449+
}
450+
#header .logo-icon {
451+
background-image: url(\'./logo?v=0\');
452+
background-size: contain;
453+
}#body-login {
454+
background-image: url(\'./loginbackground?v=0\');
455+
}', 'style', 'text/css');
456+
$expected->cacheFor(3600);
457+
@$this->assertEquals($expected, $this->themingController->getStylesheet());
458+
}
459+
460+
public function testGetStylesheetWithAllCombinedInverted() {
461+
$this->config
462+
->expects($this->at(0))
463+
->method('getAppValue')
464+
->with('theming', 'cachebuster', '0')
465+
->willReturn('0');
466+
$this->config
467+
->expects($this->at(1))
468+
->method('getAppValue')
469+
->with('theming', 'color', '')
470+
->willReturn('#fff');
471+
$this->config
472+
->expects($this->at(2))
473+
->method('getAppValue')
474+
->with('theming', 'logoMime', '')
475+
->willReturn('text/svg');
476+
$this->config
477+
->expects($this->at(3))
478+
->method('getAppValue')
479+
->with('theming', 'backgroundMime', '')
480+
->willReturn('image/png');
481+
482+
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}#header .logo {
420483
background-image: url(\'./logo?v=0\');
421484
background-size: contain;
422485
}

core/css/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ body {
108108
width: 155px;
109109
max-width: 50%;
110110
cursor: text;
111-
background-color: transparent;
111+
background-color: #0082c9;
112112
border: 1px solid rgba(255, 255, 255, .5);
113113
}
114114

0 commit comments

Comments
 (0)