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:
authorHarley Acheson <harley.acheson@gmail.com>2022-06-27 16:45:49 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-06-27 16:46:29 +0300
commit6243972319289d86c70ce9946d10909e7eddfdaf (patch)
treeeb97c7a34dc100b515ab6be74c71c4b85d9494a4 /source/blender/editors/include/UI_view2d.h
parent279e7dac7dcfc0a7d4126c55a23a745362c293dc (diff)
UI: Scrollbar Behavior Changes
Changes to scrollbars so that they are always visible, but thin and dim, and widen and become more visible as your mouse approaches. See D6505 for details and examples. Differential Revision: https://developer.blender.org/D6505 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/include/UI_view2d.h')
-rw-r--r--source/blender/editors/include/UI_view2d.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index 23dbd3ed36f..5c4eb254462 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -49,8 +49,21 @@ enum eView2D_CommonViewTypes {
/* ------ Defines for Scrollers ----- */
/** Scroll bar area. */
-#define V2D_SCROLL_HEIGHT (0.45f * U.widget_unit)
-#define V2D_SCROLL_WIDTH (0.45f * U.widget_unit)
+
+/* Maximum has to include outline which varies with line width. */
+#define V2D_SCROLL_HEIGHT ((0.45f * U.widget_unit) + (2.0f * U.pixelsize))
+#define V2D_SCROLL_WIDTH ((0.45f * U.widget_unit) + (2.0f * U.pixelsize))
+
+/* Alpha of scrollbar when at minimum size. */
+#define V2D_SCROLL_MIN_ALPHA (0.4f)
+
+/* Minimum size needs to include outline which varies with line width. */
+#define V2D_SCROLL_MIN_WIDTH ((5.0f * U.dpi_fac) + (2.0f * U.pixelsize))
+
+/* When to start showing the full-width scroller. */
+#define V2D_SCROLL_HIDE_WIDTH (AREAMINX * U.dpi_fac)
+#define V2D_SCROLL_HIDE_HEIGHT (HEADERY * U.dpi_fac)
+
/** Scroll bars with 'handles' used for scale (zoom). */
#define V2D_SCROLL_HANDLE_HEIGHT (0.6f * U.widget_unit)
#define V2D_SCROLL_HANDLE_WIDTH (0.6f * U.widget_unit)
@@ -236,9 +249,13 @@ void UI_view2d_draw_scale_x__frames_or_seconds(const struct ARegion *region,
void UI_view2d_scrollers_calc(struct View2D *v2d,
const struct rcti *mask_custom,
struct View2DScrollers *r_scrollers);
+
/**
* Draw scroll-bars in the given 2D-region.
*/
+void UI_view2d_scrollers_draw_ex(struct View2D *v2d,
+ const struct rcti *mask_custom,
+ bool use_full_hide);
void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom);
/* List view tools. */
@@ -329,8 +346,10 @@ struct View2D *UI_view2d_fromcontext_rwin(const struct bContext *C);
/**
* Get scrollbar sizes of the current 2D view.
* The size will be zero if the view has its scrollbars disabled.
+ *
+ * \param mapped: whether to use view2d_scroll_mapped which changes flags
*/
-void UI_view2d_scroller_size_get(const struct View2D *v2d, float *r_x, float *r_y);
+void UI_view2d_scroller_size_get(const struct View2D *v2d, bool mapped, float *r_x, float *r_y);
/**
* Calculate the scale per-axis of the drawing-area
*