Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
resize_handle.h File Reference
#include <gtk/gtk.h>
+ Include dependency graph for resize_handle.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* dtgtk_resize_handle_resize_f) (int requested_size, gboolean finished, gpointer user_data)
 

Functions

GtkWidgetdtgtk_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.
 

Variables

G_BEGIN_DECLS typedef int(* dtgtk_resize_handle_get_size_f )(gpointer user_data)
 

Typedef Documentation

◆ dtgtk_resize_handle_resize_f

typedef int(* dtgtk_resize_handle_resize_f) (int requested_size, gboolean finished, gpointer user_data)

Apply requested_size to the target and return the size actually adopted (the caller clamps). finished is FALSE for each motion sample and TRUE on button release.

Definition at line 38 of file resize_handle.h.

Function Documentation

◆ 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.

Parameters
invertWhen 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().

Variable Documentation

◆ dtgtk_resize_handle_get_size_f

G_BEGIN_DECLS typedef int(* dtgtk_resize_handle_get_size_f) (gpointer user_data) ( gpointer  user_data)

Current size of the resized target, along the axis the handle drags.

Definition at line 34 of file resize_handle.h.