Skip to content

Commit 65ee1cf

Browse files
authored
Merge pull request #54 from ImDevinC/add-plugin-icon
feat(icon): Adding icon to plugin view page
2 parents eb7f30f + 6313468 commit 65ee1cf

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

assets/Attribution.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
All images in this folder (and subfolders) are from fonts.google.com and licensed under the Apache License, Version 2.0.
1+
Discord icon provided by Discord from their brand asset pack https://my.corebook.io/1zObrQ89Q4wHhgFCfYIUhMUvmNf4XjxO/02-logo/download
2+
Icons are made by Daisuke88 on Discord
3+
All other images in this folder (and subfolders) are from fonts.google.com and licensed under the Apache License, Version 2.0.
24
You can retrieve a copy of the license at https://www.apache.org/licenses/LICENSE-2.0.
35

4-
Icons are made by Daisuke88 on Discord

assets/Discord-Symbol-Blurple.png

13.5 KB
Loading

main.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
import json
33
import threading
44

5+
from loguru import logger as log
6+
from gi.repository import Gtk
7+
58
# Import StreamController modules
69
from src.backend.PluginManager.PluginBase import PluginBase
710
from src.backend.PluginManager.ActionHolder import ActionHolder
811
from src.backend.DeckManagement.InputIdentifier import Input
912
from src.backend.PluginManager.ActionInputSupport import ActionInputSupport
13+
from src.backend.DeckManagement.ImageHelpers import image2pixbuf
1014

1115
# Import actions
1216
from .settings import PluginSettings
@@ -16,10 +20,12 @@
1620
from .actions.ChangeTextChannel import ChangeTextChannel
1721
from .actions.TogglePTT import TogglePTT
1822

19-
from loguru import logger as log
20-
2123

2224
class PluginTemplate(PluginBase):
25+
def get_selector_icon(self) -> Gtk.Widget:
26+
_, rendered = self.asset_manager.icons.get_asset_values("main")
27+
return Gtk.Image.new_from_pixbuf(image2pixbuf(rendered))
28+
2329
def __init__(self):
2430
super().__init__(use_legacy_locale=False)
2531
self.callbacks = {}
@@ -56,6 +62,8 @@ def __init__(self):
5662
self.setup_backend()
5763

5864
def _add_icons(self):
65+
self.add_icon("main", self.get_asset_path(
66+
"Discord-Symbol-Blurple.png"))
5967
self.add_icon("deafen", self.get_asset_path("deafen.png"))
6068
self.add_icon("undeafen", self.get_asset_path("undeafen.png"))
6169
self.add_icon("mute", self.get_asset_path("mute.png"))

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.6.1",
2+
"version": "1.7.0",
33
"thumbnail": "store/thumbnail.png",
44
"id": "com_imdevinc_StreamControllerDiscordPlugin",
55
"name": "Discord",

0 commit comments

Comments
 (0)