forked from bartvdbraak/blender
panel headers were not scaling with DPI properly
This commit is contained in:
parent
24292793a0
commit
619df86fad
@ -117,8 +117,8 @@ typedef enum {
|
||||
/* warn: rest of uiBut->flag in UI_interface.h */
|
||||
|
||||
/* internal panel drawing defines */
|
||||
#define PNL_GRID 4
|
||||
#define PNL_HEADER 20
|
||||
#define PNL_GRID (UI_UNIT_Y / 5) /* 4 default */
|
||||
#define PNL_HEADER UI_UNIT_Y /* 20 default */
|
||||
|
||||
/* panel->flag */
|
||||
#define PNL_SELECT 1
|
||||
|
@ -384,7 +384,7 @@ static void ui_draw_x_icon(float x, float y)
|
||||
|
||||
}
|
||||
|
||||
#define PNL_ICON 20
|
||||
#define PNL_ICON UI_UNIT_X /* could be UI_UNIT_Y too */
|
||||
|
||||
static void ui_draw_panel_scalewidget(rcti *rect)
|
||||
{
|
||||
|
@ -1281,11 +1281,11 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
||||
|
||||
if(vertical) {
|
||||
w= v2d->cur.xmax - v2d->cur.xmin;
|
||||
em= (ar->type->prefsizex)? 10: 20;
|
||||
em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
|
||||
}
|
||||
else {
|
||||
w= UI_PANEL_WIDTH;
|
||||
em= (ar->type->prefsizex)? 10: 20;
|
||||
em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
|
||||
}
|
||||
|
||||
x= 0;
|
||||
@ -1309,8 +1309,8 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
|
||||
panel= uiBeginPanel(sa, ar, block, pt, &open);
|
||||
|
||||
/* bad fixed values */
|
||||
header= (pt->flag & PNL_NO_HEADER)? 0: 20;
|
||||
triangle= 22;
|
||||
header= (pt->flag & PNL_NO_HEADER)? 0: UI_UNIT_Y;
|
||||
triangle= (int)(UI_UNIT_Y * 1.1f);
|
||||
|
||||
if(vertical)
|
||||
y -= header;
|
||||
|
@ -185,7 +185,6 @@ float BPY_driver_exec(ChannelDriver *driver)
|
||||
expr_vars= PyTuple_GET_ITEM(((PyObject *)driver->expr_comp), 1);
|
||||
Py_XDECREF(expr_vars);
|
||||
|
||||
/* intern the arg names so creating the namespace for every run is faster */
|
||||
expr_vars= PyTuple_New(BLI_countlist(&driver->variables));
|
||||
PyTuple_SET_ITEM(((PyObject *)driver->expr_comp), 1, expr_vars);
|
||||
|
||||
@ -211,7 +210,7 @@ float BPY_driver_exec(ChannelDriver *driver)
|
||||
|
||||
/* try to add to dictionary */
|
||||
/* if (PyDict_SetItemString(driver_vars, dvar->name, driver_arg)) { */
|
||||
if (PyDict_SetItem(driver_vars, PyTuple_GET_ITEM(expr_vars, i++), driver_arg) < 0) { /* use string interning for faster namespace creation */
|
||||
if (PyDict_SetItem(driver_vars, PyTuple_GET_ITEM(expr_vars, i++), driver_arg) < 0) {
|
||||
/* this target failed - bad name */
|
||||
if (targets_ok) {
|
||||
/* first one - print some extra info for easier identification */
|
||||
|
Loading…
Reference in New Issue
Block a user