Page MenuHome

Text and icon positioning for scaled buttons

Authored by Aleksandr Zinovev (raa) on Dec 16 2016, 6:07 PM.



Before and After:

Looks like Blender has several icon types. But I never saw scaled icons on basic buttons (icon on the left and the text on the right). So i hope this patch won't break anything.

You can test the patch in Blender's text editor.
Open the side panel, paste the code and press Run Script button:

import bpy

class TestPanel(bpy.types.Panel):
    bl_label = "Test Panel"
    bl_space_type = 'TEXT_EDITOR'
    bl_region_type = 'UI'
    def draw(self, context):
        layout = self.layout
        row = layout.row(True)
        row.scale_y = 3
        row.alignment = 'LEFT'
        row.operator("ed.undo", icon='X')


Diff Detail

rB Blender

Event Timeline

Aleksandr Zinovev (raa) retitled this revision from to Text and icon positioning for scaled buttons.Dec 16 2016, 6:07 PM
Aleksandr Zinovev (raa) updated this object.
Aleksandr Zinovev (raa) set the repository for this revision to rB Blender.
Aleksandr Zinovev (raa) updated this revision to Diff 8000.

Am not sure about that change… This is an UI design topic actually, do we want to keep icon in bigger buttons same size as default, or do we want them bigger too?

User Interface members shall be interested too?

@Bastien Montagne (mont29), It's a good question.
Blenderartists forums have many questions/requests from users that want to increase icon size for some buttons.
But afaik we cannot use vector icons as a custom icon. So scaled custom icons may look ugly.

My thought is that icons should only adjust sizes with DPI changes. Otherwise UIs (particularly add-on UIs) will very quickly become inconsistent and break visual alignments.