![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/resize_handle.h"#include "widgets/widget_settings.h"#include "system/macros.h"#include <math.h>
Include dependency graph for resize_handle.c:Go to the source code of this file.
Data Structures | |
| struct | dtgtk_resize_handle_t |
Typedefs | |
| typedef struct dtgtk_resize_handle_t | dtgtk_resize_handle_t |
Functions | |
| static gboolean | _resize_handle_cursor (GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) |
| static gboolean | _resize_handle_button (GtkWidget *widget, GdkEventButton *event, gpointer user_data) |
| static gboolean | _resize_handle_motion (GtkWidget *widget, GdkEventMotion *event, gpointer user_data) |
| GtkWidget * | dtgtk_resize_handle_new (GtkOrientation orientation, gboolean invert, const char *tooltip, dtgtk_resize_handle_get_size_f get_size, dtgtk_resize_handle_resize_f resize, gpointer user_data) |
| Create a themed handle widget driving one-dimensional resize gestures. | |
|
static |
Definition at line 59 of file resize_handle.c.
References dtgtk_resize_handle_t::current_size, dtgtk_resize_handle_t::dragging, dt_widget_set_cursor(), FALSE, dtgtk_resize_handle_t::get_size, L, dtgtk_resize_handle_t::orientation, dtgtk_resize_handle_t::resize, dtgtk_resize_handle_t::start_root, dtgtk_resize_handle_t::start_size, TRUE, and dtgtk_resize_handle_t::user_data.
Referenced by dtgtk_resize_handle_new().
|
static |
Definition at line 39 of file resize_handle.c.
References dtgtk_resize_handle_t::dragging, dt_widget_set_cursor(), FALSE, L, dtgtk_resize_handle_t::orientation, and TRUE.
Referenced by dtgtk_resize_handle_new().
|
static |
Definition at line 101 of file resize_handle.c.
References dtgtk_resize_handle_t::current_size, delta, dtgtk_resize_handle_t::dragging, FALSE, dtgtk_resize_handle_t::invert, L, dtgtk_resize_handle_t::orientation, dtgtk_resize_handle_t::resize, dtgtk_resize_handle_t::start_root, dtgtk_resize_handle_t::start_size, TRUE, and dtgtk_resize_handle_t::user_data.
Referenced by dtgtk_resize_handle_new().
| GtkWidget * dtgtk_resize_handle_new | ( | GtkOrientation | orientation, |
| gboolean | invert, | ||
| const char * | tooltip, | ||
| dtgtk_resize_handle_get_size_f | get_size, | ||
| dtgtk_resize_handle_resize_f | resize, | ||
| gpointer | user_data | ||
| ) |
Create a themed handle widget driving one-dimensional resize gestures.
The handle owns the GTK event bookkeeping: hover state, cursor, grab lifetime, drawing and drag delta computation. The caller owns the resized target and keeps that ownership visible through get_size and resize. During pointer motion resize receives finished == FALSE; on button release it receives finished == TRUE so callers can persist the final size without writing settings at every motion sample.
| invert | When FALSE the target grows as the pointer moves in the positive axis direction (down for vertical, right for horizontal) — the natural case for a handle sitting below/at the right of its target. Set TRUE when the target grows in the opposite direction, e.g. a right panel that grows as it is dragged left, or a bottom panel that grows as it is dragged up. |
The grip is meant to be added as an overlay child on the resized widget. It pins itself to the correct edge (from orientation and invert) and tags itself with an edge CSS class (.resize-handle-{top,bottom,left,right}); its thickness and centering live in the stylesheet.
Definition at line 117 of file resize_handle.c.
References _resize_handle_button(), _resize_handle_cursor(), _resize_handle_motion(), DT_PIXEL_APPLY_DPI, get_size(), dtgtk_resize_handle_t::get_size, dtgtk_resize_handle_t::invert, IS_NULL_PTR, L, dtgtk_resize_handle_t::orientation, dtgtk_resize_handle_t::resize, tooltip, and dtgtk_resize_handle_t::user_data.
Referenced by _ui_init_panel_bottom(), _ui_init_panel_left(), _ui_init_panel_right(), dt_ui_resizable_drawing_area(), and dt_ui_scroll_wrap().