Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilem Duha <vilem.duha@gmail.com>2019-04-29 22:30:11 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-05-19 16:45:48 +0300
commit5412d45d9e682d0b8fe8437b735ee06979e34f02 (patch)
tree21deadffbf446aad4c7dd314ce1581a3d445d040 /blenderkit/ui.py
parente16c55a110a5cde3bf5c83a156195b5d71481488 (diff)
BlenderKit:
-fix arrows not showing on the right side when the search results can be increased still. -improve tasks_queue. It's now hanging on another blender object(panel definition) to have persistent task queue. -get separate Author info (should also get Gravatar in future) -get Profile info in fetch server data -new Profile panel shows user information -improve tooltip - random tips, author info(will be further improved) -improve login UI - fix swapping of search results
Diffstat (limited to 'blenderkit/ui.py')
-rw-r--r--blenderkit/ui.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index b0ac9209..e26b24ab 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -493,6 +493,7 @@ def draw_callback_2d_search(self, context):
# background of asset bar
if not ui_props.dragging:
search_results = s.get('search results')
+ search_results_orig = s.get('search results orig')
if search_results == None:
return
h_draw = min(ui_props.hcount, math.ceil(len(search_results) / ui_props.wcount))
@@ -524,7 +525,7 @@ def draw_callback_2d_search(self, context):
ui_props.thumb_size,
img,
1)
- if len(search_results) - ui_props.scrolloffset > (ui_props.wcount * ui_props.hcount):
+ if search_results_orig['count'] - ui_props.scrolloffset > (ui_props.wcount * ui_props.hcount):
if ui_props.active_index == -1:
ui_bgl.draw_rect(ui_props.bar_x + ui_props.bar_width - 25,
ui_props.bar_y - ui_props.bar_height, 25,
@@ -913,8 +914,8 @@ class AssetBarOperator(bpy.types.Operator):
default="", options={'SKIP_SAVE'})
def search_more(self):
- sro = bpy.context.scene.get('search results orig', {})
- if sro.get('next') != None:
+ sro = bpy.context.scene.get('search results orig')
+ if sro is not None and sro.get('next') is not None:
search.search(get_next=True)
def exit_modal(self):
@@ -1311,6 +1312,13 @@ class AssetBarOperator(bpy.types.Operator):
else:
return {'RUNNING_MODAL'}
+ if event.type == 'A' and ui_props.active_index != -3:
+ sr = bpy.context.scene['search results']
+ asset_data = sr[ui_props.active_index]
+ a = bpy.context.window_manager['bkit authors'].get(asset_data['author_id'])
+ if a is not None:
+ if a.get('aboutMeUrl') is not None:
+ bpy.ops.wm.url_open(url=a['aboutMeUrl'])
if event.type == 'X' and ui_props.active_index != -3:
sr = bpy.context.scene['search results']
asset_data = sr[ui_props.active_index]