Fix shortcut to exit fullscreen mode (close #71)

Fix the shortcut for fullscreen mode to also exit it. Additionally fix
the shortcuts window to show the correct shortcut for fullscreen mode.
This commit is contained in:
coderkun 2020-07-25 11:07:57 +02:00
parent 9ad3086ace
commit ddf8368bfd
8 changed files with 115 additions and 96 deletions

View file

@ -419,7 +419,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Show the cover in fullscreen mode</property>
<signal name="clicked" handler="on_cover-toolbar-fullscreen_clicked" swapped="no"/>
<property name="action_name">win.toggle-fullscreen</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@ -427,7 +427,6 @@
<property name="icon_name">view-fullscreen-symbolic</property>
</object>
</child>
<accelerator key="F11" signal="activate"/>
</object>
<packing>
<property name="expand">False</property>

View file

@ -17,6 +17,11 @@
<attribute name="label" translatable="yes">Clear Playlist</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
</item>
<item>
<attribute name="action">win.toggle-fullscreen</attribute>
<attribute name="label" translatable="yes">Toggle Fullscreen</attribute>
<attribute name="accel">F11</attribute>
</item>
</section>
<section>
<item>

View file

@ -97,7 +97,7 @@
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">1</property>
<property name="accelerator">&lt;alt&gt;Return F11</property>
<property name="accelerator">F11</property>
<property name="title" translatable="yes">Show the cover in fullscreen mode</property>
</object>
</child>

Binary file not shown.

View file

@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
"POT-Creation-Date: 2020-03-22 11:18+0100\n"
"PO-Revision-Date: 2020-03-22 11:18+0100\n"
"POT-Creation-Date: 2020-07-25 14:17+0200\n"
"PO-Revision-Date: 2020-07-25 14:17+0200\n"
"Last-Translator: coderkun <olli@suruatoel.xyz>\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Generator: Poedit 2.3.1\n"
"X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
@ -62,127 +62,127 @@ msgstr "Zu MPD verbinden"
msgid "Show the cover in fullscreen mode"
msgstr "Das Cover im Vollbildmodus anzeigen"
#: data/gtk.glade:470 data/gtk.glade:549
#: data/gtk.glade:469 data/gtk.glade:548
msgid "Select multiple albums"
msgstr "Mehrere Alben auswählen"
#: data/gtk.glade:492 data/gtk.shortcuts.ui:88
#: data/gtk.glade:491 data/gtk.shortcuts.ui:88
msgid "Clear the playlist"
msgstr "Die Wiedergabeliste leeren"
#: data/gtk.glade:526 data/gtk.shortcuts.ui:114
#: data/gtk.glade:525 data/gtk.shortcuts.ui:114
msgid "Search the library"
msgstr "Die Bibliothek durchsuchen"
#: data/gtk.glade:571
#: data/gtk.glade:570
msgid "Settings and actions"
msgstr "Einstellungen und Aktionen"
#: data/gtk.glade:676
#: data/gtk.glade:675
msgid "Enter hostname or IP address"
msgstr "Hostnamen oder IP-Adresse eingeben"
#: data/gtk.glade:688
#: data/gtk.glade:687
msgid "Enter URL or local path"
msgstr "URL oder lokalen Pfad eingeben"
#: data/gtk.glade:701
#: data/gtk.glade:700
msgid "Enter password or leave blank"
msgstr "Passwort eingeben oder leer lassen"
#: data/gtk.glade:729
#: data/gtk.glade:728
msgid "Host:"
msgstr "Host:"
#: data/gtk.glade:741
#: data/gtk.glade:740
msgid "Port:"
msgstr "Port:"
#: data/gtk.glade:753
#: data/gtk.glade:752
msgid "Password:"
msgstr "Passwort:"
#: data/gtk.glade:765
#: data/gtk.glade:764
msgid "Image Directory:"
msgstr "Bildordner:"
#: data/gtk.glade:866
#: data/gtk.glade:865
msgid "File:"
msgstr "Datei:"
#: data/gtk.glade:879
#: data/gtk.glade:878
msgid "Audio:"
msgstr "Audio:"
#: data/gtk.glade:892
#: data/gtk.glade:891
msgid "Bitrate:"
msgstr "Bitrate:"
#: data/gtk.glade:905
#: data/gtk.glade:904
msgid "Error:"
msgstr "Fehler:"
#: data/gtk.glade:917 data/gtk.glade:933 data/gtk.glade:949 data/gtk.glade:965
#: data/gtk.glade:916 data/gtk.glade:932 data/gtk.glade:948 data/gtk.glade:964
msgid "<i>none</i>"
msgstr "<i>nichts</i>"
#: data/gtk.glade:1000
#: data/gtk.glade:999
msgid "Status"
msgstr "Status"
#: data/gtk.glade:1085
#: data/gtk.glade:1084
msgid "Albums"
msgstr "Alben"
#: data/gtk.glade:1097
#: data/gtk.glade:1096
msgid "Songs"
msgstr "Songs"
#: data/gtk.glade:1109
#: data/gtk.glade:1108
msgid "Artists"
msgstr "Künstler"
#: data/gtk.glade:1133
#: data/gtk.glade:1132
msgid "Seconds"
msgstr "Sekunden"
#: data/gtk.glade:1180
#: data/gtk.glade:1179
msgid "Seconds played"
msgstr "Sekunden gespielt"
#: data/gtk.glade:1191
#: data/gtk.glade:1190
msgid "Seconds running"
msgstr "Sekunden laufend"
#: data/gtk.glade:1222
#: data/gtk.glade:1221
msgid "Statistics"
msgstr "Statistiken"
#: data/gtk.glade:1292
#: data/gtk.glade:1291
msgid "Audio Devices"
msgstr "Audiogeräte"
#: data/gtk.glade:1306
#: data/gtk.glade:1305
msgid "Server"
msgstr "Server"
#: data/gtk.glade:1487 data/gtk.menu.ui:30
#: data/gtk.glade:1486 data/gtk.menu.ui:35
msgid "Cover"
msgstr "Cover"
#: data/gtk.glade:1629 data/gtk.menu.ui:36
#: data/gtk.glade:1628 data/gtk.menu.ui:41
msgid "Playlist"
msgstr "Wiedergabeliste"
#: data/gtk.glade:1656
#: data/gtk.glade:1655
msgid "search library"
msgstr "Bibliothek durchsuchen"
#: data/gtk.glade:1881 data/gtk.menu.ui:42
#: data/gtk.glade:1880 data/gtk.menu.ui:47
msgid "Library"
msgstr "Bibliothek"
#: data/gtk.glade:1964
#: data/gtk.glade:1963
msgid ""
"CoverGrid is a client for the Music Player Daemon, focusing on albums "
"instead of single tracks."
@ -202,19 +202,23 @@ msgstr "Abspielen"
msgid "Clear Playlist"
msgstr "Playlist leeren"
#: data/gtk.menu.ui:24
#: data/gtk.menu.ui:22
msgid "Toggle Fullscreen"
msgstr "Vollbild wechseln"
#: data/gtk.menu.ui:29
msgid "Connection"
msgstr "Verbindung"
#: data/gtk.menu.ui:50
#: data/gtk.menu.ui:55
msgid "Keyboard Shortcuts"
msgstr "Tastenkombinationen"
#: data/gtk.menu.ui:55
#: data/gtk.menu.ui:60
msgid "Info"
msgstr "Info"
#: data/gtk.menu.ui:60
#: data/gtk.menu.ui:65
msgid "Quit"
msgstr "Beenden"
@ -270,27 +274,27 @@ msgstr "{} mit {}"
msgid "{}:{} minutes"
msgstr "{}:{} Minuten"
#: mcg/widgets.py:1279 mcg/widgets.py:1620
#: mcg/widgets.py:1285 mcg/widgets.py:1626
msgid "cancel"
msgstr "abbrechen"
#: mcg/widgets.py:1296 mcg/widgets.py:1637
#: mcg/widgets.py:1302 mcg/widgets.py:1643
msgid "play"
msgstr "abspielen"
#: mcg/widgets.py:1299
#: mcg/widgets.py:1305
msgid "remove"
msgstr "entfernen"
#: mcg/widgets.py:1623 mcg/widgets.py:1640
#: mcg/widgets.py:1629 mcg/widgets.py:1646
msgid "queue"
msgstr "einreihen"
#: mcg/widgets.py:1872
#: mcg/widgets.py:1878
msgid "Loading albums"
msgstr "Alben werden geladen"
#: mcg/widgets.py:1954
#: mcg/widgets.py:1960
msgid "Loading images"
msgstr "Bilder werden geladen"

Binary file not shown.

View file

@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Project-Id-Version: CoverGrid (mcg)\n"
"POT-Creation-Date: 2020-03-22 11:18+0100\n"
"PO-Revision-Date: 2020-03-22 11:18+0100\n"
"POT-Creation-Date: 2020-07-25 14:16+0200\n"
"PO-Revision-Date: 2020-07-25 14:17+0200\n"
"Last-Translator: coderkun <olli@suruatoel.xyz>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Generator: Poedit 2.3.1\n"
"X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SearchPath-0: data/gtk.glade\n"
@ -61,127 +61,127 @@ msgstr "Connect to MPD"
msgid "Show the cover in fullscreen mode"
msgstr "Show the cover in fullscreen mode"
#: data/gtk.glade:470 data/gtk.glade:549
#: data/gtk.glade:469 data/gtk.glade:548
msgid "Select multiple albums"
msgstr "Select multiple albums"
#: data/gtk.glade:492 data/gtk.shortcuts.ui:88
#: data/gtk.glade:491 data/gtk.shortcuts.ui:88
msgid "Clear the playlist"
msgstr "Clear the playlist"
#: data/gtk.glade:526 data/gtk.shortcuts.ui:114
#: data/gtk.glade:525 data/gtk.shortcuts.ui:114
msgid "Search the library"
msgstr "Search the library"
#: data/gtk.glade:571
#: data/gtk.glade:570
msgid "Settings and actions"
msgstr "Settings and actions"
#: data/gtk.glade:676
#: data/gtk.glade:675
msgid "Enter hostname or IP address"
msgstr "Enter hostname or IP address"
#: data/gtk.glade:688
#: data/gtk.glade:687
msgid "Enter URL or local path"
msgstr "Enter URL or local path"
#: data/gtk.glade:701
#: data/gtk.glade:700
msgid "Enter password or leave blank"
msgstr "Enter password or leave blank"
#: data/gtk.glade:729
#: data/gtk.glade:728
msgid "Host:"
msgstr "Host:"
#: data/gtk.glade:741
#: data/gtk.glade:740
msgid "Port:"
msgstr "Port:"
#: data/gtk.glade:753
#: data/gtk.glade:752
msgid "Password:"
msgstr "Password:"
#: data/gtk.glade:765
#: data/gtk.glade:764
msgid "Image Directory:"
msgstr "Image Directory:"
#: data/gtk.glade:866
#: data/gtk.glade:865
msgid "File:"
msgstr "File:"
#: data/gtk.glade:879
#: data/gtk.glade:878
msgid "Audio:"
msgstr "Audio:"
#: data/gtk.glade:892
#: data/gtk.glade:891
msgid "Bitrate:"
msgstr "Bitrate:"
#: data/gtk.glade:905
#: data/gtk.glade:904
msgid "Error:"
msgstr "Error:"
#: data/gtk.glade:917 data/gtk.glade:933 data/gtk.glade:949 data/gtk.glade:965
#: data/gtk.glade:916 data/gtk.glade:932 data/gtk.glade:948 data/gtk.glade:964
msgid "<i>none</i>"
msgstr "<i>none</i>"
#: data/gtk.glade:1000
#: data/gtk.glade:999
msgid "Status"
msgstr "Status"
#: data/gtk.glade:1085
#: data/gtk.glade:1084
msgid "Albums"
msgstr "Albums"
#: data/gtk.glade:1097
#: data/gtk.glade:1096
msgid "Songs"
msgstr "Songs"
#: data/gtk.glade:1109
#: data/gtk.glade:1108
msgid "Artists"
msgstr "Artists"
#: data/gtk.glade:1133
#: data/gtk.glade:1132
msgid "Seconds"
msgstr "Seconds"
#: data/gtk.glade:1180
#: data/gtk.glade:1179
msgid "Seconds played"
msgstr "Seconds"
#: data/gtk.glade:1191
#: data/gtk.glade:1190
msgid "Seconds running"
msgstr "Seconds running"
#: data/gtk.glade:1222
#: data/gtk.glade:1221
msgid "Statistics"
msgstr "Statistics"
#: data/gtk.glade:1292
#: data/gtk.glade:1291
msgid "Audio Devices"
msgstr "Audio Devices"
#: data/gtk.glade:1306
#: data/gtk.glade:1305
msgid "Server"
msgstr "Server"
#: data/gtk.glade:1487 data/gtk.menu.ui:30
#: data/gtk.glade:1486 data/gtk.menu.ui:35
msgid "Cover"
msgstr "Cover"
#: data/gtk.glade:1629 data/gtk.menu.ui:36
#: data/gtk.glade:1628 data/gtk.menu.ui:41
msgid "Playlist"
msgstr "Playlist"
#: data/gtk.glade:1656
#: data/gtk.glade:1655
msgid "search library"
msgstr "search library"
#: data/gtk.glade:1881 data/gtk.menu.ui:42
#: data/gtk.glade:1880 data/gtk.menu.ui:47
msgid "Library"
msgstr "Library"
#: data/gtk.glade:1964
#: data/gtk.glade:1963
msgid ""
"CoverGrid is a client for the Music Player Daemon, focusing on albums "
"instead of single tracks."
@ -201,19 +201,23 @@ msgstr "Play"
msgid "Clear Playlist"
msgstr "Clear Playlist"
#: data/gtk.menu.ui:24
#: data/gtk.menu.ui:22
msgid "Toggle Fullscreen"
msgstr "Toggle fullscreen"
#: data/gtk.menu.ui:29
msgid "Connection"
msgstr "Connection"
#: data/gtk.menu.ui:50
#: data/gtk.menu.ui:55
msgid "Keyboard Shortcuts"
msgstr "Keyboard Shortcuts"
#: data/gtk.menu.ui:55
#: data/gtk.menu.ui:60
msgid "Info"
msgstr "Info"
#: data/gtk.menu.ui:60
#: data/gtk.menu.ui:65
msgid "Quit"
msgstr "Quit"
@ -269,27 +273,27 @@ msgstr "{} feat. {}"
msgid "{}:{} minutes"
msgstr "{}:{} minutes"
#: mcg/widgets.py:1279 mcg/widgets.py:1620
#: mcg/widgets.py:1285 mcg/widgets.py:1626
msgid "cancel"
msgstr "cancel"
#: mcg/widgets.py:1296 mcg/widgets.py:1637
#: mcg/widgets.py:1302 mcg/widgets.py:1643
msgid "play"
msgstr "play"
#: mcg/widgets.py:1299
#: mcg/widgets.py:1305
msgid "remove"
msgstr "remove"
#: mcg/widgets.py:1623 mcg/widgets.py:1640
#: mcg/widgets.py:1629 mcg/widgets.py:1646
msgid "queue"
msgstr "queue"
#: mcg/widgets.py:1872
#: mcg/widgets.py:1878
msgid "Loading albums"
msgstr "Loading albums"
#: mcg/widgets.py:1954
#: mcg/widgets.py:1960
msgid "Loading images"
msgstr "Loading images"

View file

@ -230,6 +230,10 @@ class Window():
self._panel_action.set_enabled(False)
self._panel_action.connect('change-state', self.on_menu_panel)
self._appwindow.add_action(self._panel_action)
self._toggle_fullscreen_action = Gio.SimpleAction.new("toggle-fullscreen", None)
self._toggle_fullscreen_action.set_enabled(True)
self._toggle_fullscreen_action.connect('activate', self.on_menu_toggle_fullscreen)
self._appwindow.add_action(self._toggle_fullscreen_action)
def get(self):
@ -269,6 +273,14 @@ class Window():
self._stack.set_visible_child(self._panels[int(value.get_string())].get())
def on_menu_toggle_fullscreen(self, action, value):
self._stack.set_visible_child(self._panels[Window._PANEL_INDEX_COVER].get())
if not self._state.get_property(WindowState.IS_FULLSCREENED):
self._appwindow.fullscreen()
else:
self._appwindow.unfullscreen()
# HeaderBar callbacks
def on_header_bar_stack_switched(self, widget):
@ -1029,7 +1041,6 @@ class CoverPanel(GObject.GObject):
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,
@ -1037,10 +1048,6 @@ class CoverPanel(GObject.GObject):
}
def on_fullscreen_clicked(self, widget):
self.emit('toggle-fullscreen')
def on_cover_box_pressed(self, widget, event):
if self._current_album and event.type == Gdk.EventType._2BUTTON_PRESS:
self.emit('toggle-fullscreen')