@@ -6,7 +6,7 @@ export var ZenCustomizableUI = new (class {
6
6
constructor ( ) { }
7
7
8
8
TYPE_TOOLBAR = 'toolbar' ;
9
- defaultSidebarIcons = [ 'preferences -button' , 'zen-workspaces-button' , 'downloads -button' ] ;
9
+ defaultSidebarIcons = [ 'downloads -button' , 'zen-workspaces-button' , 'zen-create-new -button' ] ;
10
10
11
11
startup ( CustomizableUIInternal ) {
12
12
CustomizableUIInternal . registerArea (
@@ -100,9 +100,34 @@ export var ZenCustomizableUI = new (class {
100
100
elem . setAttribute ( 'removable' , 'true' ) ;
101
101
}
102
102
103
+ this . _initCreateNewButton ( window ) ;
103
104
this . _moveWindowButtons ( window ) ;
104
105
}
105
106
107
+ _initCreateNewButton ( window ) {
108
+ const button = window . document . getElementById ( 'zen-create-new-button' ) ;
109
+ button . addEventListener ( 'command' , ( ) => {
110
+ const image = button . querySelector ( 'image' ) ;
111
+ const popup = window . document . getElementById ( 'zenCreateNewPopup' ) ;
112
+ button . setAttribute ( 'open' , 'true' ) ;
113
+ const handlePopupHidden = ( ) => {
114
+ button . removeAttribute ( 'open' ) ;
115
+ window . gZenUIManager . motion . animate (
116
+ image ,
117
+ { transform : [ 'rotate(45deg)' , 'rotate(0deg)' ] } ,
118
+ { duration : 0.2 }
119
+ ) ;
120
+ } ;
121
+ popup . addEventListener ( 'popuphidden' , handlePopupHidden , { once : true } ) ;
122
+ popup . openPopup ( button , 'after_start' ) ;
123
+ window . gZenUIManager . motion . animate (
124
+ image ,
125
+ { transform : [ 'rotate(0deg)' , 'rotate(45deg)' ] } ,
126
+ { duration : 0.2 }
127
+ ) ;
128
+ } ) ;
129
+ }
130
+
106
131
_moveWindowButtons ( window ) {
107
132
const windowControls = window . document . getElementsByClassName ( 'titlebar-buttonbox-container' ) ;
108
133
const toolboxIcons = window . document . getElementById (
0 commit comments