Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
label.c File Reference
+ Include dependency graph for label.c:

Go to the source code of this file.

Functions

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)
 
GtkWidgetdt_ui_section_label_new (const gchar *str)
 
GtkWidgetdt_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.
 

Function Documentation

◆ delete_underscore()

◆ dt_ellipsize_combo()

void dt_ellipsize_combo ( GtkComboBox cbox)

Definition at line 124 of file label.c.

References L.

◆ dt_gui_set_symbolic_icon()

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 29 of file label.c.

References color, height, IS_NULL_PTR, L, MAX, size, and width.

Referenced by _studio_import_update_state().

◆ dt_gui_textview_set_padding()

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.

Parameters
textviewThe GtkTextView to update.

Definition at line 136 of file label.c.

References DT_PIXEL_APPLY_DPI, and L.

Referenced by _active_modules_popup(), _pop_menu_dictionary_create_tag(), _pop_menu_dictionary_edit_tag(), gui_init(), and init_tab_general().

◆ dt_ui_label_new()

GtkWidget * dt_ui_label_new ( const gchar *  str)

◆ dt_ui_section_label_new()

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 101 of file label.c.

References dt_capitalize_label(), dt_free, dt_ui_section_label_set(), and L.

Referenced by _build_complete_ui(), _build_primaries_ui(), _build_simple_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().

◆ dt_ui_section_label_set()

void dt_ui_section_label_set ( GtkWidget label)

Turn an existing label into a section heading: full width, centred, ellipsized.

Definition at line 91 of file label.c.

References dt_gui_add_class(), and L.

Referenced by dt_ui_section_label_new().

◆ strip_markup()

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.

Parameters
sOriginal string to clean
Returns
gchar* Newly-allocated string. The caller is responsible for freeing it.

Definition at line 74 of file label.c.

References delete_underscore(), IS_NULL_PTR, and L.

Referenced by _styles_get_submenu(), add_generic_top_menu_entry(), add_generic_top_submenu_entry(), and set_menu_entry().