From 183d4d8e9968e40bdc5f55eee26d12f3cebc0e43 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 b6fb1a6be5b9a..7e7791b46ce7f 100644 --- a/apps/theming/lib/controller/themingcontroller.php +++ b/apps/theming/lib/controller/themingcontroller.php @@ -224,10 +224,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 642f59e159d3cc5b5a54da9bbcc3443182e05904 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 91c6639deec75..cf7c981955ead 100644 --- a/core/css/header.css +++ b/core/css/header.css @@ -71,7 +71,7 @@ background-image: url('../img/logo-icon.svg'); background-repeat: no-repeat; background-size: 175px; - background-position: center 30px; + background-position: center; width: 252px; height: 120px; margin: 0 auto; From 8457c617e03301c8989447fbf60baf81bc0cbba9 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 --- .../tests/lib/controller/ThemingControllerTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/theming/tests/lib/controller/ThemingControllerTest.php b/apps/theming/tests/lib/controller/ThemingControllerTest.php index 6dcb4b548c43d..3a8405909b032 100644 --- a/apps/theming/tests/lib/controller/ThemingControllerTest.php +++ b/apps/theming/tests/lib/controller/ThemingControllerTest.php @@ -383,10 +383,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()); @@ -445,10 +446,11 @@ public function testGetStylesheetWithAllCombined() { $expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #000}#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'); @@ -479,10 +481,11 @@ public function testGetStylesheetWithAllCombinedInverted() { $expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #fff}#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\'); }#header .header-appname, #expandDisplayName { color: #000000; } #header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); } .searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }', 'style', 'text/css'); From d58ff6853173680e4156c482f6eb335586c8bb13 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 | 8 ++++---- core/css/header.css | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index 85e781411ed3f..941ec5c711bdd 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -75,11 +75,11 @@ function preview(setting, value) { 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"; + 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 cf7c981955ead..6078008f91f81 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'); background-repeat: no-repeat; + background-position: center center; width: 62px; height: 34px; }