UI: Corrected Scaling of AREAMINX

Minimum horizontal area size should be scaled by UI resolution.

See D15865 for more details.

Differential Revision: https://developer.blender.org/D15865

Reviewed by Brecht Van Lommel
This commit is contained in:
2022-09-05 10:37:15 -07:00
parent 258d385857
commit d26a0be968
4 changed files with 5 additions and 6 deletions

View File

@@ -284,7 +284,7 @@ short screen_geom_find_area_split_point(const ScrArea *area,
{
const int cur_area_width = screen_geom_area_width(area);
const int cur_area_height = screen_geom_area_height(area);
const short area_min_x = AREAMINX;
const short area_min_x = AREAMINX * U.dpi_fac;
const short area_min_y = ED_area_headersize();
/* area big enough? */

View File

@@ -1639,7 +1639,7 @@ static void area_move_set_limits(wmWindow *win,
}
}
else {
int areamin = AREAMINX;
int areamin = AREAMINX * U.dpi_fac;
if (area->v1->vec.x > window_rect.xmin) {
areamin += U.pixelsize;
@@ -2062,7 +2062,7 @@ static bool area_split_allowed(const ScrArea *area, const eScreenAxis dir_axis)
return false;
}
if ((dir_axis == SCREEN_AXIS_V && area->winx <= 2 * AREAMINX) ||
if ((dir_axis == SCREEN_AXIS_V && area->winx <= 2 * AREAMINX * U.dpi_fac) ||
(dir_axis == SCREEN_AXIS_H && area->winy <= 2 * ED_area_headersize())) {
/* Must be at least double minimum sizes to split into two. */
return false;

View File

@@ -978,8 +978,7 @@ void ED_spacetype_buttons(void)
/* regions: navigation bar */
art = MEM_callocN(sizeof(ARegionType), "spacetype nav buttons region");
art->regionid = RGN_TYPE_NAV_BAR;
art->prefsizex = AREAMINX - 3; /* XXX Works and looks best,
* should we update AREAMINX accordingly? */
art->prefsizex = AREAMINX;
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES | ED_KEYMAP_NAVBAR;
art->init = buttons_navigation_bar_region_init;
art->draw = buttons_navigation_bar_region_draw;

View File

@@ -539,7 +539,7 @@ enum {
};
#define AREAGRID 4
#define AREAMINX 32
#define AREAMINX 29
#define HEADER_PADDING_Y 6
#define HEADERY (20 + HEADER_PADDING_Y)