comparison browser_side/panels.py @ 206:4d7054542751

browser side: contactBox doesn't use left margin anymore (avoid scrollbar issues) + some cosmetic changes to contact panel switch button
author Goffi <goffi@goffi.org>
date Thu, 27 Jun 2013 20:45:41 +0200
parents 2bc6cf004e61
children 3092f6b1710c
comparison
equal deleted inserted replaced
205:ee744ffed7fc 206:4d7054542751
741 self.setWidget(self._vpanel) 741 self.setWidget(self._vpanel)
742 742
743 def onUrlClick(self, sender): 743 def onUrlClick(self, sender):
744 self._frame.setUrl(self._url.getText()) 744 self._frame.setUrl(self._url.getText())
745 745
746 class ContactTabPanel(HorizontalPanel):
747 """ TabPanel with a contacts list which can be hidden """
748
749 def __init__(self, host, locked = False):
750 self.host=host
751 HorizontalPanel.__init__(self)
752 self._left = VerticalPanel()
753 contacts_switch = Button('<<', self._contactsSwitch)
754 contacts_switch.addStyleName('contactsSwitch')
755 self._left.add(contacts_switch)
756 self._left.add(self.host.contact_panel)
757 self._right = base_widget.WidgetsPanel(host)
758 self._right.setWidth('100%')
759 self._right.setHeight('100%')
760 self.add(self._left)
761 self.add(self._right)
762 self.setCellWidth(self._right, "100%")
763
764 def addWidget(self, wid):
765 """Add a widget to the WidgetsPanel"""
766 print "main addWidget", wid
767 self._right.addWidget(wid)
768
769 class MainPanel(AbsolutePanel): 746 class MainPanel(AbsolutePanel):
770 747
771 def __init__(self, host): 748 def __init__(self, host):
772 self.host=host 749 self.host=host
773 AbsolutePanel.__init__(self) 750 AbsolutePanel.__init__(self)
781 758
782 #status bar 759 #status bar
783 status = host.status_panel 760 status = host.status_panel
784 761
785 #contacts 762 #contacts
786 _contacts = VerticalPanel() 763 _contacts = HorizontalPanel()
787 contacts_switch = Button('<<', self._contactsSwitch) 764 _contacts.addStyleName('globalLeftArea')
765 contacts_switch = Button(u'«', self._contactsSwitch)
788 contacts_switch.addStyleName('contactsSwitch') 766 contacts_switch.addStyleName('contactsSwitch')
789 _contacts.add(contacts_switch) 767 _contacts.add(contacts_switch)
790 _contacts.add(self.host.contact_panel) 768 _contacts.add(self.host.contact_panel)
791 769
792 #tabs 770 #tabs
812 790
813 def _contactsSwitch(self, btn): 791 def _contactsSwitch(self, btn):
814 """ (Un)hide contacts panel """ 792 """ (Un)hide contacts panel """
815 cpanel = self.host.contact_panel 793 cpanel = self.host.contact_panel
816 cpanel.setVisible(not cpanel.getVisible()) 794 cpanel.setVisible(not cpanel.getVisible())
817 btn.setText("<<" if cpanel.getVisible() else ">>") 795 btn.setText(u"«" if cpanel.getVisible() else u"»")
818 self.host.resize() 796 self.host.resize()
819 797
820 def onWindowResized(self, width, height): 798 def onWindowResized(self, width, height):
821 _elts = doc().getElementsByClassName('gwt-TabBar') 799 _elts = doc().getElementsByClassName('gwt-TabBar')
822 if not _elts.length: 800 if not _elts.length: