~exaile-bugday/+junk/exaile

« back to all changes in this revision

Viewing changes to plugins/minimode/mmwidgets.py

  • Committer: Mathias Brodala
  • Date: 2009-07-29 01:02:51 UTC
  • Revision ID: info@noctus.net-20090729010251-ccaexkiukfh1swp5
* Minimode: Add arrow to playlist button

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
        gtk.ToggleButton.__init__(self, '')
224
224
 
225
225
        self.set_size_request(150, -1)
226
 
        self.get_child().set_property('ellipsize', pango.ELLIPSIZE_END)
 
226
        box = gtk.HBox()
 
227
        self.arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_OUT)
 
228
        box.pack_start(self.arrow, expand=False)
 
229
        self.label = gtk.Label('')
 
230
        self.label.set_property('ellipsize', pango.ELLIPSIZE_END)
 
231
        box.pack_start(self.label)
 
232
        self.remove(self.child)
 
233
        self.add(box)
227
234
 
228
235
        self.main = main
229
236
        self.queue = queue
296
303
        """
297
304
        self.playlist._set_tracks(tracks)
298
305
 
 
306
    def set_label(self, text):
 
307
        """
 
308
            Sets the label of the button
 
309
        """
 
310
        self.label.set_text(text)
 
311
 
 
312
    def set_arrow_direction(self, direction):
 
313
        """
 
314
            Sets the direction of the arrow
 
315
        """
 
316
        self.arrow.set(direction, gtk.SHADOW_OUT)
 
317
 
299
318
    def on_playlist_current_changed(self, event, playlist, track):
300
319
        """
301
320
            Updates the currently selected track
372
391
 
373
392
        if self.get_active():
374
393
            self.move_popup()
 
394
            self.set_arrow_direction(gtk.ARROW_DOWN)
375
395
            self.popup.show()
376
396
        else:
377
397
            self.popup.hide()
 
398
            self.set_arrow_direction(gtk.ARROW_RIGHT)
378
399
 
379
400
    def on_drag_data_received(self, togglebutton, context, x, y, selection, info, timestamp):
380
401
        """