Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy plugin icon customization #2196

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pupil_src/launchables/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def player(
)

assert parse_version(pyglui_version) >= parse_version(
"1.30.0"
"1.31.0"
), "pyglui out of date, please upgrade to newest version"

process_was_interrupted = False
Expand Down
2 changes: 1 addition & 1 deletion pupil_src/launchables/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def detection_enabled_setter(value: int):
from pyglui import ui, cygl, __version__ as pyglui_version

assert parse_version(pyglui_version) >= parse_version(
"1.30.0"
"1.31.0"
), "pyglui out of date, please upgrade to newest version"
from pyglui.cygl.utils import Named_Texture
import gl_utils
Expand Down
11 changes: 11 additions & 0 deletions pupil_src/shared_modules/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ class Plugin(object):
# or custom loaded font name
icon_font = "roboto"
icon_chr = "?" # character shown in menu icon
# icon placement and sizing:
# icon_pos_delta: (x, y) offset relative to default position
# icon_size_delta: negative values decrease font size, positive values increase it
# icon_line_height: distance between lines, only relevant for multi-line labels
icon_pos_delta = (0, 0)
icon_size_delta = 0
icon_line_height = 1.0

def __init__(self, g_pool):
self.g_pool = g_pool
Expand Down Expand Up @@ -288,6 +295,10 @@ def close():
self.menu,
label=self.icon_chr,
label_font=self.icon_font,
label_offset_size=self.icon_size_delta,
label_offset_x=self.icon_pos_delta[0],
label_offset_y=self.icon_pos_delta[1],
label_line_height=self.icon_line_height,
on_val=False,
off_val=True,
setter=toggle_menu,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ opencv-python==3.* ; platform_system == "Windows"
pupil-apriltags==1.0.4
pupil-detectors==2.0.*
pye3d==0.2.0
pyglui>=1.30.0
pyglui>=1.31.0

# pupil-labs/PyAV 0.4.6
av @ git+https://github.com/pupil-labs/PyAV@v0.4.6 ; platform_system != "Windows"
Expand Down