diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-08-20 11:05:01 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-08-20 11:05:01 +0000 |
| commit | 9e9915370bcc05798f8a991b69e02e9a9f846b53 (patch) | |
| tree | 74d27f8a3528687e52c9035b2afe597a10696ba6 /src | |
| parent | Add paint server dialog. Currently handles patterns and hatches. GSOC 2019. (diff) | |
| download | inkscape-9e9915370bcc05798f8a991b69e02e9a9f846b53.tar.gz inkscape-9e9915370bcc05798f8a991b69e02e9a9f846b53.zip | |
This fix a mainmenu bug on toggle checkboxes on all desktops instead current one
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/desktop/menubar.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/ui/desktop/menubar.cpp b/src/ui/desktop/menubar.cpp index 8bb6d54b4..df21ca718 100644 --- a/src/ui/desktop/menubar.cpp +++ b/src/ui/desktop/menubar.cpp @@ -41,7 +41,7 @@ // ================= Common ==================== -std::vector<std::pair<unsigned int, Gtk::CheckMenuItem *>> checkmenuitems; +std::vector<std::pair<std::pair<unsigned int, Gtk::CheckMenuItem *>, Inkscape::UI::View::View *>> checkmenuitems; unsigned int lastverb = -1; ; @@ -74,14 +74,16 @@ static void item_activate(Gtk::MenuItem *menuitem, SPAction *action) static void toggle_checkmenu(unsigned int emitting_verb, bool value) { for (auto menu : checkmenuitems) { - if (emitting_verb == menu.first) { - if (emitting_verb == lastverb) { + if (menu.second == SP_ACTIVE_DESKTOP) { + if (emitting_verb == menu.first.first) { + if (emitting_verb == lastverb) { + lastverb = -1; + return; + } + lastverb = emitting_verb; + menu.first.second->property_active() = value; lastverb = -1; - return; } - lastverb = emitting_verb; - menu.second->property_active() = value; - lastverb = -1; } } } @@ -450,7 +452,9 @@ build_menu(Gtk::MenuShell* menu, Inkscape::XML::Node* xml, Inkscape::UI::View::V Gtk::CheckMenuItem* menuitem = build_menu_check_item_from_verb(action); if (menuitem) { - checkmenuitems.emplace_back(verb->get_code(), menuitem); + std::pair<std::pair<unsigned int, Gtk::CheckMenuItem *>, Inkscape::UI::View::View *> + checkitem = std::make_pair(std::make_pair(verb->get_code(), menuitem), view); + checkmenuitems.push_back(checkitem); menu->append(*menuitem); } |
