mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 04:29:31 +00:00
🐛 Enable switch to system theme on options menu (#6946)
This commit is contained in:
parent
c49e9fbf18
commit
f76391ecbb
@ -53,6 +53,7 @@
|
|||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Fix unexpected exception on processing old texts [Github #6889](https://github.com/penpot/penpot/pull/6889)
|
- Fix unexpected exception on processing old texts [Github #6889](https://github.com/penpot/penpot/pull/6889)
|
||||||
|
- Fix UI theme selection from main menu [Taiga #11567](https://tree.taiga.io/project/penpot/issue/11567)
|
||||||
|
|
||||||
## 2.8.0
|
## 2.8.0
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
[app.plugins.register :as plugins.register]
|
[app.plugins.register :as plugins.register]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.storage :as storage]
|
[app.util.storage :as storage]
|
||||||
[app.util.theme :as theme]
|
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.v2.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
@ -159,9 +158,6 @@
|
|||||||
(update-in state [:profile :theme]
|
(update-in state [:profile :theme]
|
||||||
(fn [current]
|
(fn [current]
|
||||||
(let [current (cond
|
(let [current (cond
|
||||||
(= current "system")
|
|
||||||
(theme/get-system-theme)
|
|
||||||
|
|
||||||
;; NOTE: this is a workaround for
|
;; NOTE: this is a workaround for
|
||||||
;; the old data on the database
|
;; the old data on the database
|
||||||
;; where whe have `default` value
|
;; where whe have `default` value
|
||||||
@ -172,7 +168,8 @@
|
|||||||
current)]
|
current)]
|
||||||
(case current
|
(case current
|
||||||
"dark" "light"
|
"dark" "light"
|
||||||
"light" "dark"
|
"light" "system"
|
||||||
|
"system" "dark"
|
||||||
; Failsafe for missing data
|
; Failsafe for missing data
|
||||||
"dark")))))
|
"dark")))))
|
||||||
|
|
||||||
|
|||||||
@ -280,8 +280,8 @@
|
|||||||
:data-testid "toggle-theme"
|
:data-testid "toggle-theme"
|
||||||
:id "file-menu-toggle-theme"}
|
:id "file-menu-toggle-theme"}
|
||||||
[:span {:class (stl/css :item-name)}
|
[:span {:class (stl/css :item-name)}
|
||||||
(case (:theme profile) ;; default = dark -> light -> system -> dark and so on
|
(case (:theme profile) ;; dark -> light -> system -> dark and so on
|
||||||
"default" (tr "workspace.header.menu.toggle-light-theme")
|
"dark" (tr "workspace.header.menu.toggle-light-theme")
|
||||||
"light" (tr "workspace.header.menu.toggle-system-theme")
|
"light" (tr "workspace.header.menu.toggle-system-theme")
|
||||||
"system" (tr "workspace.header.menu.toggle-dark-theme")
|
"system" (tr "workspace.header.menu.toggle-dark-theme")
|
||||||
(tr "workspace.header.menu.toggle-light-theme"))]
|
(tr "workspace.header.menu.toggle-light-theme"))]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user