UI: Asset Shelf (Experimental Feature) #104831
|
@ -263,6 +263,13 @@ enum {
|
|||
#define UI_NAVIGATION_REGION_WIDTH UI_COMPACT_PANEL_WIDTH
|
||||
#define UI_NARROW_NAVIGATION_REGION_WIDTH 100
|
||||
|
||||
/* The width of one icon column of the Toolbar. */
|
||||
#define UI_TOOLBAR_COLUMN (1.25f * ICON_DEFAULT_HEIGHT_TOOLBAR)
|
||||
/* The space between the Toolbar and the area's edge. */
|
||||
#define UI_TOOLBAR_MARGIN (0.5f * ICON_DEFAULT_HEIGHT_TOOLBAR)
|
||||
/* Total width of Toolbar showing one icon column. */
|
||||
#define UI_TOOLBAR_WIDTH UI_TOOLBAR_MARGIN + UI_TOOLBAR_COLUMN
|
||||
|
||||
#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
|
||||
|
||||
/* Both these margins should be ignored if the panel doesn't show a background (check
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "ED_screen.h"
|
||||
|
||||
#include "UI_interface.h"
|
||||
#include "UI_interface_icons.h"
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
@ -47,9 +48,8 @@ int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, in
|
|||
/* Using Y axis avoids slight feedback loop when adjusting X. */
|
||||
const float aspect = BLI_rctf_size_y(®ion->v2d.cur) /
|
||||
(BLI_rcti_size_y(®ion->v2d.mask) + 1);
|
||||
const float icon_size = ICON_DEFAULT_HEIGHT_TOOLBAR / aspect;
|
||||
const float column = 1.25f * icon_size;
|
||||
const float margin = 0.5f * icon_size;
|
||||
const float column = UI_TOOLBAR_COLUMN / aspect;
|
||||
const float margin = UI_TOOLBAR_MARGIN / aspect;
|
||||
const float snap_units[] = {
|
||||
column + margin,
|
||||
(2.0f * column) + margin,
|
||||
|
|
|
@ -1135,7 +1135,7 @@ void ED_spacetype_image(void)
|
|||
/* regions: tool(bar) */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype image region");
|
||||
art->regionid = RGN_TYPE_TOOLS;
|
||||
art->prefsizex = 58; /* XXX */
|
||||
art->prefsizex = (int)UI_TOOLBAR_WIDTH;
|
||||
art->prefsizey = 50; /* XXX */
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
||||
art->listener = image_tools_region_listener;
|
||||
|
|
|
@ -1185,7 +1185,7 @@ void ED_spacetype_node()
|
|||
/* regions: toolbar */
|
||||
art = MEM_cnew<ARegionType>("spacetype view3d tools region");
|
||||
art->regionid = RGN_TYPE_TOOLS;
|
||||
art->prefsizex = 58; /* XXX */
|
||||
art->prefsizex = int(UI_TOOLBAR_WIDTH);
|
||||
art->prefsizey = 50; /* XXX */
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
||||
art->listener = node_region_listener;
|
||||
|
|
|
@ -1064,7 +1064,7 @@ void ED_spacetype_sequencer(void)
|
|||
/* Toolbar. */
|
||||
art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer tools region");
|
||||
art->regionid = RGN_TYPE_TOOLS;
|
||||
art->prefsizex = 58; /* XXX */
|
||||
art->prefsizex = (int)UI_TOOLBAR_WIDTH;
|
||||
art->prefsizey = 50; /* XXX */
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
||||
art->message_subscribe = ED_region_generic_tools_region_message_subscribe;
|
||||
|
|
|
@ -2226,7 +2226,7 @@ void ED_spacetype_view3d()
|
|||
/* regions: tool(bar) */
|
||||
art = MEM_cnew<ARegionType>("spacetype view3d tools region");
|
||||
art->regionid = RGN_TYPE_TOOLS;
|
||||
art->prefsizex = 58; /* XXX */
|
||||
art->prefsizex = int(UI_TOOLBAR_WIDTH);
|
||||
art->prefsizey = 50; /* XXX */
|
||||
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
||||
art->listener = view3d_buttons_region_listener;
|
||||
|
|
Loading…
Reference in New Issue