Bug 1608610 - Inline calendar 'view' and 'go' appmenu items. r=Fallen
authorPaul Morris <paul@thunderbird.net>
Tue, 14 Jan 2020 17:26:47 -0500
changeset 37247 5964bccb8f7b52c2f5eda20138d0fed36e025779
parent 37246 e012cf345b6dcd16b9d828c9850e2a35ed14b6de
child 37248 106676f18f206f9c8fb36885b7a7317c40dfd141
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1608610
Bug 1608610 - Inline calendar 'view' and 'go' appmenu items. r=Fallen
calendar/lightning/content/messenger-overlay-sidebar.xhtml
mail/components/customizableui/content/panelUI.inc.xhtml
--- a/calendar/lightning/content/messenger-overlay-sidebar.xhtml
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xhtml
@@ -5,82 +5,16 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <overlay id="ltnSidebarOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:html="http://www.w3.org/1999/xhtml">
 
   <!-- App Menu Integration -->
-  <!-- Calendar menu items added to appmenu menus -->
-
-  <!-- View -->
-  <vbox id="appMenu-viewViewItems">
-    <toolbarseparator id="appmenu_ltnViewMenuSeparator"/>
-    <toolbarbutton id="appmenu_ltnTodayPaneMenu"
-                   class="subviewbutton subviewbutton-nav"
-                   label="&calendar.context.button.label;"
-                   closemenu="none"
-                   oncommand="PanelUI.showSubView('appmenu_ltnTodayPaneView', this)"/>
-    <toolbarbutton id="appmenu_ltnCalendarMenu"
-                   class="subviewbutton subviewbutton-nav"
-                   observes="calendar_in_foreground"
-                   insertbefore="viewSortMenuSeparator"
-                   label="&lightning.menu.view.calendar.label;"
-                   closemenu="none"
-                   oncommand="PanelUI.showSubView('appmenu_ltnCalendarMenuView', this)"/>
-    <toolbarbutton id="appmenu_ltnTasksMenu"
-                   class="subviewbutton subviewbutton-nav"
-                   observes="calendar_mode_task"
-                   insertbefore="viewSortMenuSeparator"
-                   label="&lightning.menu.view.tasks.label;"
-                   closemenu="none"
-                   oncommand="PanelUI.showSubView('appmenu_ltnTasksView', this)"/>
-  </vbox>
-
-  <!-- Go -->
-  <vbox id="appMenu-goViewItems">
-    <toolbarbutton id="appmenu_ltnGoToToday"
-                   class="subviewbutton subviewbutton-iconic"
-                   insertafter="appmenu_goNextSeparator"
-                   label="&goTodayCmd.label;"
-                   command="calendar_go_to_today_command"/>
-  </vbox>
-
-  <!-- Go / Next -->
-  <vbox id="appMenu-goNextViewItems">
-    <toolbarseparator id="appmenu_ltnGoNextSeparator"/>
-    <!-- Label is set up automatically using the view id. When writing a
-         view extension, overlay this toolbarbutton and add a label-<myviewtype>
-         attribute with the correct label -->
-    <toolbarbutton id="appmenu_calendar-go-menu-next"
-                   class="subviewbutton subviewbutton-iconic"
-                   label=""
-                   label-day="&lightning.toolbar.day.label;"
-                   label-week="&lightning.toolbar.week.label;"
-                   label-multiweek="&lightning.toolbar.week.label;"
-                   label-month="&lightning.toolbar.month.label;"
-                   command="calendar_view_next_command"/>
-  </vbox>
-
-  <!-- Go / Previous -->
-  <vbox id="appMenu-goPreviousViewItems">
-    <toolbarseparator id="appmenu_ltnGoPreviousSeparator"/>
-    <!-- Label is set up automatically using the view id. When writing a
-         view extension, overlay this menuitem and add a label-<myviewtype>
-         attribute with the correct label -->
-    <toolbarbutton id="appmenu_calendar-go-menu-previous"
-                   class="subviewbutton subviewbutton-iconic"
-                   label=""
-                   label-day="&lightning.toolbar.day.label;"
-                   label-week="&lightning.toolbar.week.label;"
-                   label-multiweek="&lightning.toolbar.week.label;"
-                   label-month="&lightning.toolbar.month.label;"
-                   command="calendar_view_prev_command"/>
-  </vbox>
 
   <!-- Calendar submenus added to the appmenu -->
   <panelmultiview id="appMenu-multiView">
 
     <!-- Events and Tasks -->
     <panelview id="appmenu_Event_Task_View"
                class="PanelUI-subView">
       <vbox class="panel-subview-body">
