Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-19 00:00:52 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-19 00:00:52 +0400
commit6b2af22d37dc1a039104f2ca0b3b4b56aca7d41c (patch)
treea7546c734d534c7c1bdd9aff61ff01f5d7548e41 /source/blender
parent8168fba97213d985669a6cc37c477590a6b45d01 (diff)
DPI: fix wrong scaling of editor type choosing buttons, and for menu arrows
overlapping or being too close to icons in small buttons.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_widgets.c11
-rw-r--r--source/blender/editors/screen/area.c16
2 files changed, 11 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f003889464e..e5b26148be5 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -566,19 +566,14 @@ static void widget_trias_draw(uiWidgetTrias *tria)
static void widget_menu_trias(uiWidgetTrias *tria, const rcti *rect)
{
- float centx, centy, size, asp;
+ float centx, centy, size;
int a;
/* center position and size */
- centx = rect->xmax - 0.5f * BLI_rcti_size_y(rect);
- centy = rect->ymin + 0.5f * BLI_rcti_size_y(rect);
+ centx = rect->xmax - 0.32f * BLI_rcti_size_y(rect);
+ centy = rect->ymin + 0.50f * BLI_rcti_size_y(rect);
size = 0.4f * (float)BLI_rcti_size_y(rect);
- /* XXX exception */
- asp = ((float)BLI_rcti_size_x(rect)) / ((float)BLI_rcti_size_y(rect));
- if (asp > 1.2f && asp < 2.6f)
- centx = rect->xmax - 0.4f * (float)BLI_rcti_size_y(rect);
-
for (a = 0; a < 6; a++) {
tria->vec[a][0] = size * menu_tria_vert[a][0] + centx;
tria->vec[a][1] = size * menu_tria_vert[a][1] + centy;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 77dc6aa02da..cde94ec46ee 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1545,22 +1545,22 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
{
ScrArea *sa = CTX_wm_area(C);
uiBut *but;
- int xco = 8;
+ int xco = 0.4 * U.widget_unit;
but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
- editortype_pup(), xco, yco, UI_UNIT_X + 10, UI_UNIT_Y,
+ editortype_pup(), xco, yco, 1.5 * U.widget_unit, U.widget_unit,
&(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
TIP_("Display current editor type (click for a menu of available types)"));
uiButSetFunc(but, spacefunc, NULL, NULL);
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
- return xco + UI_UNIT_X + 14;
+ return xco + 1.7 * U.widget_unit;
}
int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
{
ScrArea *sa = CTX_wm_area(C);
- int xco = 8;
+ int xco = 0.4 * U.widget_unit;
uiBut *but;
if (!sa->full)
@@ -1571,14 +1571,14 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
if (sa->flag & HEADER_NO_PULLDOWN) {
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
ICON_DISCLOSURE_TRI_RIGHT,
- xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+ xco, yco, U.widget_unit, U.widget_unit*0.9,
&(sa->flag), 0, 0, 0, 0,
"Show pulldown menus");
}
else {
but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0,
ICON_DISCLOSURE_TRI_DOWN,
- xco, yco, UI_UNIT_X, UI_UNIT_Y - 2,
+ xco, yco, U.widget_unit, U.widget_unit*0.9,
&(sa->flag), 0, 0, 0, 0,
"Hide pulldown menus");
}
@@ -1587,7 +1587,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
uiBlockSetEmboss(block, UI_EMBOSS);
- return xco + UI_UNIT_X;
+ return xco + U.widget_unit;
}
/************************ standard UI regions ************************/
@@ -1638,7 +1638,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
/* for enabled buttons */
panel->layout = uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
- triangle, UI_UNIT_Y + style->panelspace + 2, UI_UNIT_Y, 1, style);
+ triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, style);
pt->draw_header(C, panel);