Skip to content

Improve default font, mouse, and line thickness scaling on macOS #228

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/screencast_keys/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# <pep8 compliant>


import platform
import bpy
from bpy.props import (
StringProperty,
Expand All @@ -33,6 +34,8 @@
from . import common
from . import c_structure as cstruct # extensions.blender.org: Delete line

is_macos = platform.system() == 'Darwin'


# extensions.blender.org: Delete block start
@BlClassRegistry()
Expand Down Expand Up @@ -228,9 +231,12 @@ class SK_Preferences(bpy.types.AddonPreferences):
max=100,
)

# Increase default font size on macOS (Retina) for better visibility
font_size: bpy.props.IntProperty(
name="Font Size",
default=int(bpy.context.preferences.ui_styles[0].widget.points),
default=int(
bpy.context.preferences.ui_styles[0].widget.points
* (5 if is_macos else 1)),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing font_size is not good idea because this configuration should be constraint in user side.
Instead, we can change the scale before feeding the font_size to API.
This is same for others.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi nutti, thank you for your suggestion! My quarter is about to end, and I will fix this the next few days!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JingRyu
Thank you. It's ok to me.
If you have any help, please let me know.

min=6,
max=1000
)
Expand All @@ -243,16 +249,20 @@ class SK_Preferences(bpy.types.AddonPreferences):
max=1000
)

# Increase default line thickness on macOS (Retina) for better visibility
line_thickness: bpy.props.FloatProperty(
name="Line Thickness",
default=1,
default=1 * (4 if is_macos else 1),
min=1,
max=100
)

# Increase default mouse size on macOS (Retina) for better visibility
mouse_size: bpy.props.IntProperty(
name="Mouse Size",
default=int(bpy.context.preferences.ui_styles[0].widget.points * 3),
default=int(
bpy.context.preferences.ui_styles[0].widget.points * 3
* (4 if is_macos else 1)),
min=18,
max=1000,
)
Expand Down
Loading