Class: TopinambourWindow

Inherits:
Gtk::ApplicationWindow
  • Object
show all
Includes:
TopinambourWindowActions
Defined in:
lib/window.rb

Overview

Main window of Topinambour

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TopinambourWindowActions

#display_about, #quit_gracefully, #show_color_selector, #show_font_selector, #show_shortcuts

Constructor Details

#initialize(application) ⇒ TopinambourWindow

Returns a new instance of TopinambourWindow.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/window.rb', line 51

def initialize(application)
  super(application)
  @application = application
  set_icon_name('utilities-terminal-symbolic')
  set_name('topinambour-window')
  set_position(:center)
  @overlay = TopinambourOverlay.new
  create_header_bar

  signal_connect 'key-press-event' do |widget, event|
    TopinambourShortcuts.handle_key_press(widget, event)
  end

  add(@overlay)
end

Instance Attribute Details

#overlayObject (readonly)

Returns the value of attribute overlay.



48
49
50
# File 'lib/window.rb', line 48

def overlay
  @overlay
end

#terminalObject (readonly)

Returns the value of attribute terminal.



48
49
50
# File 'lib/window.rb', line 48

def terminal
  @terminal
end

Instance Method Details

#add_terminal(cmd = '/usr/bin/zsh') ⇒ Object



67
68
69
70
71
# File 'lib/window.rb', line 67

def add_terminal(cmd = '/usr/bin/zsh')
  terminal = TopinambourTermBox.new(cmd, self)
  @terminal = terminal.term
  @overlay.add_main_widget(terminal)
end

#create_header_barObject



73
74
75
76
77
78
# File 'lib/window.rb', line 73

def create_header_bar
  headerbar = Gtk::HeaderBar.new
  headerbar.name = 'topinambour-headerbar'
  headerbar.show_close_button = true
  set_titlebar(headerbar)
end

#exit_overlay_modeObject



80
81
82
# File 'lib/window.rb', line 80

def exit_overlay_mode
  @overlay.exit_overlay_mode
end