panel headers were not scaling with DPI properly
authorCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jun 2011 12:47:17 +0000 (12:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 5 Jun 2011 12:47:17 +0000 (12:47 +0000)
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_panel.c
source/blender/editors/screen/area.c
source/blender/python/intern/bpy_driver.c

index d185e839fdd89f8d576ecc4d4b702b4be4105031..3f3665aae389c2020e3dfb087e45d20c4a2e0f64 100644 (file)
@@ -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
index 42017f749be52fad89d71aeb7661eea63f1a7a18..9ed3cabb4cb203b4bbabd9b82b9b45d51232d045 100644 (file)
@@ -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)
 {
index f37e2618ed4fde058215554463c34300520841d0..05214a63325dbc10945bd4c646c94878ae60a7f0 100644 (file)
@@ -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;
index c154b13914602b18b33d3e0461248880fad1cf5f..dec393bd1e4c5715ea97f8e49ac71c6419fc6b4e 100644 (file)
@@ -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 */