Make font awesome 5.7 used by default

This commit is contained in:
Laurent Destailleur 2019-03-12 10:34:19 +01:00
parent d762766a56
commit 73b6ad733f
8 changed files with 30 additions and 13 deletions

View File

@ -57,8 +57,7 @@ Image libraries:
Octicons 8.1 MIT Yes
Font libraries:
Fontawesome 4.7 ? Yes
Fontawesome 5.0 ? Yes
Fontawesome 5.7.2 Font Awesome Free licence Yes
For licenses compatibility informations:

View File

@ -1621,16 +1621,17 @@ a.tmenuimage:hover{
// Img file not found
if (! $found)
{
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print 'div.mainmenu.'.$val.'::before {
content: "\f249";
}';
}
else
{
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
$url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic,4))."_over.png", 1);
print "div.mainmenu.generic".$generic." {\n";
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}

View File

@ -1,3 +0,0 @@
there icons are licensed under the Creative Commons Attribution 4.0 International license https://fontawesome.com/license
Credit font Awesome

View File

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cash-register" class="svg-inline--fa fa-cash-register fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M511.1 378.8l-26.7-160c-2.6-15.4-15.9-26.7-31.6-26.7H208v-64h96c8.8 0 16-7.2 16-16V16c0-8.8-7.2-16-16-16H48c-8.8 0-16 7.2-16 16v96c0 8.8 7.2 16 16 16h96v64H59.1c-15.6 0-29 11.3-31.6 26.7L.8 378.7c-.6 3.5-.9 7-.9 10.5V480c0 17.7 14.3 32 32 32h448c17.7 0 32-14.3 32-32v-90.7c.1-3.5-.2-7-.8-10.5zM280 248c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16v-16zm-32 64h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16v-16c0-8.8 7.2-16 16-16zm-32-80c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16v-16c0-8.8 7.2-16 16-16h16zM80 80V48h192v32H80zm40 200h-16c-8.8 0-16-7.2-16-16v-16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16zm16 64v-16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16zm216 112c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h176c4.4 0 8 3.6 8 8v16zm24-112c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16v-16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16zm48-80c0 8.8-7.2 16-16 16h-16c-8.8 0-16-7.2-16-16v-16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1 +0,0 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="home" class="svg-inline--fa fa-home fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"></path></svg>

Before

Width:  |  Height:  |  Size: 713 B

View File

@ -59,8 +59,8 @@ div.mainmenu.cashdesk .tmenuimage {
height: <?php echo $topMenuFontSize; ?>;
background-color: #<?php echo $colortextbackhmenu; ?>;
width: 100%;
-webkit-mask: url(./img/fontawesome/cash-register-solid.svg) no-repeat 50% 50%; /* for old webkit browser */
mask: url(./img/fontawesome/cash-register-solid.svg) no-repeat 50% 50%;
-webkit-mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%; /* for old webkit browser */
mask: url(<?php echo DOL_URL_ROOT.'/theme/common/fontawesome-5/svgs/solid/cash-register.svg' ?>) no-repeat 50% 50%;
}
<?php } else { ?>

View File

@ -0,0 +1,17 @@
<?php if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
/* <style type="text/css" > */
.mainmenu::before{
/* font part */
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 26px;
font-size: <?php echo $topMenuFontSize; ?>;
-webkit-font-smoothing: antialiased;
text-align:center;
text-decoration:none;
color: #<?php echo $colortextbackhmenu; ?>;
}

View File

@ -1815,16 +1815,17 @@ foreach($mainmenuusedarray as $val)
// Img file not found
if (! $found)
{
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) {
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
print 'div.mainmenu.'.$val.'::before {
content: "\f249";
}';
}
else
{
print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
$url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.(min($generic,4))."_over.png", 1);
print "div.mainmenu.generic".$generic." {\n";
print "div.mainmenu.".$val." {\n";
print " background-image: url(".$url.");\n";
print "}\n";
}
@ -5730,6 +5731,10 @@ border-top-right-radius: 6px;
}
<?php if (! defined('DISABLE_FONT_AWSOME') && empty($conf->global->MAIN_DISABLE_FONT_AWESOME_5)) { ?>
<?php include dol_buildpath($path.'/theme/'.$theme.'/main_menu_fa_icons.inc.php', 0); ?>
<?php } ?>
<?php
if (is_object($db)) $db->close();