Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added theme-system and theme-contrast-dark #824

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/appconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,14 +923,17 @@ public function SetCustomizationTheme($value) {
* @return string
*/
public function GetCustomizationTheme() {
$value = $this->config->getAppValue($this->appName, $this->_customizationTheme, "theme-classic-light");
if ($value === "theme-light") {
return "theme-light";
$value = $this->config->getAppValue($this->appName, $this->_customizationTheme, "theme-system");
switch ($value) {
case "theme-system":
case "theme-light":
case "theme-classic-light":
case "theme-dark":
case "theme-contrast-dark":
return $value;
break;
}
if ($value === "theme-dark") {
return "theme-dark";
}
return "theme-classic-light";
return "theme-system";
}

/**
Expand Down
14 changes: 14 additions & 0 deletions templates/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@
<?php p($l->t("Default editor theme")) ?>
</p>
<div class="onlyoffice-tables">
<div>
<input type="radio" class="radio"
id="onlyofficeTheme_theme-system"
name="theme"
<?php if ($_["theme"] === "theme-system") { ?>checked="checked"<?php } ?> />
<label for="onlyofficeTheme_theme-system"><?php p($l->t("Same as system")) ?></label>
</div>
<div>
<input type="radio" class="radio"
id="onlyofficeTheme_theme-light"
Expand All @@ -260,6 +267,13 @@
<?php if ($_["theme"] === "theme-dark") { ?>checked="checked"<?php } ?> />
<label for="onlyofficeTheme_theme-dark"><?php p($l->t("Dark")) ?></label>
</div>
<div>
<input type="radio" class="radio"
id="onlyofficeTheme_theme-contrast-dark"
name="theme"
<?php if ($_["theme"] === "theme-contrast-dark") { ?>checked="checked"<?php } ?> />
<label for="onlyofficeTheme_theme-constrast-dark"><?php p($l->t("Contrast dark")) ?></label>
</div>
</div>

<br />
Expand Down