[gnote] New grouping for note actions menu



commit 8cb23e30a6c7700c3b200072997a43c48605b187
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Aug 20 20:15:59 2017 +0300

    New grouping for note actions menu

 src/notewindow.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 7b71135..bf9bd86 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -314,14 +314,19 @@ namespace gnote {
     }
 
     std::vector<Gtk::Widget*> widgets;
+    int last_order = 0;
     for(std::map<int, Gtk::Widget*>::iterator iter = widget_map.begin();
         iter != widget_map.end(); ++iter) {
+      // put separator between groups
+      if(iter->first < 10000 && (iter->first / 1000) > last_order && widgets.size() > 0 && widgets.back() != 
NULL) {
+        widgets.push_back(NULL);
+      }
+      last_order = iter->first / 1000;
       widgets.push_back(iter->second);
     }
 
-    widgets.push_back(utils::create_popover_button("win.important-note", _("Is Important")));
-    widgets.push_back(NULL);
-    widgets.push_back(utils::create_popover_button("win.delete-note", _("_Delete")));
+    widgets.push_back(utils::create_popover_button("win.important-note", _("_Important")));
+    widgets.push_back(utils::create_popover_button("win.delete-note", _("_Delete…")));
 
     return widgets;
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]