diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-10-01 22:39:06 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-10-01 22:39:06 +0000 |
| commit | 8674581f9f33a3b1b35e7b5f196a3e8313e284ad (patch) | |
| tree | 3548932ae38a563dcfef6e77a1c8f61358312331 /src/ui | |
| parent | Fixing shifts for sub-byte PNG packing order (diff) | |
| download | inkscape-8674581f9f33a3b1b35e7b5f196a3e8313e284ad.tar.gz inkscape-8674581f9f33a3b1b35e7b5f196a3e8313e284ad.zip | |
Fix a crash bug on new documents
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/dialog.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 6fef22545..2f60856dc 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -322,19 +322,21 @@ void sp_add_top_window_classes(Gtk::Widget *widg) if (!current_window) { current_window = dynamic_cast<Gtk::Window *>(widg->get_toplevel()); } - if (toplevel_window->get_style_context()->has_class("dark")) { - current_window->get_style_context()->add_class("dark"); - current_window->get_style_context()->remove_class("bright"); - } else { - current_window->get_style_context()->add_class("bright"); - current_window->get_style_context()->remove_class("dark"); - } - if (toplevel_window->get_style_context()->has_class("symbolic")) { - current_window->get_style_context()->add_class("symbolic"); - current_window->get_style_context()->remove_class("regular"); - } else { - current_window->get_style_context()->remove_class("symbolic"); - current_window->get_style_context()->add_class("regular"); + if (current_window) { + if (toplevel_window->get_style_context()->has_class("dark")) { + current_window->get_style_context()->add_class("dark"); + current_window->get_style_context()->remove_class("bright"); + } else { + current_window->get_style_context()->add_class("bright"); + current_window->get_style_context()->remove_class("dark"); + } + if (toplevel_window->get_style_context()->has_class("symbolic")) { + current_window->get_style_context()->add_class("symbolic"); + current_window->get_style_context()->remove_class("regular"); + } else { + current_window->get_style_context()->remove_class("symbolic"); + current_window->get_style_context()->add_class("regular"); + } } } } |
