Merge lp:~psquid/heybuddy/maemo_tweaks into lp:heybuddy

Proposed by Psychedelic Squid
Status: Needs review
Proposed branch: lp:~psquid/heybuddy/maemo_tweaks
Merge into: lp:heybuddy
Diff against target: 352 lines (+136/-45)
4 files modified
ContextPage.py (+0/-7)
GroupPage.py (+41/-12)
UserPage.py (+42/-18)
heybuddy.py (+53/-8)
To merge this branch: bzr merge lp:~psquid/heybuddy/maemo_tweaks
Reviewer Review Type Date Requested Status
jezra Approve
Review via email: mp+60008@code.launchpad.net

This proposal supersedes a proposal from 2011-05-04.

Description of the change

This branch contains the fix for actually making submitting work on Maemo.

Also, as of this resubmitted proposal:

Some new Maemo tweaks: collapsible info sections for groups/users, and close buttons in tab titles (for closeable tabs only), rather than a separate button at the bottom of the tab.

Only possible issue I can see is with the close buttons; they do make the tab bar a few pixels taller when a closeable tab is open. Haven't figured out how/if it's possible to have it keep a constant height.

To post a comment you must log in.
Revision history for this message
jezra (jezra) wrote : Posted in a previous version of this proposal

shit yea, boyeeeeee!

review: Approve
lp:~psquid/heybuddy/maemo_tweaks updated
272. By Psychedelic Squid

Do some hackery to keep the tabbar height from fluctuating.

Revision history for this message
jezra (jezra) :
review: Approve

Unmerged revisions

272. By Psychedelic Squid

Do some hackery to keep the tabbar height from fluctuating.

271. By Psychedelic Squid

Close buttons in tab header for all closeable tabs, rather than at the bottom of the tab. Saves a lot of space.

270. By Psychedelic Squid

Collapsible info-area for groups/users. This makes it possible to actually see a sensible amount of dents on small screens (e.g., maemo) when the bio is long.

269. By Psychedelic Squid

