![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <gtk/gtk.h>Go to the source code of this file.
Data Structures | |
| struct | dt_gui_widget_auto_height_t |
Typedefs | |
| typedef enum dt_ui_resize_mode_t | dt_ui_resize_mode_t |
| typedef struct dt_gui_widget_auto_height_t | dt_gui_widget_auto_height_t |
Enumerations | |
| enum | { TREE_LIST_MIN_ROWS = 3 , TREE_LIST_MAX_ROWS = 11 } |
| enum | dt_ui_resize_mode_t { DT_UI_RESIZE_DYNAMIC = 0 , DT_UI_RESIZE_STATIC } |
Functions | |
| GtkWidget * | dt_ui_scroll_wrap (GtkWidget *w, gint min_size, const char *config_str, dt_ui_resize_mode_t mode) |
| Wrap a scrollable widget in a recessed, vertically resizable scrolled window with a drag handle. | |
| GtkWidget * | dt_ui_scroll_wrap_get_scrolled_window (GtkWidget *wrapper) |
| Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL. | |
| void | dt_ui_scroll_wrap_reserve_trailing_row (GtkWidget *content_widget) |
| Make a DT_UI_RESIZE_DYNAMIC list or text view ask for one blank row past its content. | |
| GtkWidget * | dt_ui_resizable_drawing_area (GtkWidget *area, char *config_str, int default_height, int min_height) |
| Make a self-drawing widget (typically a GtkDrawingArea graph or scope) vertically resizable. | |
| typedef struct dt_gui_widget_auto_height_t dt_gui_widget_auto_height_t |
| typedef enum dt_ui_resize_mode_t dt_ui_resize_mode_t |
| anonymous enum |
| Enumerator | |
|---|---|
| TREE_LIST_MIN_ROWS | |
| TREE_LIST_MAX_ROWS | |
Definition at line 33 of file scroll_wrap.h.
| enum dt_ui_resize_mode_t |
| Enumerator | |
|---|---|
| DT_UI_RESIZE_DYNAMIC | |
| DT_UI_RESIZE_STATIC | |
Definition at line 39 of file scroll_wrap.h.
| GtkWidget * dt_ui_resizable_drawing_area | ( | GtkWidget * | area, |
| char * | config_str, | ||
| int | default_height, | ||
| int | min_height ) |
Make a self-drawing widget (typically a GtkDrawingArea graph or scope) vertically resizable.
The widget is given a fixed height-request (persisted under config_str) and a drag grip floating on its bottom edge – the same grip used by panels, scroll wrappers and the histogram scope. The content is not scrolled: it keeps drawing to its live allocation, only the height-request changes. Returns a wrapper overlay to pack in place of area.
| area | the drawing widget (its callbacks/refs stay valid; pack the returned overlay). |
| config_str | conf key persisting the user-chosen height (copied internally). |
| default_height | default height in device-independent px (rescaled by DT_PIXEL_APPLY_DPI). |
| min_height | minimum height floor in device-independent px. |
Definition at line 665 of file scroll_wrap.c.
References _resizable_area_free(), _resizable_area_get_size(), _resizable_area_resize(), _resizable_scroll_max_height(), DT_PIXEL_APPLY_DPI, DT_UI_RESIZABLE_AREA_KEY, dt_widget_stored_int(), dtgtk_resize_handle_new(), FALSE, height, MAX, and state.
Referenced by gui_init(), gui_init(), and gui_init().
| GtkWidget * dt_ui_scroll_wrap | ( | GtkWidget * | w, |
| gint | min_size, | ||
| const char * | config_str, | ||
| dt_ui_resize_mode_t | mode ) |
Wrap a scrollable widget in a recessed, vertically resizable scrolled window with a drag handle.
Compatible with GtkTreeView, GtkTextView and any other content widget. A drag grip floats on the scrolled window's bottom edge (invisible until hovered); the chosen height is persisted under config_str. Returns the wrapper overlay, not the scrolled window.
| w | content widget. |
| min_size | minimum height floor, in device-independent pixels (rescaled by DT_PIXEL_APPLY_DPI). In DT_UI_RESIZE_STATIC mode it is the default height before the user drags only when config_str has no default in anselconfig.xml.in: a key that has one is never unset, and that default is the height. |
| config_str | conf key persisting the user-chosen height (copied internally). |
| mode | DT_UI_RESIZE_DYNAMIC to auto-fit content, or DT_UI_RESIZE_STATIC to keep a fixed height regardless of content (avoids layout shifts for hover-/selection-driven widgets). |
Wrap a scrollable widget in a recessed, vertically resizable scrolled window with a drag handle.
Returns an overlay wrapping the scrolled window, with a themed drag grip floating on its bottom edge (the same grip primitive used by panels and the histogram scope). The grip takes no layout space and is invisible until hovered. Sizing follows mode: DT_UI_RESIZE_DYNAMIC auto-fits the content up to the user height, DT_UI_RESIZE_STATIC keeps a fixed height (see _resizable_scroll_apply).
The returned widget is the wrapper overlay, not the scrolled window; callers needing the inner scrolled window (e.g. to tweak its scroll policy) must use dt_ui_scroll_wrap_get_scrolled_window().
| w | content widget (treeview, textview or any container) |
| min_size | minimum height floor in device pixels (also the static default, for a key without one) |
| config_str | conf key persisting the user-chosen height (copied internally) |
| mode | DT_UI_RESIZE_DYNAMIC (auto-fit) or DT_UI_RESIZE_STATIC (fixed height) |
Definition at line 547 of file scroll_wrap.c.
References _resizable_scroll_draw(), _resizable_scroll_handle_get_size(), _resizable_scroll_handle_resize(), _resizable_scroll_realize(), _widget_auto_connect_buffer(), _widget_auto_connect_model(), _widget_auto_height_free(), _widget_auto_on_buffer_changed(), _widget_auto_on_model_changed(), _widget_auto_update(), dt_gui_add_class(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, DT_PIXEL_APPLY_DPI, DT_UI_RESIZE_DYNAMIC, dtgtk_resize_handle_new(), FALSE, MAX, and state.
Referenced by _mem_list(), _modchooser_run(), dt_iop_gui_init_masks(), and gui_init().
Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.
Return the inner GtkScrolledWindow of a dt_ui_scroll_wrap() wrapper, or NULL.
Definition at line 609 of file scroll_wrap.c.
Referenced by _mem_list(), and gui_init().
Make a DT_UI_RESIZE_DYNAMIC list or text view ask for one blank row past its content.
A list filled edge to edge cannot be told from one with more rows hidden below; the blank row says it ends there. Part of the sizing rule rather than a one-off resize of the window around it, so it holds through every content change and every re-layout. A list capped below its content still snaps to whole rows and scrolls, with no blank row.
| content_widget | the widget passed to dt_ui_scroll_wrap(). Ignored when it was not wrapped. |
Definition at line 626 of file scroll_wrap.c.
References _widget_auto_update(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, IS_NULL_PTR, state, and TRUE.
Referenced by gui_init().