@@ -183,17 +117,17 @@
         <toolbarbutton id="appmenu_ltnTaskActionsPostponeMenu-1week"
                        class="subviewbutton subviewbutton-iconic"
                        label="&calendar.context.postpone.1week.label;"
                        command="calendar_postpone-1week_command"/>
       </vbox>
     </panelview>
 
     <!-- View / Today Pane -->
-    <panelview id="appmenu_ltnTodayPaneView"
+    <panelview id="appmenu_calendar-today-pane-view"
                class="PanelUI-subView">
       <vbox class="panel-subview-body">
         <toolbarbutton id="appmenu_ltnShowTodayPane-2"
                        class="subviewbutton subviewbutton-iconic"
                        label="&todaypane.showTodayPane.label;"
                        type="checkbox"
                        command="calendar_toggle_todaypane_command"/>
         <toolbarseparator id="appmenu_ltnSeparatorBeforeDisplayMiniday"/>
@@ -220,17 +154,17 @@
                        type="radio"
                        oncommand="TodayPane.displayMiniSection('none')"
                        observes="ltnTodayPaneDisplayNone"
                        label="&todaypane.showNone.label;"/>
       </vbox>
     </panelview>
 
     <!-- View / Calendar -->
-    <panelview id="appmenu_ltnCalendarMenuView"
+    <panelview id="appmenu_calendar-calendar-view"
                class="PanelUI-subView">
       <vbox class="panel-subview-body">
         <toolbarbutton id="appmenu_ltnChangeViewDay"
                        class="subviewbutton subviewbutton-iconic"
                        label="&lightning.toolbar.day.label;"
                        type="radio"
                        name="calendarMenuViews"
                        command="calendar_day-view_command"/>
@@ -314,17 +248,17 @@
                        class="subviewbutton subviewbutton-iconic"
                        type="checkbox"
                        label="&calendar.orientation.label;"
                        command="calendar_toggle_orientation_command"/>
       </vbox>
     </panelview>
 
     <!-- View / Tasks -->
-    <panelview id="appmenu_ltnTasksView"
+    <panelview id="appmenu_calendar-tasks-view"
                class="PanelUI-subView">
       <vbox class="panel-subview-body">
         <toolbarbutton id="appmenu_ltnTasksViewFilterTasks"
                        class="subviewbutton subviewbutton-iconic"
                        type="checkbox"
                        label="&calendar.tasks.view.filtertasks.label;"
                        command="calendar_toggle_filter_command"/>
         <toolbarseparator id="appmenu_ltnTasksViewSeparator"/>
--- a/mail/components/customizableui/content/panelUI.inc.xhtml
+++ b/mail/components/customizableui/content/panelUI.inc.xhtml
@@ -656,16 +656,35 @@
                class="PanelUI-subView">
       <vbox id="appMenu-viewViewItems"
             class="panel-subview-body">
         <toolbarbutton id="appmenu_FolderViews"
                        class="subviewbutton subviewbutton-nav"
                        label="&folderView.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-foldersView', this)"/>
+        <toolbarseparator id="appmenu_calendar-view-menu-separator"/>
+        <toolbarbutton id="appmenu_calendar-today-pane-menu"
+                      class="subviewbutton subviewbutton-nav"
+                      label="&calendar.context.button.label;"
+                      closemenu="none"
+                      oncommand="PanelUI.showSubView('appmenu_calendar-today-pane-view', this)"/>
+        <toolbarbutton id="appmenu_calendar-calendar-menu"
+                      class="subviewbutton subviewbutton-nav"
+                      observes="calendar_in_foreground"
+                      label="&lightning.menu.view.calendar.label;"
+                      closemenu="none"
+                      oncommand="PanelUI.showSubView('appmenu_calendar-calendar-view', this)"/>
+        <toolbarbutton id="appmenu_calendar-tasks-menu"
+                      class="subviewbutton subviewbutton-nav"
+                      observes="calendar_mode_task"
+                      label="&lightning.menu.view.tasks.label;"
+                      closemenu="none"
+                      oncommand="PanelUI.showSubView('appmenu_calendar-tasks-view', this)"/>
+        <toolbarseparator id="appmenu_viewSortMenuSeparator"/>
         <toolbarbutton id="appmenu_viewSortMenu"
                        class="subviewbutton subviewbutton-nav"
                        label="&sortMenu.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-viewSortByView', this)"/>
         <toolbarbutton id="appmenu_viewMessageViewMenu"
                        class="subviewbutton subviewbutton-nav"
                        label="&msgsMenu.label;"
