@@ -388,7 +388,7 @@ def do_command_line(self, command_line):
388
388
def do_startup (self ):
389
389
Gtk .Application .do_startup (self )
390
390
self .lg_proxy = LookingGlassProxy ()
391
- # The status label is shown iff we are not okay
391
+ # The status label is shown if we are not okay
392
392
self .lg_proxy .connect ("status-changed" , self .update_status_from_proxy )
393
393
394
394
if self .window is None :
@@ -430,18 +430,14 @@ def inspect(self):
430
430
431
431
def construct_window (self ):
432
432
self .window = Gtk .Window (type = Gtk .WindowType .TOPLEVEL )
433
- self .window .set_title ("Melange" )
433
+ headerbar = Gtk .HeaderBar ()
434
+ headerbar .set_title ("Looking Glass" )
435
+ headerbar .set_subtitle ("Cinnamon Troubleshooting Tool" )
436
+ headerbar .set_show_close_button (True )
437
+ self .window .set_titlebar (headerbar )
434
438
self .window .set_icon_name ("system-search" )
435
439
self .window .set_default_size (1000 , 400 )
436
- self .window .set_position (Gtk .WindowPosition .MOUSE )
437
-
438
- # I can't think of a way to reliably detect if the window
439
- # is active to determine if we need to present or hide
440
- # in show(). Since the window briefly loses focus during
441
- # shortcut press we'd be unable to detect it at that time.
442
- # Keeping the window on top ensures the window is never
443
- # obscured so we can just hide if visible.
444
- self .window .set_keep_above (True )
440
+ self .window .set_position (Gtk .WindowPosition .CENTER )
445
441
446
442
self .window .connect ("delete_event" , self .on_delete )
447
443
self .window .connect ("key-press-event" , self .on_key_press )
@@ -463,18 +459,13 @@ def construct_window(self):
463
459
self .notebook .set_show_border (True )
464
460
self .notebook .set_show_tabs (True )
465
461
466
- label = Gtk .Label (label = "Melange" )
467
- label .set_markup ("<u>Melange - Cinnamon Debugger</u> " )
468
- label .show ()
469
- self .notebook .set_action_widget (label , Gtk .PackType .END )
470
-
471
462
self .pages = {}
472
463
self .custom_pages = {}
464
+ self .create_page ("Logs" , "log" )
473
465
self .create_page ("Results" , "results" )
474
466
self .create_page ("Inspect" , "inspect" )
475
467
self .create_page ("Windows" , "windows" )
476
468
self .create_page ("Extensions" , "extensions" )
477
- self .create_page ("Log" , "log" )
478
469
479
470
table .attach (self .notebook , 0 , num_columns , 0 , 1 )
480
471
@@ -531,7 +522,6 @@ def construct_window(self):
531
522
532
523
table .attach (box , column , column + 1 , 1 , 2 , 0 , 0 , 1 )
533
524
534
- # self.activate_page("results")
535
525
self .status_label .hide ()
536
526
self .window .set_focus (self .command_line )
537
527
@@ -551,7 +541,6 @@ def create_action_button(self):
551
541
menu .append (self .create_menu_item ('Crash Cinnamon' , crash_func ))
552
542
menu .append (self .create_menu_item ('Reset Cinnamon Settings' , self .on_reset_clicked ))
553
543
menu .append (Gtk .SeparatorMenuItem ())
554
- menu .append (self .create_menu_item ('About Melange' , self .on_about_clicked ))
555
544
menu .append (self .create_menu_item ('Quit' , self .on_delete ))
556
545
menu .show_all ()
557
546
@@ -579,22 +568,6 @@ def on_close_tab(self, label, content):
579
568
content .destroy ()
580
569
del self .custom_pages [label ]
581
570
582
- def on_about_clicked (self , menu_item ):
583
- dialog = Gtk .MessageDialog (self .window , 0 ,
584
- Gtk .MessageType .QUESTION , Gtk .ButtonsType .CLOSE )
585
-
586
- dialog .set_title ("About Melange" )
587
- dialog .set_markup ("""\
588
- <b>Melange</b> is a GTK3 alternative to the built-in javascript debugger <i>Looking Glass</i>
589
-
590
- Pressing <i>Escape</i> while Melange has focus will hide the window.
591
- If you want to exit Melange, use ALT+F4 or the <u>Actions</u> menu button.
592
-
593
- If you defined a hotkey for Melange, pressing it while Melange is visible it will be hidden.""" )
594
-
595
- dialog .run ()
596
- dialog .destroy ()
597
-
598
571
def on_reset_clicked (self , menu_item ):
599
572
dialog = Gtk .MessageDialog (self .window , 0 ,
600
573
Gtk .MessageType .WARNING , Gtk .ButtonsType .YES_NO ,
0 commit comments