lexgui 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1536,8 +1536,8 @@ class CodeEditor {
1536
1536
 
1537
1537
  panel.sameLine();
1538
1538
  panel.addLabel( this.code.title, { float: 'right', signal: "@tab-name" });
1539
- panel.addLabel( "Ln " + 1, { maxWidth: "48px", signal: "@cursor-line" });
1540
- panel.addLabel( "Col " + 1, { maxWidth: "48px", signal: "@cursor-pos" });
1539
+ panel.addLabel( "Ln " + 1, { xmaxWidth: "48px", signal: "@cursor-line" });
1540
+ panel.addLabel( "Col " + 1, { xmaxWidth: "48px", signal: "@cursor-pos" });
1541
1541
  panel.addButton( null, "Spaces: " + this.tabSpaces, ( value, event ) => {
1542
1542
  LX.addContextMenu( "Spaces", event, m => {
1543
1543
  const options = [ 2, 4, 8 ];
@@ -1548,7 +1548,7 @@ class CodeEditor {
1548
1548
  this._updateDataInfoPanel( "@tab-spaces", "Spaces: " + this.tabSpaces );
1549
1549
  } );
1550
1550
  });
1551
- }, { width: "10%", nameWidth: "15%", signal: "@tab-spaces" });
1551
+ }, { nameWidth: "15%", signal: "@tab-spaces" });
1552
1552
  panel.addButton( "<b>{ }</b>", this.highlight, ( value, event ) => {
1553
1553
  LX.addContextMenu( "Language", event, m => {
1554
1554
  for( const lang of Object.keys( this.languages ) )
@@ -1558,7 +1558,7 @@ class CodeEditor {
1558
1558
  } );
1559
1559
  }
1560
1560
  });
1561
- }, { width: "17.5%", nameWidth: "15%", signal: "@highlight" });
1561
+ }, { nameWidth: "15%", signal: "@highlight" });
1562
1562
  panel.endLine();
1563
1563
 
1564
1564
  return panel;
@@ -1965,7 +1965,7 @@ class GraphEditor {
1965
1965
  for( let node of nodesOutsideViewport )
1966
1966
  {
1967
1967
  let dom = this._getNodeDOMElement( node.id );
1968
- dom.classList.toggle( 'hiddenOpacity', true );
1968
+ dom.classList.toggle( 'hidden-opacity', true );
1969
1969
  }
1970
1970
  }
1971
1971
 
@@ -2397,10 +2397,10 @@ class GraphEditor {
2397
2397
  if( graph_bb.inside( node_bb, false ) )
2398
2398
  {
2399
2399
  // Show if node in viewport..
2400
- dom.classList.toggle( 'hiddenOpacity', false );
2400
+ dom.classList.toggle( 'hidden-opacity', false );
2401
2401
 
2402
2402
  // And hide content if scale is very small..
2403
- dom.childNodes[ 1 ].classList.toggle( 'hiddenOpacity', this.currentGraph.scale < 0.5 );
2403
+ dom.childNodes[ 1 ].classList.toggle( 'hidden-opacity', this.currentGraph.scale < 0.5 );
2404
2404
 
2405
2405
  continue;
2406
2406
  }
@@ -169,7 +169,6 @@ class Timeline {
169
169
  }
170
170
 
171
171
  let header = this.header;
172
- LX.DEFAULT_NAME_WIDTH = "50%";
173
172
  header.sameLine();
174
173
 
175
174
  if( this.name )
@@ -177,32 +176,54 @@ class Timeline {
177
176
  header.addTitle(this.name );
178
177
  }
179
178
 
180
- header.addButton('', '<i class="fa-solid fa-'+ (this.playing ? 'pause' : 'play') +'"></i>', (value, event) => {
179
+ const buttonContainer = LX.makeContainer(["auto", "100%"], "", { display: "flex" });
180
+
181
+ header.queue( buttonContainer );
182
+
183
+ header.addButton("playBtn", '<i class="fa-solid fa-'+ (this.playing ? 'pause' : 'play') +'"></i>', (value, event) => {
181
184
  this.changeState();
182
- }, { width: "40px", buttonClass: "accept", title: "Play" });
185
+ }, { buttonClass: "accept", title: "Play", hideName: true });
183
186
 
184
- header.addButton('', '<i class="fa-solid fa-rotate"></i>', ( value, event ) => {
187
+ header.addButton("toggleLoopBtn", '<i class="fa-solid fa-rotate"></i>', ( value, event ) => {
185
188
  this.loop = !this.loop;
186
189
  if( this.onChangePlayMode )
187
190
  {
188
191
  this.onChangePlayMode( this.loop );
189
192
  }
190
- }, { width: "40px", selectable: true, selected: this.loop, title: 'Loop' });
193
+ }, { selectable: true, selected: this.loop, title: 'Loop', hideName: true });
191
194
 
192
195
  if( this.onBeforeCreateTopBar )
193
196
  {
194
197
  this.onBeforeCreateTopBar( header );
195
198
  }
196
199
 
200
+ header.clearQueue( buttonContainer );
201
+
202
+ header.addContent( "header-buttons", buttonContainer );
203
+
197
204
  header.addNumber("Current Time", this.currentTime, (value, event) => {
198
- this.setTime(value)}, {signal: "@on_set_time_" + this.name, step: 0.01, min: 0, precision: 3, skipSlider: true});
205
+ this.setTime(value)
206
+ }, {
207
+ units: "s",
208
+ signal: "@on_set_time_" + this.name,
209
+ step: 0.01, min: 0, precision: 3,
210
+ skipSlider: true
211
+ });
199
212
 
