[Bf-blender-cvs] [f3a3d74bcfb] master: Fix T62425: topbar showing wrong buttons at some UI scales.

Brecht Van Lommel noreply at git.blender.org
Thu Mar 14 19:01:55 CET 2019


Commit: f3a3d74bcfb0d7a5af1320b9398cddcb4d0d9f9b
Author: Brecht Van Lommel
Date:   Thu Mar 14 17:10:47 2019 +0100
Branches: master
https://developer.blender.org/rBf3a3d74bcfb0d7a5af1320b9398cddcb4d0d9f9b

Fix T62425: topbar showing wrong buttons at some UI scales.

===================================================================

M	source/blender/editors/screen/screen_edit.c
M	source/blender/makesdna/DNA_screen_types.h

===================================================================

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;



More information about the Bf-blender-cvs mailing list