Skip to content

Commit

Permalink
Merge pull request #372 from jobsofferings/feature_control_togglethem…
Browse files Browse the repository at this point in the history
…e_0123

Dark mode overall linkage
  • Loading branch information
User782Tec authored Jan 23, 2024
2 parents 32908aa + cdbdff3 commit 9bb6212
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@
<div class="tit">飞行模式</div>
</div>
<div class="btn4">
<div class="icon" onclick="controlStatus.call(this)">
<div class="icon" onclick="controlStatus.call(this, 'dark')">
<icon class="s-icon"></icon>
</div>
<div class="tit">夜间模式</div>
Expand Down
6 changes: 6 additions & 0 deletions desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3448,6 +3448,9 @@ function controlStatus(name) {
wifiStatus = true;
}
}
if (name == 'dark') {
toggletheme()
}
}
// 控制面板 亮度调整
function dragBrightness(e) {
Expand Down Expand Up @@ -3555,15 +3558,18 @@ let isDark = false;
// 主题
function toggletheme() {
$('.dock.theme').toggleClass('dk');
var darkControl = $(`#control .btn4 .icon`)
$(':root').toggleClass('dark');
if ($(':root').hasClass('dark')) {
$('.window.whiteboard>.titbar>p').text('Blackboard');
setData('theme', 'dark');
isDark = true;
darkControl.addClass('active')
} else {
$('.window.whiteboard>.titbar>p').text('Whiteboard');
setData('theme', 'light');
isDark = false;
darkControl.removeClass('active')
}
}

Expand Down

0 comments on commit 9bb6212

Please sign in to comment.