aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-02-16 23:17:26 +0100
committerdec05eba <dec05eba@protonmail.com>2020-08-19 00:14:44 +0200
commit9c37b2dca4edaf8e9d487c6a18ab53b178161f37 (patch)
tree998514073ef5747745ea0f7c42ae4d3b16095ecc /src/main.cpp
parent4a23517b6beddad8f4e2c5264d309fec590847e7 (diff)
asdf
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 14 insertions, 9 deletions
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<Gtk::CssProvider> 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<Gio::File> &file, const Glib::RefPtr<Gio::File> &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<Gio::File> &file, const Glib::RefPtr<Gio::File> &otherFile, Gio::FileMonitorEvent event)
+ {
+ fprintf(stderr, "Css file modified, reloading\n");
+ setWindowCss(window, css);
+ });
#endif
+ }
return app->run(window);
}