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@gmail.com>2019-03-14 19:10:47 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-14 20:59:11 +0300
commitf3a3d74bcfb0d7a5af1320b9398cddcb4d0d9f9b (patch)
tree99927bbeff543cf79558c6a72065ef8e4d2d77f3 /source/blender
parent55e79d8f36c602f08a4588f697606b5a9eb55a4c (diff)
Fix T62425: topbar showing wrong buttons at some UI scales.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/screen/screen_edit.c11
-rw-r--r--source/blender/makesdna/DNA_screen_types.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index e5d23457daf..cd5b557f986 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -794,10 +794,15 @@ static void screen_global_area_refresh(
}
}
+static int screen_global_header_size(void)
+{
+ return (int)ceilf(ED_area_headersize() / UI_DPI_FAC);
+}
+
static void screen_global_topbar_area_refresh(wmWindow *win, bScreen *screen)
{
- const short size_min = HEADERY;
- const short size_max = 2.25 * HEADERY;
+ const short size_min = screen_global_header_size();
+ const short size_max = 2.25 * screen_global_header_size();
const short size = (screen->flag & SCREEN_COLLAPSE_TOPBAR) ? size_min : size_max;
rcti rect;
@@ -810,7 +815,7 @@ static void screen_global_topbar_area_refresh(wmWindow *win, bScreen *screen)
static void screen_global_statusbar_area_refresh(wmWindow *win, bScreen *screen)
{
const short size_min = 1;
- const short size_max = 0.8f * HEADERY;
+ const short size_max = 0.8f * screen_global_header_size();
const short size = (screen->flag & SCREEN_COLLAPSE_STATUSBAR) ? size_min : size_max;
rcti rect;
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index c62aed7402b..6121ff322f9 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -286,8 +286,7 @@ typedef struct ScrGlobalAreaData {
* and winx/winy don't) */
short cur_fixed_height;
/* For global areas, this is the min and max size they can use depending on
- * if they are 'collapsed' or not. Value is set on area creation and not
- * touched afterwards. */
+ * if they are 'collapsed' or not. */
short size_min, size_max;
/** GlobalAreaAlign. */
short align;