@@ -1204,16 +1223,20 @@
                        key="key_goForward"
                        command="cmd_goForward"/>
         <toolbarbutton id="appmenu_goBack"
                        class="subviewbutton subviewbutton-iconic"
                        label="&goBackCmd.label;"
                        key="key_goBack"
                        command="cmd_goBack"/>
         <toolbarseparator id="appmenu_goNextSeparator"/>
+        <toolbarbutton id="appmenu_calendar-go-to-today"
+                       class="subviewbutton subviewbutton-iconic"
+                       label="&goTodayCmd.label;"
+                       command="calendar_go_to_today_command"/>
         <toolbarbutton id="appmenu_goChat"
                        class="subviewbutton subviewbutton-iconic"
                        label="&goChatCmd.label;"
                        key="key_goChat"
                        command="cmd_chat"/>
         <toolbarseparator id="appmenu_goChatSeparator"/>
         <toolbarbutton id="appmenu_goFolderMenu"
                        class="subviewbutton subviewbutton-nav"
@@ -1257,16 +1280,28 @@
                        label="&nextStarredMsgCmd.label;"
                        command="cmd_nextFlaggedMsg"/>
         <toolbarseparator id="appmenu_goNextAfterFlaggedSeparator"/>
         <toolbarbutton id="appmenu_nextUnreadThread"
                        class="subviewbutton subviewbutton-iconic"
                        label="&nextUnreadThread.label;"
                        key="key_nextUnreadThread"
                        command="cmd_nextUnreadThread"/>
+        <toolbarseparator id="appmenu_GoNextAfterUnreadThreadSeparator"/>
+        <!-- Label is set up automatically using the view id. When writing a
+             view extension, add a `label-<myviewtype>` attribute with the
+             correct label. -->
+        <toolbarbutton id="appmenu_calendar-go-menu-next"
+                       class="subviewbutton subviewbutton-iconic"
+                       label=""
+                       label-day="&lightning.toolbar.day.label;"
+                       label-week="&lightning.toolbar.week.label;"
+                       label-multiweek="&lightning.toolbar.week.label;"
+                       label-month="&lightning.toolbar.month.label;"
+                       command="calendar_view_next_command"/>
       </vbox>
     </panelview>
 
     <!-- Go / Previous -->
     <panelview id="appMenu-goPreviousView"
                title="&prevMenu.label;"
                class="PanelUI-subView">
       <vbox id="appMenu-goPreviousViewItems"
@@ -1280,16 +1315,28 @@
                        class="subviewbutton subviewbutton-iconic"
                        label="&prevUnreadMsgCmd.label;"
                        key="key_previousUnreadMsg"
                        command="cmd_previousUnreadMsg"/>
         <toolbarbutton id="appmenu_prevFlaggedMsg"
                        class="subviewbutton subviewbutton-iconic"
                        label="&prevStarredMsgCmd.label;"
                        command="cmd_previousFlaggedMsg"/>
+        <toolbarseparator id="appmenu_goPreviousAfterFlaggedSeparator"/>
+        <!-- Label is set up automatically using the view id. When writing a
+             view extension, add a `label-<myviewtype>` attribute with the
+             correct label. -->
+        <toolbarbutton id="appmenu_calendar-go-menu-previous"
+                       class="subviewbutton subviewbutton-iconic"
+                       label=""
+                       label-day="&lightning.toolbar.day.label;"
+                       label-week="&lightning.toolbar.week.label;"
+                       label-multiweek="&lightning.toolbar.week.label;"
+                       label-month="&lightning.toolbar.month.label;"
+                       command="calendar_view_prev_command"/>
       </vbox>
     </panelview>
 
     <!-- Go / Folder -->
     <!-- toolbarbuttons are dynamically added by folder-panelview custom element. -->
     <panelview is="folder-panelview" id="appMenu-goFolderView"
                title="&folderMenu.label;"
                class="PanelUI-subView"