From 9c37b2dca4edaf8e9d487c6a18ab53b178161f37 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 16 Feb 2019 23:17:26 +0100 Subject: asdf --- src/main.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b985d53..861796c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,21 +36,26 @@ static int setWindowCss(dchat::Window &window, Glib::RefPtr cs int main (int argc, char *argv[]) { + char *nativeStyle = std::getenv("NATIVE_STYLE"); + bool useNativeStyle = nativeStyle && strcmp(nativeStyle, "1") == 0; auto app = Gtk::Application::create(argc, argv, "dec05eba.dchat", Gio::APPLICATION_NON_UNIQUE); auto css = Gtk::CssProvider::create(); dchat::Window window; - if(setWindowCss(window, css) != 0) - return 1; + if(!useNativeStyle) + { + if(setWindowCss(window, css) != 0) + return 1; #ifndef NDEBUG - auto cssFile = Gio::File::create_for_path("css/style.css"); - auto cssFileMonitor = cssFile->monitor_file(); - cssFileMonitor->signal_changed().connect([&window, css](const Glib::RefPtr &file, const Glib::RefPtr &otherFile, Gio::FileMonitorEvent event) - { - fprintf(stderr, "Css file modified, reloading\n"); - setWindowCss(window, css); - }); + auto cssFile = Gio::File::create_for_path("css/style.css"); + auto cssFileMonitor = cssFile->monitor_file(); + cssFileMonitor->signal_changed().connect([&window, css](const Glib::RefPtr &file, const Glib::RefPtr &otherFile, Gio::FileMonitorEvent event) + { + fprintf(stderr, "Css file modified, reloading\n"); + setWindowCss(window, css); + }); #endif + } return app->run(window); } -- cgit v1.2.3