![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "widgets/label.h"#include "common/glib_utils.h"#include "system/macros.h"#include "system/mem_alloc.h"#include "widgets/widget_style.h"#include "widgets/widget_settings.h"
Include dependency graph for label.c:Go to the source code of this file.
Functions | |
| GdkPixbuf * | dt_gui_symbolic_icon_pixbuf (const char *icon_name, GtkIconSize size, const GdkRGBA *color, GtkStyleContext *context) |
Load a symbolic icon as a pre-tinted pixbuf, at the pixel size size names. | |
| void | dt_gui_set_symbolic_icon (GtkWidget *image, const char *icon_name, GtkIconSize size, const GdkRGBA *color) |
| Set a symbolic icon on an image widget, optionally forcing a specific color. | |
| gchar * | delete_underscore (const char *s) |
| gchar * | strip_markup (const char *s) |
| Remove Pango/Gtk markup and accel mnemonics from a text label. If markup parsing fails, fall back to a copy of the original string. | |
| void | dt_ui_section_label_set (GtkWidget *label) |
| GtkWidget * | dt_ui_section_label_new (const gchar *str) |
| GtkWidget * | dt_ui_label_new (const gchar *str) |
| void | dt_ellipsize_combo (GtkComboBox *cbox) |
| void | dt_gui_textview_set_padding (GtkTextView *textview) |
| Apply the standard recessed-input text padding to a GtkTextView. | |
| gchar * delete_underscore | ( | const char * | s | ) |
Remove the underscores GTK reads as mnemonic markers from a label.
Definition at line 75 of file label.c.
References dt_string_replace().
Referenced by _blendop_update_top_enable_label(), _gui_styles_dialog_run(), _history_store_prepend_item(), _hm_clean_module_name(), _iop_panel_label(), _ioporder_create_graph_node(), dt_gui_hist_dialog_new(), dt_history_item_get_name(), dt_history_item_get_name_html(), dt_iop_gui_init(), dt_lib_init_module(), dt_lib_unload_module(), and strip_markup().
| void dt_gui_set_symbolic_icon | ( | GtkWidget * | image, |
| const char * | icon_name, | ||
| GtkIconSize | size, | ||
| const GdkRGBA * | color | ||
| ) |
Set a symbolic icon on an image widget, optionally forcing a specific color.
gtk_image_set_from_icon_name() colors symbolic icons from the current CSS "color", but ansel.css's main theme provider is loaded at GTK_STYLE_PROVIDER_PRIORITY_USER + 1, which outranks any per-widget provider added at the more common GTK_STYLE_PROVIDER_PRIORITY_APPLICATION and silently wins the cascade. Loading the icon as a pre-tinted pixbuf via GtkIconInfo sidesteps CSS entirely, so the requested color always wins. Pass color = NULL for the normal (untinted, theme-foreground) rendering.
Definition at line 56 of file label.c.
References color, dt_gui_symbolic_icon_pixbuf(), IS_NULL_PTR, and size.
Referenced by _studio_import_update_state().
| GdkPixbuf * dt_gui_symbolic_icon_pixbuf | ( | const char * | icon_name, |
| GtkIconSize | size, | ||
| const GdkRGBA * | color, | ||
| GtkStyleContext * | context | ||
| ) |
Load a symbolic icon as a pre-tinted pixbuf, at the pixel size size names.
The pixbuf half of dt_gui_set_symbolic_icon(), for the callers that need the pixbuf itself rather than an image widget – a GtkCellRendererPixbuf, say, which has no colour of its own and takes a "pixbuf" property instead. Tinted with color when one is given, and with context's own foreground otherwise (context is unused when color is given).
Definition at line 29 of file label.c.
References color, height, IS_NULL_PTR, MAX, size, and width.
Referenced by dt_gui_set_symbolic_icon(), and gui_init().
| void dt_gui_textview_set_padding | ( | GtkTextView * | textview | ) |
Apply the standard recessed-input text padding to a GtkTextView.
CSS padding on the textview "text" node is parsed but ignored for layout in GTK3, so the 2px/4px inset matching entry/treeview (see data/themes/.css) has to be set on the widget itself.
| textview | The GtkTextView to update. |
Definition at line 149 of file label.c.
References DT_PIXEL_APPLY_DPI.
Referenced by _active_modules_popup(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), gui_init(), and init_tab_general().
| GtkWidget * dt_ui_label_new | ( | const gchar * | str | ) |
A plain label: start-aligned, capitalised, ellipsized.
Definition at line 125 of file label.c.
References dt_capitalize_label(), and dt_free.
Referenced by _modchooser_run(), dt_gui_preferences_bool(), dt_gui_preferences_enum(), dt_gui_preferences_int(), dt_gui_preferences_string(), dt_iop_gui_init_blendif(), gui_init(), gui_init(), gui_init(), gui_init(), gui_init(), and gui_init().
| GtkWidget * dt_ui_section_label_new | ( | const gchar * | str | ) |
A section heading. Capitalised: grammar says sentences start with a capital, and typography says it makes the structure of the text easier to pick out.
Definition at line 114 of file label.c.
References dt_capitalize_label(), dt_free, and dt_ui_section_label_set().
Referenced by _build_complete_ui(), _build_primaries_ui(), _build_simple_ui(), _build_white_preserving_ui(), _configure_slider_blocks(), _ensure_page_widgets(), _new_section_label(), dt_gui_new_collapsible_section(), gui_init(), gui_init(), gui_init(), gui_init(), and gui_init_section().
Turn an existing label into a section heading: full width, centred, ellipsized.
Definition at line 104 of file label.c.
References dt_gui_add_class().
Referenced by dt_ui_section_label_new().
| gchar * strip_markup | ( | const char * | s | ) |
Remove Pango/Gtk markup and accel mnemonics from a text label. If markup parsing fails, fall back to a copy of the original string.
| s | Original string to clean |
Definition at line 87 of file label.c.
References delete_underscore(), and IS_NULL_PTR.
Referenced by _styles_get_submenu(), add_generic_top_menu_entry(), add_generic_top_submenu_entry(), and set_menu_entry().