From 6b91d8a3432b7225dc338f267f933875a1329b1e Mon Sep 17 00:00:00 2001 From: Braiden Vasco Date: Mon, 24 Jul 2017 11:03:47 +0000 Subject: [PATCH] Remove Widgets::Messenger --- lib/main.rb | 2 -- lib/widgets/messenger.rb | 43 ---------------------------------------- 2 files changed, 45 deletions(-) delete mode 100644 lib/widgets/messenger.rb diff --git a/lib/main.rb b/lib/main.rb index c530eab..55804c5 100644 --- a/lib/main.rb +++ b/lib/main.rb @@ -18,8 +18,6 @@ require 'widgets/v_panel' require 'widgets/main' -require 'widgets/messenger' - require 'widgets/menu' require 'widgets/menu/logo' require 'widgets/menu/items' diff --git a/lib/widgets/messenger.rb b/lib/widgets/messenger.rb deleted file mode 100644 index bb7c72b..0000000 --- a/lib/widgets/messenger.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -module Widgets - class Messenger < Container - def initialize(x, y, width, height) - super - - peers_width = width / 4 - chat_width = width - peers_width - - peers_left = 0 - chat_left = peers_width - - @peers = Widgets::Peers.new x + peers_left, y, peers_width, height - @chat = Widgets::Chat.new x + chat_left, y, chat_width, height - - self.focus = @peers - end - - def children - [@peers, @chat] - end - - def trigger(event) - case event - when Events::Window::Left - left - when Events::Window::Right - right - else - focus.trigger event - end - end - - def left - self.focus = @peers - end - - def right - self.focus = @chat - end - end -end