WE ARE VICTORIOUS
Also known as we got the icon working
This commit is contained in:
@@ -106,6 +106,10 @@ class SublimeMusicApp(Gtk.Application):
|
||||
self.window.present()
|
||||
return
|
||||
|
||||
# Configure Icons
|
||||
icon_dir = Path(__file__).parent.joinpath("ui", "icons")
|
||||
Gtk.IconTheme.get_default().append_search_path(str(icon_dir))
|
||||
|
||||
# Windows are associated with the application when the last one is
|
||||
# closed the application shuts down.
|
||||
self.window = MainWindow(application=self, title="Sublime Music")
|
||||
@@ -492,7 +496,7 @@ class SublimeMusicApp(Gtk.Application):
|
||||
):
|
||||
if settings := state_updates.get("__settings__"):
|
||||
for k, v in settings.items():
|
||||
print('SET', k, v)
|
||||
print("SET", k, v)
|
||||
setattr(self.app_config, k, v)
|
||||
del state_updates["__settings__"]
|
||||
|
||||
|
@@ -76,7 +76,6 @@ class IconMenuButton(Gtk.MenuButton):
|
||||
def __init__(
|
||||
self,
|
||||
icon_name: Optional[str] = None,
|
||||
icon_image_filename: Optional[str] = None,
|
||||
tooltip_text: str = "",
|
||||
relief: bool = False,
|
||||
icon_size: Gtk.IconSize = Gtk.IconSize.BUTTON,
|
||||
@@ -97,12 +96,6 @@ class IconMenuButton(Gtk.MenuButton):
|
||||
if icon_name:
|
||||
self.image.set_from_icon_name(icon_name, self.icon_size)
|
||||
box.add(self.image)
|
||||
elif icon_image_filename:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
icon_image_filename, -1, 16, True,
|
||||
)
|
||||
self.image.set_from_pixbuf(pixbuf)
|
||||
box.add(self.image)
|
||||
|
||||
if label is not None:
|
||||
box.add(Gtk.Label(label=label))
|
||||
|
1
sublime/ui/icons/server-subsonic-error-symbolic.svg
Normal file
1
sublime/ui/icons/server-subsonic-error-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"> <path fill="#e4e4e4" d="M6.93 2.13v.04h-.08l-1.39.26c-.15.04-.22.2-.22.38l.22 4.39c0 .22.16.37.34.34l1.69-.57c.11-.03.19-.18.15-.37l-.49-4.17c0-.18-.11-.3-.22-.3zm4.65 4.54c-1.35 0-2.25 0-3.49.68l-2.32.82c-.15.04-.23.19-.27.34a3.6 3.6 0 00-.15 2.1 24 24 0 00-1.46.75c-.45-.71-1.87-.64-1.87.37-.08.5-.42 1.2.22 1.47.3.37-.53.75-.68 1.16-.15.37-.22.75-.7.68-.5.18-.72.63-.34 1.04.37.3 1 0 .9.68.07.49.4.97.6 1.35-.45.37-.38.98-.72 1.43-.26.56.15 1.27.83 1.12a4.73 4.73 0 002.02-.75c3 .82 6.03 1.75 9.13 1.92a6.1 6.1 0 01-.86-4.97l-.02-.21c0-1.02.19-1.62.83-2.25.26-.27.64-.43 1.04-.52a6.1 6.1 0 013.97-1.5 6.01 6.01 0 015.43 3.43 5.5 5.5 0 00-.36-1.94c-.52-1.42-1.87-2.51-3.15-3.26-.75-.38-1.72-.41-2.54-.53l-.27-1.27c.11-.68-.64-.6-1.12-.75l-2.03-.34c-.48-.67-1.87-1.05-2.62-1.05zM5.9 13.05c.38.03.57.67.57 1.83 0 1.1-.23 1.77-.75 2.25-.38.34-.6.3-.83-.18-.45-1.05-.22-2.89.41-3.57.23-.22.42-.37.6-.33zm3.72.22c.56 0 .86.6.93 1.77.04 1.3-.26 2.2-.97 2.73-.34.23-.75.34-.97.23-.3-.12-.64-.98-.68-1.7-.11-1.38.41-2.58 1.27-2.92.13-.06.27-.1.42-.1z"/> <path class="error" fill="#c70e0e" d="M18.2 13.17A5.23 5.23 0 0013 18.4a5.23 5.23 0 005.24 5.24 5.23 5.23 0 005.23-5.24 5.23 5.23 0 00-5.23-5.23 5.23 5.23 0 00-.04 0zM16 14.85l2.24 2.24 2.24-2.24 1.31 1.3-2.24 2.25 2.24 2.25-1.3 1.3-2.25-2.24L16 21.96l-1.31-1.31 2.24-2.25-2.24-2.24z"/></svg>
|
After Width: | Height: | Size: 1.4 KiB |
1
sublime/ui/icons/server-subsonic-symbolic.svg
Normal file
1
sublime/ui/icons/server-subsonic-symbolic.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"> <path fill="#e4e4e4" d="M6.93 2.17h-.08l-1.39.26c-.15.04-.22.2-.22.38l.22 4.39c0 .22.15.37.34.33l1.69-.56c.11-.04.19-.19.15-.37l-.49-4.17c0-.18-.11-.3-.22-.3zm4.65 4.5c-1.35 0-2.25 0-3.49.68l-2.33.82c-.15.04-.22.19-.26.34a3.6 3.6 0 00-.15 2.1 24 24 0 00-1.46.75c-.45-.71-1.88-.64-1.88.37-.07.5-.4 1.2.23 1.47.3.37-.53.75-.68 1.16-.15.37-.22.75-.7.67-.5.2-.72.64-.35 1.05.38.3 1.02 0 .9.68.08.49.42.97.6 1.35-.45.37-.37.97-.7 1.42-.27.57.14 1.28.82 1.13a4.72 4.72 0 002.02-.75c3.83 1.05 7.69 2.29 11.7 1.87 2.78-.18 5.81-1.23 7.28-3.75.71-1.27.67-2.88.18-4.16-.52-1.42-1.87-2.51-3.15-3.26-.75-.38-1.72-.41-2.55-.53l-.26-1.27c.11-.68-.64-.6-1.12-.75l-2.03-.34c-.49-.67-1.87-1.05-2.62-1.05zM5.9 13.05c.38.03.57.67.57 1.83 0 1.1-.23 1.77-.75 2.25-.38.34-.6.3-.83-.18-.45-1.05-.22-2.9.41-3.57.23-.22.42-.37.6-.33zm3.72.22c.56 0 .86.6.93 1.76.04 1.32-.26 2.22-.97 2.74-.34.23-.75.34-.98.23-.3-.12-.63-.98-.67-1.7-.11-1.38.41-2.58 1.27-2.92a1.13 1.13 0 01.42-.1zm5.13.53c.6 0 1.17.18 1.47.63.3.57.41 1.8.22 2.48a3.41 3.41 0 01-1.16 1.72c-.6.38-1.65.45-2.1.12-.56-.45-.75-1.05-.79-2.1 0-1.02.19-1.62.83-2.25.37-.38.97-.57 1.53-.6z"/></svg>
|
After Width: | Height: | Size: 1.2 KiB |
@@ -203,8 +203,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
# Server icon and change server dropdown
|
||||
self.server_connection_popover = self._create_server_connection_popover()
|
||||
self.server_connection_menu_button = IconMenuButton(
|
||||
name="server-connection-icon",
|
||||
icon_image_filename="/home/sumner/tmp/server-subsonic-symbolic.svg",
|
||||
"server-subsonic-error-symbolic",
|
||||
tooltip_text="Server connection settings",
|
||||
popover=self.server_connection_popover,
|
||||
)
|
||||
|
Reference in New Issue
Block a user