'Previous', callback=lambda *_: g.client.player_previous(), stock_id='gtk-media-previous' ) self._menu.simple_add( 'Next', callback=lambda *_: g.client.player_next(), stock_id='gtk-media-next' ) self._menu.simple_add( 'Stop', callback=lambda *_: g.client.player_stop(), stock_id='gtk-media-stop' ) # ------------------------------ self._menu.simple_add_separator() self._menu.simple_add( 'Quit', callback=lambda *_: g.gtk_app.quit(), stock_id='gtk-quit' ) if __name__ == '__main__': from moosecat.gtk.runner import main with main() as win: TrayIconController() win.set_no_show_all(True) win.hide()
GLib.idle_add(lambda: self.set_settings_visible(False)) def set_settings_visible(self, visible): alloc = self.get_allocation() if not visible: self.set_position(alloc.width) else: self.set_position(alloc.width / 5 * 3) ################### # Browser Stuff # ################### def get_root_widget(self): return self def get_browser_name(self): return 'Metadata' def get_browser_icon_name(self): return 'media-optical' if __name__ == '__main__': with main(metadata=True) as win: chooser = MetadataBrowser() chooser.do_build() win.set_default_size(1100, 900) win.add(chooser)
""".encode('utf-8')) context = Gtk.StyleContext() context.add_provider_for_screen( Gdk.Screen.get_default(), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER ) if __name__ == '__main__': from moosecat.gtk.runner import main from moosecat.gtk.widgets import BrowserBar from moosecat.gtk.browser.queue import QueuePlaylistWidget def search_changed(entry, query, playlist_widget): playlist_widget.do_search(query) remove_ctrlf() with main(store=True, port=6600) as win: playlist_widget = QueuePlaylistWidget() overlay = FishySearchOverlay() overlay.get_entry().connect( 'search-changed', search_changed, playlist_widget ) overlay.add(playlist_widget) win.add(overlay) win.set_size_request(1000, 500) GLib.timeout_add(500, lambda: overlay.show())
# TODO: sigh, cleanup from moosecat.gtk.metadata import MetadataBrowser browsers.append(MetadataBrowser()) # browsers = g.psys.category('GtkBrowser') # browsers.sort(key=lambda b: b.priority(), reverse=True) for browser in browsers: # Tell them to build their GUI up. browser.do_build() # Render the icon in the style of treeview icon = browser.get_browser_icon_name() # Name right side of Icon display_name = browser.get_browser_name() # Actually append them to the list self.append_page(display_name, browser.get_root_widget(), symbol=icon) def switch_to(self, browser_name): self.set_visible_page(browser_name) if __name__ == '__main__': from moosecat.gtk.runner import main with main(store=True) as win: win.add(BrowserBar())