diff --git a/src/chat.py b/src/chat.py index c6abf326c..458f31b69 100644 --- a/src/chat.py +++ b/src/chat.py @@ -408,6 +408,9 @@ class Chat: elif event.string and event.string in st and \ (event.state & gtk.gdk.MOD1_MASK): # alt + 1,2,3.. self.notebook.set_current_page(st.index(event.string)) + elif event.keyval == gtk.keysyms.c and \ + (event.state & gtk.gdk.MOD1_MASK): # alt + C + self.set_compact_view(not self.get_compact_view()) elif event.keyval == gtk.keysyms.Page_Down: if event.state & gtk.gdk.CONTROL_MASK: # CTRL + PAGE DOWN current = self.notebook.get_current_page() @@ -875,3 +878,26 @@ class Chat: # iterate through tabs/windows and repaint for jid in self.xmls: self.paint_banner(jid) + + def get_compact_view(self): + """Is compact view turned on?""" + return self.compact_view + + def set_compact_view(self,state): + '''Toggle compact view + To be overwritten in parent class if we want to toggle more + widgets''' + self.compact_view = state + + for jid in self.xmls: + widgets = [self.xmls[jid].get_widget('banner_eventbox'), + self.xmls[jid].get_widget('actions_hbox'), + ] + + for widget in widgets: + if state: + widget.set_no_show_all(True) + widget.hide() + else: + widget.set_no_show_all(False) + widget.show() diff --git a/src/groupchat_window.py b/src/groupchat_window.py index d01376174..0aa121072 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -991,10 +991,6 @@ class GroupchatWindow(chat.Chat): image = self.plugin.roster.jabber_state_images['closed'] model.set_value(iter, 0, image) - def get_compact_view(self): - '''Is compact view turned on?''' - return self.compact_view - def set_compact_view(self,state): '''Toggle compact view''' diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 7c6405400..102f241c8 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -475,25 +475,3 @@ class TabbedChatWindow(chat.Chat): item.connect('activate', lambda obj:self.set_compact_view( not self.get_compact_view())) menu.append(item) - - def get_compact_view(self): - """Is compact view turned on?""" - return self.compact_view - - def set_compact_view(self,state): - """Toggle compact view""" - - self.compact_view = state - - for jid in self.xmls: - widgets = [self.xmls[jid].get_widget('banner_eventbox'), - self.xmls[jid].get_widget('actions_hbox'), - ] - - for widget in widgets: - if state: - widget.set_no_show_all(True) - widget.hide() - else: - widget.set_no_show_all(False) - widget.show()