![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/scroll_wrap.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "widgets/resize_handle.h"#include "widgets/widget_settings.h"#include "widgets/widget_style.h"#include <glib/gi18n.h>#include "widgets/container.h"
Include dependency graph for scroll_wrap.c:Go to the source code of this file.
Data Structures | |
| struct | dt_ui_resizable_area_t |
Typedefs | |
| typedef struct dt_ui_resizable_area_t | dt_ui_resizable_area_t |
Variables | |
| static const char *const | DT_GUI_WIDGET_AUTO_HEIGHT_KEY = "dt-gui-widget-auto-height" |
| static const char *const | DT_UI_RESIZABLE_AREA_KEY = "dt-ui-resizable-area" |
Definition at line 46 of file scroll_wrap.c.
References dt_gui_container_first_child(), DT_PIXEL_APPLY_DPI, height, and L.
Referenced by _resizable_scroll_apply().
Definition at line 544 of file scroll_wrap.c.
References dt_free, IS_NULL_PTR, L, and state.
Referenced by dt_ui_resizable_drawing_area().
|
static |
Definition at line 552 of file scroll_wrap.c.
References DT_UI_RESIZABLE_AREA_KEY, L, and state.
Referenced by dt_ui_resizable_drawing_area().
|
static |
Definition at line 560 of file scroll_wrap.c.
References _resizable_scroll_max_height(), DT_UI_RESIZABLE_AREA_KEY, dt_widget_store_int(), height, IS_NULL_PTR, L, MAX, and state.
Referenced by dt_ui_resizable_drawing_area().
The single sizing rule for every dt_ui_scroll_wrap area.
Height = clamp(min(content, cap), min_size, 75% window), where the cap is the user's persisted height when set, otherwise the window ceiling so the area auto-grows to its content. This makes small content shrink to fit, lets nested lists grow and have their parent panel scroll until the user drags the handle to cap them, and snaps lists/textviews to whole rows to avoid clipped half-rows. The computed bare (pre-padding) height is cached for the drag handle.
Definition at line 211 of file scroll_wrap.c.
References _get_container_row_heigth(), _resizable_scroll_max_height(), _search_parent_scrolled_window(), _textview_count_visible_rows(), _treeview_count_visible_rows(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, DT_UI_RESIZE_STATIC, dt_widget_stored_int(), height, IS_NULL_PTR, L, MAX, MIN, and state.
Referenced by _resizable_scroll_draw(), _resizable_scroll_handle_resize(), _resizable_scroll_realize(), and _widget_auto_update().
Definition at line 283 of file scroll_wrap.c.
References _resizable_scroll_apply(), and FALSE.
Referenced by dt_ui_scroll_wrap().
|
static |
Definition at line 295 of file scroll_wrap.c.
References DT_GUI_WIDGET_AUTO_HEIGHT_KEY, L, and state.
Referenced by dt_ui_scroll_wrap().
|
static |
Definition at line 302 of file scroll_wrap.c.
References _resizable_scroll_apply(), _resizable_scroll_max_height(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, dt_widget_store_int(), IS_NULL_PTR, L, MAX, state, and value.
Referenced by dt_ui_scroll_wrap().
Window-height ceiling shared by the auto-size rule and the drag handle.
The full main-window height: a resizable area may grow as tall as the window (the parent panel scrolls to reach it). Content shorter than this still shrinks to fit, so this only bounds how far the user can drag.
Definition at line 196 of file scroll_wrap.c.
References DT_PIXEL_APPLY_DPI, dt_widget_root_window(), and L.
Referenced by _resizable_area_resize(), _resizable_scroll_apply(), _resizable_scroll_handle_resize(), and dt_ui_resizable_drawing_area().
Definition at line 289 of file scroll_wrap.c.
References _resizable_scroll_apply().
Referenced by dt_ui_scroll_wrap().
Definition at line 134 of file scroll_wrap.c.
Referenced by _resizable_scroll_apply().
|
static |
Definition at line 101 of file scroll_wrap.c.
References _treeview_count_visible_rows(), L, and model.
Referenced by _resizable_scroll_apply(), and _treeview_count_visible_rows().
Definition at line 404 of file scroll_wrap.c.
References _widget_auto_disconnect_buffer(), _widget_auto_text_buffer_changed(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, IS_NULL_PTR, L, and state.
Referenced by _widget_auto_on_buffer_changed(), and dt_ui_scroll_wrap().
Definition at line 375 of file scroll_wrap.c.
References _widget_auto_disconnect_model(), _widget_auto_model_row_changed(), _widget_auto_model_row_collapsed(), _widget_auto_model_row_deleted(), _widget_auto_model_row_expanded(), _widget_auto_model_row_inserted(), _widget_auto_model_rows_reordered(), DT_GUI_WIDGET_AUTO_HEIGHT_KEY, IS_NULL_PTR, L, model, and state.
Referenced by _widget_auto_on_model_changed(), and dt_ui_scroll_wrap().
|
static |
Definition at line 174 of file scroll_wrap.c.
References IS_NULL_PTR, L, and state.
Referenced by _widget_auto_connect_buffer(), and _widget_auto_height_free().
|
static |
Definition at line 145 of file scroll_wrap.c.
References IS_NULL_PTR, L, model, and state.
Referenced by _widget_auto_connect_model(), and _widget_auto_height_free().
Definition at line 439 of file scroll_wrap.c.
References _widget_auto_disconnect_buffer(), _widget_auto_disconnect_model(), dt_free, IS_NULL_PTR, L, and state.
Referenced by dt_ui_scroll_wrap().
|
static |
Definition at line 330 of file scroll_wrap.c.
References _widget_auto_update(), L, model, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 358 of file scroll_wrap.c.
References _widget_auto_update(), L, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 323 of file scroll_wrap.c.
References _widget_auto_update(), L, model, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 349 of file scroll_wrap.c.
References _widget_auto_update(), L, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 314 of file scroll_wrap.c.
References _widget_auto_update(), L, model, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 339 of file scroll_wrap.c.
References _widget_auto_update(), L, model, and void().
Referenced by _widget_auto_connect_model().
|
static |
Definition at line 431 of file scroll_wrap.c.
References _widget_auto_connect_buffer(), _widget_auto_update(), L, and void().
Referenced by dt_ui_scroll_wrap().
|
static |
Definition at line 423 of file scroll_wrap.c.
References _widget_auto_connect_model(), _widget_auto_update(), L, and void().
Referenced by dt_ui_scroll_wrap().
|
static |
Definition at line 369 of file scroll_wrap.c.
References _widget_auto_update(), L, and void().
Referenced by _widget_auto_connect_buffer().
Definition at line 278 of file scroll_wrap.c.
References _resizable_scroll_apply().
Referenced by _widget_auto_model_row_changed(), _widget_auto_model_row_collapsed(), _widget_auto_model_row_deleted(), _widget_auto_model_row_expanded(), _widget_auto_model_row_inserted(), _widget_auto_model_rows_reordered(), _widget_auto_on_buffer_changed(), _widget_auto_on_model_changed(), _widget_auto_text_buffer_changed(), and dt_ui_scroll_wrap().
| 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 573 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, L, MAX, and state.
Referenced by gui_init(), gui_init(), and gui_init().
| GtkWidget * dt_ui_scroll_wrap | ( | GtkWidget * | w, |
| gint | min_size, | ||
| char * | config_str, | ||
| dt_ui_resize_mode_t | mode | ||
| ) |
Wrap a scrollable content widget in a recessed, vertically resizable scrolled window.
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 before the user drags) |
| 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 465 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, L, MAX, and state.
Referenced by dt_iop_gui_init_masks(), and gui_init().
Return the inner scrolled window 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 527 of file scroll_wrap.c.
References L.
Referenced by gui_init().
Definition at line 29 of file scroll_wrap.c.
Referenced by _resizable_scroll_apply(), _resizable_scroll_handle_get_size(), _resizable_scroll_handle_resize(), _widget_auto_connect_buffer(), _widget_auto_connect_model(), and dt_ui_scroll_wrap().
Definition at line 37 of file scroll_wrap.c.
Referenced by _resizable_area_get_size(), _resizable_area_resize(), and dt_ui_resizable_drawing_area().