add icon color filter range

This commit is contained in:
Simon Vieille 2020-08-13 21:22:10 +02:00
parent 831d2d81fc
commit 9eec0ce3ef
Signed by: deblan
GPG key ID: 03383D15A1D31745
5 changed files with 28 additions and 16 deletions

View file

@ -24,6 +24,9 @@
vertical-align: middle;
}
#side-menu-section input[type="range"] {
vertical-align: middle;
}
#side-menu-section select {
margin: 10px 0 10px 0;

View file

@ -63,6 +63,7 @@
width: 20px;
vertical-align: top;
margin-right: 10px;
filter: invert(var(--side-menu-icon-invert-filter, 0%));
}
.side-menu-app-icon svg {

View file

@ -74,6 +74,7 @@ class CssController extends Controller
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
'icon-invert-filter' => abs((int) $this->config->getAppValue('side_menu', 'icon-invert-filter', '0')).'%',
],
'display-logo' => (bool) $this->config->getAppValue('side_menu', 'display-logo', 1),
'opener-only' => (bool) $this->config->getAppValue('side_menu', 'opener-only', 0),

View file

@ -18,12 +18,12 @@
namespace OCA\SideMenu\Settings;
use OCA\SideMenu\Service\AppRepository;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
use OCP\ILogger;
use OCP\Settings\ISettings;
use OCP\IConfig;
use OCA\SideMenu\Service\AppRepository;
class Admin implements ISettings
{
@ -68,9 +68,9 @@ class Admin implements ISettings
'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
'icon-invert-filter' => (int) $this->config->getAppValue('side_menu', 'icon-invert-filter', '0'),
'loader-enabled' => $this->config->getAppValue('side_menu', 'loader-enabled', '1'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'force-light-icon' => $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
'big-menu' => $this->config->getAppValue('side_menu', 'big-menu', '0'),
@ -98,8 +98,8 @@ class Admin implements ISettings
/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/

View file

@ -88,21 +88,28 @@ $choicesSizes = [
</div>
<div>
<label for="side-menu-opener-only">
<?php p($l->t('Force light icons')); ?>
<label for="side-menu-icon-invert-filter">
<?php p($l->t('Icon color')); ?>
</label>
</div>
<p><em>This feature is not compatible with the <code>big menu</code> display.</em></p>
<div>
<select id="side-menu-force-light-icon" name="force-light-icon" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['force-light-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
<em>
<?php p($l->t('Same color')); ?>
</em>
<input
type="range"
min="0" max="100"
id="side-menu-icon-invert-filter"
name="icon-invert-filter"
class="side-menu-setting"
value="<?php echo $_['icon-invert-filter'] ?>"
>
<em>
<?php p($l->t('Opposite color')); ?>
</em>
</div>
<div>