200
213
  header.addNumber("Duration", + this.duration.toFixed(3), (value, event) => {
201
- this.setDuration(value, false)}, {step: 0.01, min: 0, signal: "@on_set_duration_" + this.name
214
+ this.setDuration(value, false)
215
+ }, {
216
+ units: "s",
217
+ step: 0.01, min: 0,
218
+ signal: "@on_set_duration_" + this.name
202
219
  });
203
220
 
204
221
  header.addNumber("Speed", + this.speed.toFixed(3), (value, event) => {
205
- this.setSpeed(value)}, {step: 0.01, signal: "@on_set_speed_" + this.name});
222
+ this.setSpeed(value)
223
+ }, {
224
+ step: 0.01,
225
+ signal: "@on_set_speed_" + this.name
226
+ });
206
227
 
207
228
  if( this.onAfterCreateTopBar )
208
229
  {
@@ -211,12 +232,12 @@ class Timeline {
211
232
 
212
233
  if( this.onShowOptimizeMenu )
213
234
  {
214
- header.addButton("", '<i class="fa-solid fa-filter"></i>', (value, event) => {this.onShowOptimizeMenu(event)}, { width: "40px", title: "Optimize" });
235
+ header.addButton(null, '<i class="fa-solid fa-filter"></i>', (value, event) => {this.onShowOptimizeMenu(event)}, { title: "Optimize" });
215
236
  }
216
237
 
217
238
  if( this.onShowConfiguration )
218
239
  {
219
- header.addButton("", '<i class="fa-solid fa-gear"></i>', (value, event) => {
240
+ header.addButton(null, '<i class="fa-solid fa-gear"></i>', (value, event) => {
220
241
  if(this.configurationDialog){
221
242
  this.configurationDialog.close();
222
243
  this.configurationDialog = null;
@@ -231,11 +252,10 @@ class Timeline {
231
252
  root.remove();
232
253
  }
233
254
  })
234
- }, { width: "40px" })
255
+ }, { title: "Settings" })
235
256
  }
236
257
 
237
- header.endLine();
238
- LX.DEFAULT_NAME_WIDTH = "30%";
258
+ header.endLine( "space-around" );
239
259
  }
240
260
 
241
261
  /**
@@ -263,9 +283,9 @@ class Timeline {
263
283
 
264
284
  if( !this.disableNewTracks )
265
285
  {
266
- panel.addButton('', '<i class = "fa-solid fa-plus"></i>', (value, event) => {
286
+ panel.addButton("addTrackBtn", '<i class = "fa-solid fa-plus"></i>', (value, event) => {
267
287
  this.addNewTrack();
268
- }, {width: "40px", height: "40px"});
288
+ }, { hideName: true, title: "Add Track" });
269
289
  }
270
290
 
271
291
  panel.endLine();
@@ -2758,9 +2778,9 @@ class ClipsTimeline extends Timeline {
2758
2778
  let title = titleWidget.root;
2759
2779
  if(!this.disableNewTracks)
2760
2780
  {
2761
- panel.addButton('', '<i class = "fa-solid fa-plus"></i>', (value, event) => {
2781
+ panel.addButton("addTrackBtn", '<i class = "fa-solid fa-plus"></i>', (value, event) => {
2762
2782
  this.addNewTrack();
2763
- }, {width: "40px", height: "40px"});
2783
+ }, { hideName: true, title: "Add Track" });
2764
2784
  }
2765
2785
  panel.endLine();
2766
2786
  const styles = window.getComputedStyle(title);