Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

hgcmd: use SlimToolbar in CmdWidget

Changeset 09cc55cda934

Parent 8ceb37abc55f

by Yuki KODAMA

Changes to one file · Browse files at 09cc55cda934 Showing diff from parent 8ceb37abc55f Diff from another changeset...

 
247
248
249
250
 
251
252
253
254
255
256
257
258
259
 
 
260
261
262
263
264
265
 
 
 
266
267
268
269
 
270
271
272
 
247
248
249
 
250
251
252
 
 
 
 
 
 
 
253
254
255
 
256
257
 
 
258
259
260
261
262
263
 
264
265
266
267
@@ -247,26 +247,21 @@
  raise _('unknown CmdWidget style: %s') % style     # progress bar box - self.progbox = progbox = gtk.HBox() + self.progbox = progbox = gtklib.SlimToolbar()   self.pack_start(progbox)   - def add_button(stock, handler): - img = gtk.Image() - img.set_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR) - btn = gtk.ToggleButton() - btn.set_image(img) - btn.set_relief(gtk.RELIEF_NONE) - btn.set_focus_on_click(False) + def add_button(stock_id, handler, toggle=False): + btn = progbox.append_stock(stock_id, toggle=toggle)   btn.connect('clicked', handler) - progbox.pack_start(btn, False, False)   return btn   - ## log button - self.log_btn = add_button(gtk.STOCK_JUSTIFY_LEFT, self.log_toggled) + ## log toggle button + self.log_btn = add_button(gtk.STOCK_JUSTIFY_LEFT, + self.log_toggled, toggle=True)     ## progress bar   self.pbar = gtk.ProgressBar() - progbox.pack_start(self.pbar) + progbox.append_widget(self.pbar, expand=True)     ## stop & close buttons   if self.is_compact: