Invert app icons on IE11 as well
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
ee0653d68b
commit
8a226811dc
|
@ -46,8 +46,14 @@
|
||||||
<li data-id="<?php p($entry['id']); ?>" class="hidden">
|
<li data-id="<?php p($entry['id']); ?>" class="hidden">
|
||||||
<a href="<?php print_unescaped($entry['href']); ?>"
|
<a href="<?php print_unescaped($entry['href']); ?>"
|
||||||
<?php if ($entry['active']): ?> class="active"<?php endif; ?>>
|
<?php if ($entry['active']): ?> class="active"<?php endif; ?>>
|
||||||
|
<?php if ($_['themingInvertMenu']) { ?>
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20">
|
||||||
|
<defs><filter id="invert-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>
|
||||||
|
<image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" filter="url(#invert-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon" /></svg>
|
||||||
|
<?php } else { ?>
|
||||||
<img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"
|
<img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"
|
||||||
class="app-icon" alt="<?php p($entry['name']); ?>" />
|
class="app-icon" alt="<?php p($entry['name']); ?>" />
|
||||||
|
<?php } ?>
|
||||||
<div class="icon-loading-small-dark"
|
<div class="icon-loading-small-dark"
|
||||||
style="display:none;"></div>
|
style="display:none;"></div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -108,6 +108,15 @@ class TemplateLayout extends \OC_Template {
|
||||||
$this->assign('userAvatarVersion', $this->config->getUserValue(\OC_User::getUser(), 'avatar', 'version', 0));
|
$this->assign('userAvatarVersion', $this->config->getUserValue(\OC_User::getUser(), 'avatar', 'version', 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if app menu icons should be inverted
|
||||||
|
try {
|
||||||
|
/** @var \OCA\Theming\Util $util */
|
||||||
|
$util = \OC::$server->query(\OCA\Theming\Util::class);
|
||||||
|
$this->assign('themingInvertMenu', $util->invertTextColor(\OC::$server->getThemingDefaults()->getColorPrimary()));
|
||||||
|
} catch (\OCP\AppFramework\QueryException $e) {
|
||||||
|
$this->assign('themingInvertMenu', false);
|
||||||
|
}
|
||||||
|
|
||||||
} else if ($renderAs == 'error') {
|
} else if ($renderAs == 'error') {
|
||||||
parent::__construct('core', 'layout.guest', '', false);
|
parent::__construct('core', 'layout.guest', '', false);
|
||||||
$this->assign('bodyid', 'body-login');
|
$this->assign('bodyid', 'body-login');
|
||||||
|
|
|
@ -655,6 +655,11 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
var li = $('<li></li>');
|
var li = $('<li></li>');
|
||||||
li.attr('data-id', entry.id);
|
li.attr('data-id', entry.id);
|
||||||
var img = '<img src="' + entry.icon + '" class="app-icon">';
|
var img = '<img src="' + entry.icon + '" class="app-icon">';
|
||||||
|
if (OCA.Theming && OCA.Theming.inverted) {
|
||||||
|
img = '<svg width="20" height="20" viewBox="0 0 20 20">';
|
||||||
|
img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>';
|
||||||
|
img += '<image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + entry.icon + '" class="app-icon" /></svg>';
|
||||||
|
}
|
||||||
var a = $('<a></a>').attr('href', entry.href);
|
var a = $('<a></a>').attr('href', entry.href);
|
||||||
var filename = $('<span></span>');
|
var filename = $('<span></span>');
|
||||||
var loading = $('<div class="icon-loading-dark"></div>').css('display', 'none');
|
var loading = $('<div class="icon-loading-dark"></div>').css('display', 'none');
|
||||||
|
|
Loading…
Reference in New Issue