Restore Maemo devices' ability to submit dents.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ContextPage.py'
2--- ContextPage.py 2010-10-09 06:14:56 +0000
3+++ ContextPage.py 2011-05-05 04:39:25 +0000
4@@ -14,13 +14,6 @@
5 }
6 def __init__(self):
7 ScrollPage.__init__(self)
8- #we do need a close button
9- close_button=gtk.Button(_("Close"))
10- hbox = gtk.HBox(False)
11- hbox.pack_start(close_button,False,False,0)
12- close_button.connect('clicked',self.close)
13- self.pack_end(hbox,False,False,0)
14-
15
16 def close(self,button):
17 #we can just hid ourself
18
19=== modified file 'GroupPage.py'
20--- GroupPage.py 2011-04-11 18:31:17 +0000
21+++ GroupPage.py 2011-05-05 04:39:25 +0000
22@@ -3,6 +3,7 @@
23 copyright 2010 jezra lickter http://www.jezra.net
24 '''
25 from DentScroller import DentScroller
26+from DentButton import DentButton
27 import gtk,gobject
28 from PlatformSpecific import links_unavailable
29 class GroupPage(gtk.VBox,gobject.GObject):
30@@ -32,11 +33,11 @@
31 imagevbox.pack_start(self.image,False,False,0)
32
33 #make an hbox to hold image and group info
34- grouphbox=gtk.HBox(False,5)
35- self.pack_start(grouphbox,False,False,0)
36- grouphbox.pack_start(imagevbox,False,False,0)
37+ self.grouphbox=gtk.HBox(False,5)
38+ self.pack_start(self.grouphbox,False,False,0)
39+ self.grouphbox.pack_start(imagevbox,False,False,0)
40 infovbox = gtk.VBox(False)
41- grouphbox.pack_start(infovbox,False,False)
42+ self.grouphbox.pack_start(infovbox,False,False)
43
44 self.name_label = gtk.Label()
45 infovbox.pack_start(self.name_label,False,False,0)
46@@ -53,27 +54,45 @@
47 self.location_label = gtk.Label()
48 infovbox.pack_start(self.location_label,False,False,0)
49
50+ #widget box for the horizontal stuff
51+ self.widgetbox = gtk.HBox(False)
52+ self.pack_start(self.widgetbox,False,False,0)
53+
54 #make a checkbutton if we are following
55 self.joined_checkbutton = gtk.CheckButton(_("joined"))
56 self.joined_checkbutton.connect('toggled', self.joined_toggled)
57- infovbox.pack_start(self.joined_checkbutton,False,False,0)
58+ self.widgetbox.pack_start(self.joined_checkbutton,False,False,0)
59+
60+ #collapse button
61+ collapsebox = gtk.Alignment(xalign=1.0)
62+ self.collapse_button = DentButton(u'\u25b2')
63+ self.collapse_button.connect('clicked',self.collapse_clicked)
64+ collapsebox.add(self.collapse_button)
65+ self.widgetbox.pack_end(collapsebox,True,True,0)
66+
67+ #collapsed widget box and name label
68+ self.widgetbox_collapsed = gtk.HBox(False)
69+ self.name_label_collapsed = gtk.Label()
70+ self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
71+ #its expand button
72+ expandbox = gtk.Alignment(xalign=1.0)
73+ self.expand_button = DentButton(u'\u25bc')
74+ self.expand_button.connect('clicked',self.expand_clicked)
75+ expandbox.add(self.expand_button)
76+ self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
77+ #pack it up
78+ self.pack_start(self.widgetbox_collapsed,False,False,0)
79
80 #create a group dent scroller and add it to the group page
81 self.dentScroller = DentScroller()
82 self.pack_start(self.dentScroller)
83
84- #make a "close" button
85- hbox = gtk.HBox(False)
86- user_close_button=gtk.Button(_("Close"))
87- hbox.pack_start(user_close_button,False,False,0)
88- user_close_button.connect('clicked',self.close)
89- self.pack_end(hbox,False,False,0)
90-
91 def set_group_data(self,data):
92 self.joined_checkbutton.set_sensitive(True)
93 self.group_id= data['id']
94 self.group_name = data['fullname']
95 self.name_label.set_text("%s" %(data['fullname']) )
96+ self.name_label_collapsed.set_text("%s" %(data['fullname']) )
97 if data['location']!=None:
98 self.location_label.set_text("%s: %s" %(_("Location"), data['location']) )
99 self.location_label.show()
100@@ -122,6 +141,16 @@
101 #self.hide()
102 self.emit('group-page-hide')
103
104+ def collapse_clicked(self,widget):
105+ self.grouphbox.hide()
106+ self.widgetbox.hide()
107+ self.widgetbox_collapsed.show()
108+
109+ def expand_clicked(self,widget):
110+ self.grouphbox.show()
111+ self.widgetbox.show()
112+ self.widgetbox_collapsed.hide()
113+
114 def process_link(self, label, uri ):
115 self.emit('open-link', uri )
116 return True
117
118=== modified file 'UserPage.py'
119--- UserPage.py 2011-04-11 18:31:17 +0000
120+++ UserPage.py 2011-05-05 04:39:25 +0000
121@@ -61,47 +61,60 @@
122 labelvbox.pack_start(self.location_label,False,False,0)
123 labelvbox.pack_start(self.url_label,False,False,0)
124 #make an hbox to hold the image and labels
125- userhbox=gtk.HBox(False,5)
126+ self.userhbox=gtk.HBox(False,5)
127 #make an hbox to hold widgets
128- widgetbox = gtk.HBox(False)
129+ self.widgetbox = gtk.HBox(False)
130 #add the imagevbox
131- userhbox.pack_start(imagevbox,False,False,0)
132- userhbox.pack_start(labelvbox,False,False,0)
133- self.pack_start(userhbox,False,False,0)
134- self.pack_start(widgetbox,False,False,0)
135+ self.userhbox.pack_start(imagevbox,False,False,0)
136+ self.userhbox.pack_start(labelvbox,False,False,0)
137+ self.pack_start(self.userhbox,False,False,0)
138+ self.pack_start(self.widgetbox,False,False,0)
139 #make a checkbutton if we are following
140 self.following_checkbutton = gtk.CheckButton(_("Following"))
141 self.following_checkbutton.connect('toggled', self.following_toggled)
142- widgetbox.pack_start(self.following_checkbutton,False,False,0)
143+ self.widgetbox.pack_start(self.following_checkbutton,False,False,0)
144 #how about a 'direct' button?
145 self.direct_button = DentButton('direct')
146 self.direct_button.connect('clicked',self.direct_clicked)
147- widgetbox.pack_start(self.direct_button,False,False,0)
148+ self.widgetbox.pack_start(self.direct_button,False,False,0)
149 #create stuff for blocking -- commented out 9.3.10 x1101
150 blockbox=gtk.HBox()
151 #enabler
152 self.enable_block_checkbutton = gtk.CheckButton(_("Enable Blocking"))
153 self.enable_block_checkbutton.connect('toggled', self.block_enable_toggled)
154-
155+
156 #the blocking buttons
157 self.block_button = DentButton('block')
158 self.block_button.connect('clicked',self.block_clicked)
159 self.block_button.set_sensitive(False)
160 blockbox.pack_start(self.block_button,False,False,0)
161 blockbox.pack_start(self.enable_block_checkbutton,False,False,0)
162-
163- widgetbox.pack_end(blockbox)
164+ self.widgetbox.pack_start(blockbox,False,False,0)
165+
166+ #the collapse button
167+ collapsebox = gtk.Alignment(xalign=1.0)
168+ self.collapse_button = DentButton(u'\u25b2')
169+ self.collapse_button.connect('clicked',self.collapse_clicked)
170+ collapsebox.add(self.collapse_button)
171+ self.widgetbox.pack_end(collapsebox,True,True,0)
172+
173+ #the collapsed widget box and name label
174+ self.widgetbox_collapsed = gtk.HBox(False)
175+ self.name_label_collapsed = gtk.Label()
176+ self.widgetbox_collapsed.pack_start(self.name_label_collapsed,False,False,0)
177+ #its expand button
178+ expandbox = gtk.Alignment(xalign=1.0)
179+ self.expand_button = DentButton(u'\u25bc')
180+ self.expand_button.connect('clicked',self.expand_clicked)
181+ expandbox.add(self.expand_button)
182+ self.widgetbox_collapsed.pack_end(expandbox,True,True,0)
183+ #pack it up
184+ self.pack_start(self.widgetbox_collapsed,False,False,0)
185+
186 #create a user dent scroller and add it to the user page
187 self.dentScroller = DentScroller()
188 self.pack_start(self.dentScroller)
189
190- #make a "close" button
191- hbox = gtk.HBox(False)
192- user_close_button=gtk.Button(_("Close"))
193- hbox.pack_start(user_close_button,False,False,0)
194- user_close_button.connect('clicked',self.close)
195- self.pack_end(hbox,False,False,0)
196-
197 def set_image(self,image):
198 self.image.set_from_file(image)
199 self.image.show()
200@@ -110,6 +123,7 @@
201 self.screen_name = data['screen_name']
202 self.user_id=data['id']
203 self.name_label.set_text("%s (%s)" %(data['name'],data['screen_name']) )
204+ self.name_label_collapsed.set_text("%s (%s)" %(data['name'],data['screen_name']) )
205 if data['location']!=None:
206 self.location_label.set_text("%s: %s" % (_("Location"),data['location']) )
207 self.location_label.show()
208@@ -177,6 +191,16 @@
209 #disable the button
210 widget.set_sensitive(False)
211 self.emit('block-create',self.user_id)
212+
213+ def collapse_clicked(self,widget):
214+ self.userhbox.hide()
215+ self.widgetbox.hide()
216+ self.widgetbox_collapsed.show()
217+
218+ def expand_clicked(self,widget):
219+ self.userhbox.show()
220+ self.widgetbox.show()
221+ self.widgetbox_collapsed.hide()
222
223 def process_link(self, label, uri ):
224 self.emit('open-link', uri )
225
226=== modified file 'heybuddy.py'
227--- heybuddy.py 2011-05-04 21:57:08 +0000
228+++ heybuddy.py 2011-05-05 04:39:25 +0000
229@@ -192,21 +192,59 @@
230 #self.mainwindow.connect('window-state-event', self.mainwindow_state_event)
231 self.mainwindow.connect('delete-event', self.mainwindow_delete_event)
232
233+ # local function to create a closeable tab label for closeable tabs
234+ def closeable_tab_label(caption, tab):
235+ tablabel = gtk.HBox(False)
236+ tablabel.pack_start(gtk.Label(caption),True,True,0)
237+ closebutton = gtk.Button()
238+ closeicon = gtk.Image()
239+ closeicon.set_from_stock(gtk.STOCK_CLOSE,gtk.ICON_SIZE_MENU)
240+ closebutton.set_image(closeicon)
241+ closebutton.set_relief(gtk.RELIEF_NONE)
242+ tinybutton_style = gtk.RcStyle()
243+ tinybutton_style.xthickness = 0
244+ tinybutton_style.ythickness = 0
245+ closebutton.modify_style(tinybutton_style)
246+ if tab != None: # if this isn't a mock-add
247+ closebutton.connect('clicked',tab.close)
248+ closebutton.set_tooltip_text(_("Close"))
249+ tablabel.pack_start(closebutton,False,False,0)
250+ tablabel.show_all()
251+ return tablabel
252+
253+ # do a mock add of dentspage, with a close label, so as to determine height needed for uncloseable tabs' labels, then break it all down again
254+ # this is ridiculously hacky, but it works, and doesn't leave anything behind
255+ self.dentspage = ScrollPage()
256+ self.mock_label = closeable_tab_label(_("Dents"),None)
257+ self.mainwindow.notebook.append_page(self.dentspage,self.mock_label)
258+ self.mainwindow.show_all() # we have to do this so the tab gets actualised, and thus gets a height
259+ min_tab_height = self.mock_label.allocation.height
260+ self.mainwindow.hide_all()
261+ self.mainwindow.notebook.remove_page(-1)
262+ del self.mock_label
263+
264+ # local function to create a label the same height as the closeable tabs' labels
265+ def uncloseable_tab_label(caption):
266+ tablabel = gtk.Label(caption)
267+ tablabel.set_size_request(-1,min_tab_height)
268+ tablabel.show()
269+ return tablabel
270+
271 # create and add all of the pages
272 self.dentspage = ScrollPage()
273- self.mainwindow.notebook.append_page(self.dentspage,gtk.Label(_("Dents") ) )
274+ self.mainwindow.notebook.append_page(self.dentspage,uncloseable_tab_label(_("Dents") ) )
275
276 self.mentionspage = ScrollPage()
277- self.mainwindow.notebook.append_page(self.mentionspage,gtk.Label(_("Mentions")) )
278+ self.mainwindow.notebook.append_page(self.mentionspage,uncloseable_tab_label(_("Mentions")) )
279
280 self.directspage = ScrollPage()
281- self.mainwindow.notebook.append_page(self.directspage,gtk.Label(_("Directs")) )
282+ self.mainwindow.notebook.append_page(self.directspage,uncloseable_tab_label(_("Directs")) )
283
284 #make the conversation page
285 self.contextpage=ContextPage()
286 self.contextpage.connect('context-page-hide',self.hide_contextpage)
287 #add the contextpage
288- self.mainwindow.notebook.append_page(self.contextpage,gtk.Label("Context") )
289+ self.mainwindow.notebook.append_page(self.contextpage,closeable_tab_label("Context",self.contextpage))
290
291 #create a user page
292 self.userpage=UserPage()
293@@ -218,15 +256,16 @@
294 self.userpage.connect('block-destroy',self.block_destroy)
295
296 #add the userpage
297- self.mainwindow.notebook.append_page(self.userpage,gtk.Label(_("User") ) )
298+ self.mainwindow.notebook.append_page(self.userpage,closeable_tab_label(_("User"),self.userpage ) )
299
300 #create a Group page
301 self.grouppage=GroupPage()
302 self.grouppage.connect('group-page-hide',self.hide_grouppage)
303 self.grouppage.connect('join-group',self.join_group)
304 self.grouppage.connect('open-link',self.open_link)
305+
306 #add the Grouppage
307- self.mainwindow.notebook.append_page(self.grouppage,gtk.Label(_("Group") ) )
308+ self.mainwindow.notebook.append_page(self.grouppage,closeable_tab_label(_("Group"),self.grouppage ) )
309
310 #create and add the account page
311 self.settingspage = SettingsPage(has_hildon,has_pynotify)
312@@ -264,11 +303,11 @@
313 self.settingspage.connect('add-user-filter', self.add_user_filter )
314 self.settingspage.connect('remove-user-filter', self.remove_user_filter )
315 #add the settings to the mainwindow
316- self.mainwindow.add_notebook_page(self.settingspage,gtk.Label(_("Settings") ) )
317+ self.mainwindow.add_notebook_page(self.settingspage,uncloseable_tab_label(_("Settings") ) )
318 #create and add the about page
319 about = About(version,branch,self.standard_icon_path,self.readme_file)
320 about.connect('open-link',self.open_link)
321- self.mainwindow.add_notebook_page( about, gtk.Label(_("About") ) )
322+ self.mainwindow.add_notebook_page( about, uncloseable_tab_label(_("About") ) )
323 self.mainwindow.show_some()
324 #hide some stuff
325 self.grouppage.hide_all()
326@@ -693,6 +732,8 @@
327 self.userpage.disable()
328 #show the page
329 self.userpage.show_all()
330+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
331+ self.userpage.widgetbox_collapsed.hide()
332 #clear the userpage stuff
333 self.userpage.clear()
334 #change to the user page
335@@ -706,6 +747,8 @@
336 self.userpage.disable()
337 #show the page
338 self.userpage.show_all()
339+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
340+ self.userpage.widgetbox_collapsed.hide()
341 #clear the userpage stuff
342 self.userpage.clear()
343 #change to the user page
344@@ -959,6 +1002,8 @@
345 self.grouppage.joined_checkbutton.set_sensitive(False)
346 #make the grouppage visible
347 self.grouppage.show_all()
348+ #rehide its collapsed widgetbox, that doesn't need to be visible yet
349+ self.grouppage.widgetbox_collapsed.hide()
350 #clear the grouppage
351 self.grouppage.clear()
352 #switch to the group page

Subscribers

People subscribed via source and target branches