UI: Asset Shelf (Experimental Feature) #104831

Closed
Julian Eisel wants to merge 399 commits from asset-shelf into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 14 additions and 5 deletions
Showing only changes of commit 852becd76c - Show all commits

View File

@ -83,6 +83,7 @@ void ED_asset_shelf_region_listen(const wmRegionListenerParams *params)
void ED_asset_shelf_region_init(wmWindowManager *wm, ARegion *region)
{
ED_region_panels_init(wm, region);
region->v2d.page_size_y = ED_asset_shelf_default_tile_height();
}
static constexpr int main_region_padding_y_not_scaled()

View File

@ -504,8 +504,10 @@ static int view_scrolldown_exec(bContext *C, wmOperator *op)
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "page");
if (RNA_property_is_set(op->ptr, prop) && RNA_property_boolean_get(op->ptr, prop)) {
ARegion *region = CTX_wm_region(C);
RNA_int_set(op->ptr, "deltay", region->v2d.mask.ymin - region->v2d.mask.ymax);
const ARegion *region = CTX_wm_region(C);
const int page_size = vpd->v2d->page_size_y ? -region->v2d.page_size_y :
region->v2d.mask.ymin - region->v2d.mask.ymax;
RNA_int_set(op->ptr, "deltay", page_size);
}
/* apply movement, then we're done */
@ -555,8 +557,10 @@ static int view_scrollup_exec(bContext *C, wmOperator *op)
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "page");
if (RNA_property_is_set(op->ptr, prop) && RNA_property_boolean_get(op->ptr, prop)) {
ARegion *region = CTX_wm_region(C);
RNA_int_set(op->ptr, "deltay", BLI_rcti_size_y(&region->v2d.mask));
const ARegion *region = CTX_wm_region(C);
const int page_size = vpd->v2d->page_size_y ? region->v2d.page_size_y :
BLI_rcti_size_y(&region->v2d.mask);
RNA_int_set(op->ptr, "deltay", page_size);
}
/* apply movement, then we're done */

View File

@ -58,7 +58,11 @@ typedef struct View2D {
/* Usually set externally (as in, not in view2d files). */
/** Alpha of vertical and horizontal scroll-bars (range is [0, 255]). */
char alpha_vert, alpha_hor;
char _pad[6];
char _pad[2];
/** When set (not 0), determines how many pixels to scroll when scrolling an entire page.
* Otherwise the height of #View2D.mask is used. */
float page_size_y;
/* animated smooth view */
struct SmoothView2DStore *sms;