diff options
author | Vilém Duha <vilda.novak@gmail.com> | 2021-05-01 20:09:09 +0300 |
---|---|---|
committer | Vilém Duha <vilda.novak@gmail.com> | 2021-05-01 20:09:09 +0300 |
commit | c12dc2b19968b3e222e5b0c41ea918a8a15c4ad0 (patch) | |
tree | efdaa80347c0927f09e8e75437a902093b0bbc47 /blenderkit/search.py | |
parent | 6dac52a35f3387720da6ca6fd04aa8160819c24e (diff) |
BlenderKit: minor tweaks to asset card layout
- some code cleanup
- labels with tooltips (an empty operator that enables this, drawing it non-emobssed)
Diffstat (limited to 'blenderkit/search.py')
-rw-r--r-- | blenderkit/search.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py index 67a353ac..858f676b 100644 --- a/blenderkit/search.py +++ b/blenderkit/search.py @@ -990,10 +990,10 @@ def build_query_common(query, props): if props.search_keywords != '': query_common["query"] = props.search_keywords - if props.search_verification_status != 'ALL': + if props.search_verification_status != 'ALL' and utils.profile_is_validator(): query_common['verification_status'] = props.search_verification_status.lower() - if props.unrated_only: + if props.unrated_only and utils.profile_is_validator(): query["quality_count"] = 0 if props.search_file_size: @@ -1447,10 +1447,26 @@ class UrlOperator(Operator): bpy.ops.wm.url_open(url=self.url) return {'FINISHED'} +class TooltipLabelOperator(Operator): + """""" + bl_idname = "wm.blenderkit_tooltip" + bl_label = "" + bl_description = "Empty operator to be able to create tooltips on labels in UI" + bl_options = {'REGISTER', 'UNDO', 'INTERNAL'} + + tooltip: bpy.props.StringProperty(default='Open a web page') + + @classmethod + def description(cls, context, properties): + return properties.tooltip + + def execute(self, context): + return {'FINISHED'} classes = [ SearchOperator, - UrlOperator + UrlOperator, + TooltipLabelOperator ] |