Skip to content

Commit

Permalink
Set dark style to ignore OS color mode (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed Dec 30, 2023
1 parent 8899e69 commit 24e93c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod image_loader;
use anyhow::Result;
use auth::Authenticator;
use eframe::epaint::{Color32, Rect};
use egui::{self, ColorImage, RichText, Sense, ViewportBuilder};
use egui::{self, ColorImage, RichText, Sense, Style, ViewportBuilder, Visuals};
use image_loader::ImageLoader;
use std::{process, time::Duration};
use tokio::{
Expand Down Expand Up @@ -36,6 +36,11 @@ fn main() -> Result<(), eframe::Error> {
"OneDrive Slideshow",
options,
Box::new(move |cc| {
let style = Style {
visuals: Visuals::dark(),
..Style::default()
};
cc.egui_ctx.set_style(style);
egui_extras::install_image_loaders(&cc.egui_ctx);
let (sender, receiver) = channel(8);
task::spawn(image_load_loop(sender.clone(), cc.egui_ctx.clone()));
Expand Down Expand Up @@ -92,8 +97,7 @@ impl eframe::App for Slideshow {
_ => (),
}

let frame = egui::Frame::default().fill(Color32::BLACK);
let response = egui::CentralPanel::default().frame(frame).show(ctx, |ui|
let response = egui::CentralPanel::default().show(ctx, |ui|
ui.centered_and_justified(|ui|
match &self.current_state {
Ok(AppState::LoadingImage) => {
Expand Down

0 comments on commit 24e93c2

Please sign in to comment.