Skip to content

Commit

Permalink
implement light switch
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrdrifa committed Dec 1, 2023
1 parent 34c0452 commit 8244a99
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions gui/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ activate app = do
let w = window mw
w.present

toggleTheme :: Adw.Application -> [String] -> IO ()
toggleTheme _ [] = pure ()
toggleTheme app ["--light"] = do
sm <- Adw.getApplicationStyleManager app
Adw.setStyleManagerColorScheme sm Adw.ColorSchemeForceLight
toggleTheme _ _ = pure ()

main :: IO ()
main = do
args <- getArgs
progName <- getProgName
app <- Adw.new Adw.Application
[ #applicationId Adw.:= "eldr-io.audiocate.gui",
Adw.On #activate (activate ?self)
Adw.On #activate (activate ?self),
Adw.On #activate (toggleTheme ?self args)
]
-- sm <- Adw.getApplicationStyleManager app
-- Adw.setStyleManagerColorScheme sm Adw.ColorSchemeForceLight
putStrLn $ "Audiocate GUI v" ++ version
args <- getArgs
progName <- getProgName
void (app.run $ Just $ progName : args)
void (app.run $ Just $ progName : [])

0 comments on commit 8244a99

Please sign in to comment.