From fa814b9715f98292dd1ce1c355ed021319e578f1 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Fri, 22 Jul 2016 12:25:58 +0200 Subject: [PATCH 1/4] Update themingcontroller.php --- apps/theming/lib/controller/themingcontroller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/theming/lib/controller/themingcontroller.php b/apps/theming/lib/controller/themingcontroller.php index aa35e84a676c1..0dec95cc67747 100644 --- a/apps/theming/lib/controller/themingcontroller.php +++ b/apps/theming/lib/controller/themingcontroller.php @@ -221,10 +221,11 @@ public function getStylesheet() { if($logo !== '') { $responseCss .= sprintf('#header .logo { background-image: url(\'./logo?v='.$cacheBusterValue.'\'); + background-size: contain; } #header .logo-icon { background-image: url(\'./logo?v='.$cacheBusterValue.'\'); - background-size: 62px 34px; + background-size: contain; }' ); } From f02eabb6a77217346c1b6f528ea522f7b829e6a2 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Fri, 22 Jul 2016 14:23:00 +0200 Subject: [PATCH 2/4] Update header.css make the logo look good on the login page --- core/css/header.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/css/header.css b/core/css/header.css index f3f5276c2a44c..dcd29016e1962 100644 --- a/core/css/header.css +++ b/core/css/header.css @@ -71,7 +71,7 @@ background-image: url('../img/logo-icon.svg?v=1'); background-repeat: no-repeat; background-size: 175px; - background-position: center 30px; + background-position: center; width: 252px; height: 120px; margin: 0 auto; From a494e4f712a232a20f27c7a844f920e4887c760d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 22 Jul 2016 14:58:30 +0200 Subject: [PATCH 3/4] Adjust tests --- apps/theming/tests/lib/controller/ThemingControllerTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/theming/tests/lib/controller/ThemingControllerTest.php b/apps/theming/tests/lib/controller/ThemingControllerTest.php index 9682e90239fb9..9ce93ec900ae0 100644 --- a/apps/theming/tests/lib/controller/ThemingControllerTest.php +++ b/apps/theming/tests/lib/controller/ThemingControllerTest.php @@ -355,10 +355,11 @@ public function testGetStylesheetWithOnlyHeaderLogo() { $expected = new Http\DataDownloadResponse('#header .logo { background-image: url(\'./logo?v=0\'); + background-size: contain; } #header .logo-icon { background-image: url(\'./logo?v=0\'); - background-size: 62px 34px; + background-size: contain; }', 'style', 'text/css'); $expected->cacheFor(3600); @$this->assertEquals($expected, $this->themingController->getStylesheet()); @@ -417,10 +418,11 @@ public function testGetStylesheetWithAllCombined() { $expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #abc}#header .logo { background-image: url(\'./logo?v=0\'); + background-size: contain; } #header .logo-icon { background-image: url(\'./logo?v=0\'); - background-size: 62px 34px; + background-size: contain; }#body-login { background-image: url(\'./loginbackground?v=0\'); }', 'style', 'text/css'); From 608dbc64d93ae06beb6c8a05e50196645fa206d1 Mon Sep 17 00:00:00 2001 From: Julius Haertl Date: Mon, 25 Jul 2016 18:54:13 +0200 Subject: [PATCH 4/4] Theming: Fix preview and center alignment of logo --- apps/theming/js/settings-admin.js | 10 +++++----- core/css/header.css | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index bd4b4b34ed1df..fa94a3d707c9a 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -41,12 +41,12 @@ function preview(setting, value) { console.log(setting); var logos = document.getElementsByClassName('logo-icon'); var timestamp = new Date().getTime(); - if(value !== '') { - logos[0].style.background = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')"; - logos[0].style.backgroundSize = "62px 34px"; + if (value !== '') { + logos[0].style.backgroundImage = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')"; + logos[0].style.backgroundSize = "contain"; } else { - logos[0].style.background = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')"; - logos[0].style.backgroundSize = "62px 34px"; + logos[0].style.backgroundImage = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')"; + logos[0].style.backgroundSize = "contain"; } } } diff --git a/core/css/header.css b/core/css/header.css index dcd29016e1962..c31dd9065c619 100644 --- a/core/css/header.css +++ b/core/css/header.css @@ -82,6 +82,7 @@ display: inline-block; background-image: url('../img/logo-icon.svg?v=1'); background-repeat: no-repeat; + background-position: center center; width: 62px; height: 34px; }