from gi.repository import Gtk

class MainWindow(Gtk.Window):
    
    def __init__(self):
        Gtk.Window.__init__(self, title="Teste")
        self.set_size_request(800, 600)
        self.connect("delete_event", lambda w,e: Gtk.main_quit())
        
        self.settings = Gtk.Settings.get_default()
        self.settings.set_property("gtk-application-prefer-dark-theme", True)
        
        self.header = Gtk.HeaderBar()
        self.header.set_show_close_button(True)
        self.set_titlebar (self.header)
        self.header.show()
        
        self.header.set_title ("Project name")
        self.header.set_subtitle ("/home/project/path")
        
        self._createUI()
        
        self.show()
        
    def _createUI(self):
        box = Gtk.Box (Gtk.Orientation.HORIZONTAL)
        box.get_style_context().add_class("linked")
        box.show()
        
        # UNDO
        self.undo = Gtk.Button.new_from_icon_name ("edit-undo-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.undo.set_label("Undo")
        self.undo.set_always_show_image (True)
        box.pack_start (self.undo, True, True, 0)
        self.undo.show()
        
        #REDO
        self.redo = Gtk.Button.new_from_icon_name ("edit-redo-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        box.pack_start(self.redo, True, True, 0)
        self.redo.show()
        
        self.header.pack_start (box)
        
        # SEPARATOR 1
        separator = Gtk.Separator ()
        separator.set_orientation (Gtk.Orientation.VERTICAL)
        self.header.pack_start(separator)
        separator.show()
        
        # SAVE
        self.save = Gtk.Button.new_from_icon_name ("document-save-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.save.set_label("Save")
        self.save.set_always_show_image (True)
        self.header.pack_start(self.save)
        self.save.show()
        
        # Last button
        self.options = Gtk.Button.new_from_icon_name ("emblem-system-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.header.pack_end (self.options)
        self.options.show()
        
        # RENDER
        self.render = Gtk.Button.new_from_icon_name ("process-stop-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
        self.render.set_label("Render...")
        self.render.set_always_show_image (True)
        self.header.pack_end(self.render)
        self.render.show()
        
        
        
    

def main():
    main = MainWindow()
    Gtk.main()
    
    

if __name__ == "__main__":
    main()
