Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
9159fac1
Commit
9159fac1
authored
8 years ago
by
raa
Browse files
Options
Downloads
Patches
Plain Diff
Support new UserPreferencesView.ui_scale property
parent
6448cdbc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
development_icon_get.py
+16
-5
16 additions, 5 deletions
development_icon_get.py
with
16 additions
and
5 deletions
development_icon_get.py
+
16
−
5
View file @
9159fac1
...
...
@@ -23,7 +23,7 @@ bl_info = {
"
name
"
:
"
Icon Viewer
"
,
"
description
"
:
"
Click an icon to copy its name to the clipboard
"
,
"
author
"
:
"
roaoao
"
,
"
version
"
:
(
1
,
3
,
1
),
"
version
"
:
(
1
,
3
,
2
),
"
blender
"
:
(
2
,
75
,
0
),
"
location
"
:
"
Spacebar > Icon Viewer, Text Editor > Properties
"
,
"
wiki_url
"
:
(
...
...
@@ -44,6 +44,9 @@ HISTORY = []
def
ui_scale
():
if
hasattr
(
bpy
.
context
.
user_preferences
.
view
,
"
ui_scale
"
):
return
bpy
.
context
.
user_preferences
.
view
.
ui_scale
ret
=
bpy
.
context
.
user_preferences
.
system
.
dpi
/
DPI
if
bpy
.
context
.
user_preferences
.
system
.
virtual_pixel_mode
==
'
DOUBLE
'
:
ret
*=
2
...
...
@@ -195,10 +198,10 @@ class IV_Preferences(bpy.types.AddonPreferences):
description
=
"
Auto focus input field
"
,
default
=
True
)
show_panel
=
bpy
.
props
.
BoolProperty
(
name
=
"
Show Panel
"
,
description
=
"
Show the panel in Text Editor
"
,
default
=
True
)
description
=
"
Show the panel in
the
Text Editor
"
,
default
=
True
)
show_header
=
bpy
.
props
.
BoolProperty
(
name
=
"
Show Header
"
,
description
=
"
Show the header in Python Console
"
,
description
=
"
Show the header in
the
Python Console
"
,
default
=
True
)
def
draw
(
self
,
context
):
...
...
@@ -421,14 +424,16 @@ class IV_OT_icons_show(bpy.types.Operator):
col
=
self
.
layout
self
.
draw_header
(
col
)
history_num_cols
=
int
(
(
self
.
width
-
POPUP_PADDING
)
/
(
ui_scale
()
*
ICON_SIZE
))
num_cols
=
min
(
self
.
get_num_cols
(
len
(
pr
.
popup_icons
.
filtered_icons
)),
int
((
self
.
width
-
POPUP_PADDING
)
/
(
ui_scale
()
*
ICON_SIZE
))
)
history_num_cols
)
subcol
=
col
.
column
(
True
)
if
HISTORY
and
pr
.
show_history
:
pr
.
popup_icons
.
draw
(
subcol
.
box
(),
num_cols
,
HISTORY
)
pr
.
popup_icons
.
draw
(
subcol
.
box
(),
history_
num_cols
,
HISTORY
)
pr
.
popup_icons
.
draw
(
subcol
.
box
(),
num_cols
)
...
...
@@ -472,8 +477,14 @@ class IV_OT_icons_show(bpy.types.Operator):
def
register
():
if
bpy
.
app
.
background
:
return
bpy
.
utils
.
register_module
(
__name__
)
def
unregister
():
if
bpy
.
app
.
background
:
return
bpy
.
utils
.
unregister_module
(
__name__
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment