Skip to content

Commit

Permalink
Add useDiscordColorScheme preference
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Dec 27, 2023
1 parent 5838436 commit a31ea96
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/window/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,23 @@ import (
"github.com/diamondburned/gotk4-adwaita/pkg/adw"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
"github.com/diamondburned/gotkit/app"
"github.com/diamondburned/gotkit/app/prefs"
"github.com/diamondburned/gotkit/gtkutil/cssutil"
"github.com/diamondburned/gtkcord4/internal/window/login"
)

var useDiscordColorScheme = prefs.NewBool(true, prefs.PropMeta{
Name: "Use Discord's color preference",
Section: "Discord",
Description: "Whether or not to use Discord's dark/light mode preference.",
})

// SetPreferDarkTheme sets whether or not GTK should use a dark theme.
func SetPreferDarkTheme(prefer bool) {
if !useDiscordColorScheme.Value() {
return
}

scheme := adw.ColorSchemePreferLight
if prefer {
scheme = adw.ColorSchemePreferDark
Expand Down

0 comments on commit a31ea96

Please sign in to comment.