add button for fullscreen action to toolbar of cover panel

This commit is contained in:
coderkun 2016-06-11 13:34:16 +02:00
parent 02ee75de4d
commit 1001f38a67
2 changed files with 24 additions and 1 deletions

View file

@ -911,7 +911,25 @@
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
<object class="GtkButton" id="cover-toolbar-fullscreen">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_cover-toolbar-fullscreen_clicked" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">view-fullscreen-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="non_homogeneous">True</property>
</packing>
</child>
</object>
<packing>

View file

@ -780,6 +780,7 @@ class CoverPanel(mcg.Base):
def get_signal_handlers(self):
return {
'on_cover-toolbar-fullscreen_clicked': self.on_fullscreen_clicked,
'on_cover-box_button_press_event': self.on_cover_box_pressed,
'on_cover-scroll_size_allocate': self.on_cover_size_allocate,
'on_cover-songs_button_press_event': self.on_songs_start_change,
@ -787,6 +788,10 @@ class CoverPanel(mcg.Base):
}
def on_fullscreen_clicked(self, widget):
self._callback(self.SIGNAL_TOGGLE_FULLSCREEN)
def on_cover_box_pressed(self, widget, event):
if event.type == Gdk.EventType._2BUTTON_PRESS:
self._callback(self.SIGNAL_TOGGLE_FULLSCREEN)