🐛 Enable switch to system theme on options menu (#6946)

This commit is contained in:
Elena Torró 2025-07-24 08:43:03 +02:00 committed by GitHub
parent c49e9fbf18
commit f76391ecbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 7 deletions

View File

@ -53,6 +53,7 @@
### :bug: Bugs fixed
- 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

View File

@ -20,7 +20,6 @@
[app.plugins.register :as plugins.register]
[app.util.i18n :as i18n :refer [tr]]
[app.util.storage :as storage]
[app.util.theme :as theme]
[beicon.v2.core :as rx]
[potok.v2.core :as ptk]))
@ -159,9 +158,6 @@
(update-in state [:profile :theme]
(fn [current]
(let [current (cond
(= current "system")
(theme/get-system-theme)
;; NOTE: this is a workaround for
;; the old data on the database
;; where whe have `default` value
@ -172,7 +168,8 @@
current)]
(case current
"dark" "light"
"light" "dark"
"light" "system"
"system" "dark"
; Failsafe for missing data
"dark")))))

View File

@ -280,8 +280,8 @@
:data-testid "toggle-theme"
:id "file-menu-toggle-theme"}
[:span {:class (stl/css :item-name)}
(case (:theme profile) ;; default = dark -> light -> system -> dark and so on
"default" (tr "workspace.header.menu.toggle-light-theme")
(case (:theme profile) ;; dark -> light -> system -> dark and so on
"dark" (tr "workspace.header.menu.toggle-light-theme")
"light" (tr "workspace.header.menu.toggle-system-theme")
"system" (tr "workspace.header.menu.toggle-dark-theme")
(tr "workspace.header.menu.toggle-light-theme"))]