Preferences: tweak themes/addons/keyamps buttons at the top.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 16 Jan 2019 17:42:26 +0000 (18:42 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 17 Jan 2019 10:28:56 +0000 (11:28 +0100)
Make layouts more consistent between them, give more room for search field.
Addon online resources links were removed as the links are dead.

release/scripts/modules/rna_keymap_ui.py
release/scripts/startup/bl_ui/space_userpref.py

index 268bcb6a7bea3d71378af074b5df6c0f4e99a221..cc54a7b01b5189837f7bb55ac75ef558a4ffaaff 100644 (file)
@@ -368,22 +368,14 @@ def draw_keymaps(context, layout):
     kc_active = wm.keyconfigs.active
     spref = context.space_data
 
-    subsplit = layout.split()
-    subcol = subsplit.column()
-
-    col = subcol.column()
-
     # row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
     text = bpy.path.display_name(kc_active.name)
     if not text:
         text = "Blender (default)"
 
-    row = col.row()
-
-    row.operator("wm.keyconfig_import", text="Import...", icon='IMPORT')
-    row.operator("wm.keyconfig_export", text="Export...", icon='EXPORT')
+    split = layout.split(factor=0.6)
 
-    row.separator()
+    row = split.row()
 
     rowsub = row.row(align=True)
 
@@ -391,10 +383,16 @@ def draw_keymaps(context, layout):
     rowsub.operator("wm.keyconfig_preset_add", text="", icon='ADD')
     rowsub.operator("wm.keyconfig_preset_add", text="", icon='REMOVE').remove_active = True
 
+    rowsub = split.row(align=True)
+    rowsub.operator("wm.keyconfig_import", text="Import...", icon='IMPORT')
+    rowsub.operator("wm.keyconfig_export", text="Export...", icon='EXPORT')
+
+    row = layout.row()
+    col = layout.column()
+
     # layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
     # row.operator("wm.keyconfig_remove", text="", icon='X')
-    row.separator()
-    rowsub = row.split(factor=0.33, align=True)
+    rowsub = row.split(factor=0.3, align=True)
     # postpone drawing into rowsub, so we can set alert!
 
     layout.separator()
index 2f2c85eeffce7961c7bc88f4920e60fc9e804db0..3e42b27ffc0a3f50f89495706b588c81dc33789a 100644 (file)
@@ -727,16 +727,17 @@ class USERPREF_PT_theme(Panel):
     def draw(self, _context):
         layout = self.layout
 
-        row = layout.row()
+        split = layout.split(factor=0.6)
+
+        row = split.row(align=True)
+        row.menu("USERPREF_MT_interface_theme_presets", text=USERPREF_MT_interface_theme_presets.bl_label)
+        row.operator("wm.interface_theme_preset_add", text="", icon='ADD')
+        row.operator("wm.interface_theme_preset_add", text="", icon='REMOVE').remove_active = True
 
+        row = split.row(align=True)
         row.operator("wm.theme_install", text="Install...", icon='IMPORT')
         row.operator("ui.reset_default_theme", text="Reset", icon='LOOP_BACK')
 
-        subrow = row.row(align=True)
-        subrow.menu("USERPREF_MT_interface_theme_presets", text=USERPREF_MT_interface_theme_presets.bl_label)
-        subrow.operator("wm.interface_theme_preset_add", text="", icon='ADD')
-        subrow.operator("wm.interface_theme_preset_add", text="", icon='REMOVE').remove_active = True
-
 
 class USERPREF_PT_theme_user_interface(PreferencePanel):
     bl_space_type = 'PREFERENCES'
@@ -1568,41 +1569,12 @@ class USERPREF_PT_keymap(Panel):
 
         # start = time.time()
 
-        col = layout.column()
-
         # Keymap Settings
-        draw_keymaps(context, col)
+        draw_keymaps(context, layout)
 
         # print("runtime", time.time() - start)
 
 
-class USERPREF_MT_addons_online_resources(Menu):
-    bl_label = "Online Resources"
-
-    # menu to open web-pages with addons development guides
-    def draw(self, _context):
-        layout = self.layout
-
-        layout.operator(
-            "wm.url_open", text="Add-ons Catalog", icon='URL',
-        ).url = "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts"
-
-        layout.separator()
-
-        layout.operator(
-            "wm.url_open", text="How to share your add-on", icon='URL',
-        ).url = "http://wiki.blender.org/index.php/Dev:Py/Sharing"
-        layout.operator(
-            "wm.url_open", text="Add-on Guidelines", icon='URL',
-        ).url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons"
-        layout.operator(
-            "wm.url_open", text="API Concepts", icon='URL',
-        ).url = bpy.types.WM_OT_doc_view._prefix + "/info_quickstart.html"
-        layout.operator(
-            "wm.url_open", text="Add-on Tutorial", icon='URL',
-        ).url = bpy.types.WM_OT_doc_view._prefix + "/info_tutorial_addon.html"
-
-
 class USERPREF_PT_addons(Panel):
     bl_space_type = 'PREFERENCES'
     bl_label = "Add-ons"
@@ -1675,15 +1647,16 @@ class USERPREF_PT_addons(Panel):
             for mod in addon_utils.modules(refresh=False)
         ]
 
-        row = layout.row()
+        split = layout.split(factor=0.6)
+
+        row = split.row()
+        row.prop(context.window_manager, "addon_support", expand=True)
+
+        row = split.row(align=True)
         row.operator("wm.addon_install", icon='IMPORT', text="Install...")
         row.operator("wm.addon_refresh", icon='FILE_REFRESH', text="Refresh")
-        row.menu("USERPREF_MT_addons_online_resources", text="Online Resources")
-
-        layout.separator()
 
         row = layout.row()
-        row.prop(context.window_manager, "addon_support", expand=True)
         row.prop(context.window_manager, "addon_filter", text="")
         row.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
 
@@ -2085,7 +2058,6 @@ classes += (
     USERPREF_PT_input_view_fly_walk_gravity,
 
     USERPREF_PT_keymap,
-    USERPREF_MT_addons_online_resources,
     USERPREF_PT_addons,
 
     USERPREF_PT_studiolight_add,