diff --git a/helpers/DATA/dia/patch_changes/000-apply_current_dia_mr_114.patch b/helpers/DATA/dia/patch_changes/000-apply_current_dia_mr_114.patch new file mode 100644 index 0000000..80b30cf --- /dev/null +++ b/helpers/DATA/dia/patch_changes/000-apply_current_dia_mr_114.patch @@ -0,0 +1,1324 @@ +From 6d7a3b627566ff2201292a45ed35a5ab3e425c13 Mon Sep 17 00:00:00 2001 +From: Duncan McIntosh +Date: Sun, 15 Oct 2023 22:26:17 -0400 +Subject: [PATCH 1/4] objects: disable Tab in multi-line entry widgets + +This becomes a 'black hole' for focus, making it hard to navigate by +keyboard. This is both annoying, and also an accessibility problem. +--- + lib/prop_text.c | 1 + + objects/UML/class_attributes_dialog.c | 1 + + objects/UML/class_dialog.c | 1 + + objects/UML/class_operations_dialog.c | 2 ++ + 4 files changed, 5 insertions(+) + +diff --git a/lib/prop_text.c b/lib/prop_text.c +index 4ff98f60d..8e1e9fcf7 100644 +--- a/lib/prop_text.c ++++ b/lib/prop_text.c +@@ -125,6 +125,7 @@ multistringprop_get_widget(StringProperty *prop, PropDialog *dialog) + GtkWidget *ret = gtk_text_view_new(); + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(ret)); + GtkWidget *frame = gtk_frame_new(NULL); ++ gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (ret), FALSE); + gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); + gtk_container_add(GTK_CONTAINER(frame), ret); + g_signal_connect(G_OBJECT(ret), "key-release-event", +diff --git a/objects/UML/class_attributes_dialog.c b/objects/UML/class_attributes_dialog.c +index 2722a2a03..085624e31 100644 +--- a/objects/UML/class_attributes_dialog.c ++++ b/objects/UML/class_attributes_dialog.c +@@ -729,6 +729,7 @@ _attributes_create_page (GtkNotebook *notebook, UMLClass *umlclass) + gtk_container_add (GTK_CONTAINER (scrolledwindow), entry); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (entry), TRUE); ++ gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE); + gtk_widget_show (entry); + #if 0 /* while the GtkEntry has a "activate" signal, GtkTextView does not. + * Maybe we should connect to "set-focus-child" instead? +diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c +index 8867ae9ac..163cc2949 100644 +--- a/objects/UML/class_dialog.c ++++ b/objects/UML/class_dialog.c +@@ -382,6 +382,7 @@ class_create_page(GtkNotebook *notebook, UMLClass *umlclass) + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), + GTK_SHADOW_IN); + entry = gtk_text_view_new (); ++ gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE); + prop_dialog->comment = GTK_TEXT_VIEW(entry); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD); + +diff --git a/objects/UML/class_operations_dialog.c b/objects/UML/class_operations_dialog.c +index a530337a9..936a8b575 100644 +--- a/objects/UML/class_operations_dialog.c ++++ b/objects/UML/class_operations_dialog.c +@@ -982,6 +982,7 @@ operations_data_create_hbox (UMLClass *umlclass) + gtk_container_add (GTK_CONTAINER (scrolledwindow), entry); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (entry),TRUE); ++ gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE); + + + gtk_grid_attach (GTK_GRID (grid), label, 4, 0, 1, 1); +@@ -1340,6 +1341,7 @@ operations_parameters_data_create_vbox (UMLClass *umlclass) + gtk_container_add (GTK_CONTAINER (scrolledwindow), entry); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (entry), GTK_WRAP_WORD); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (entry),TRUE); ++ gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (entry), FALSE); + + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_grid_attach (GTK_GRID (grid), label, 2, 1, 1, 1); +-- +GitLab + + +From b5dc904ed58ea026898fbc7bf6940de97a6e4e15 Mon Sep 17 00:00:00 2001 +From: Duncan McIntosh +Date: Mon, 16 Oct 2023 15:34:23 -0400 +Subject: [PATCH 2/4] font: don't store the height internally + +We now solely rely on the PangoFontDescription, which is more flexible and +less prone to mistakes. +--- + lib/font.c | 85 ++++++++++++++++++++++---------------------------- + lib/font.h | 2 ++ + lib/libdia.def | 1 + + 3 files changed, 41 insertions(+), 47 deletions(-) + +diff --git a/lib/font.c b/lib/font.c +index 1a321c462..6dec80bb1 100644 +--- a/lib/font.c ++++ b/lib/font.c +@@ -39,6 +39,7 @@ + #include "font.h" + #include "message.h" + #include "textline.h" ++#include "units.h" + + static PangoContext *pango_context = NULL; + +@@ -53,13 +54,6 @@ struct _DiaFont { + PangoFontDescription *pfd; + /* mutable */ char *legacy_name; + +- /* there is a difference between Pango's font size and Dia's font height */ +- /* Calculated font_size is to make 'font_height = ascent + descent */ +- /* The font_height is used as default line height, there used to be a hard-coded size = 0.7 * height */ +- /* before using pango_set_absolute_size() to overcome font size differences between renderers */ +- double height; +- /* Need to load a font to query it's metrics */ +- PangoFont *loaded; + PangoFontMetrics *metrics; + }; + +@@ -136,8 +130,6 @@ dia_font_finalize (GObject *object) + g_clear_pointer (&font->pfd, pango_font_description_free); + g_clear_pointer (&font->metrics, pango_font_metrics_unref); + +- g_clear_object (&font->loaded); +- + G_OBJECT_CLASS (dia_font_parent_class)->finalize (object); + } + +@@ -166,33 +158,17 @@ dia_pfd_set_height(PangoFontDescription *pfd, double height) + } + + +-/*! +- * In Dia a font is usually referred to by it's (line-) height, not it's size. +- * +- * This methods "calculates" the latter from the former. This used to be some magic factor of 0.7 which did not +- * solve the resolution dependencance of the former calculation. In fact there is new magic factor now because +- * really calculating the font size from the height would involve two font loads which seem to be two expensive. +- */ + static void +-_dia_font_adjust_size (DiaFont *font, double height, gboolean recalc_alwways) ++dia_font_update_metrics (DiaFont *font) + { ++ PangoFont *loaded; + +- if (font->height != height || !font->metrics || recalc_alwways) { +- PangoFont *loaded; +- +- dia_pfd_set_height (font->pfd, height); +- /* need to load a font to get it's metrics */ +- loaded = font->loaded; +- font->loaded = pango_context_load_font (dia_font_get_context (), font->pfd); +- +- g_clear_object (&loaded); +- +- g_clear_pointer (&font->metrics, pango_font_metrics_unref); ++ g_clear_pointer (&font->metrics, pango_font_metrics_unref); + +- /* caching metrics */ +- font->metrics = pango_font_get_metrics (font->loaded, NULL); +- font->height = height; +- } ++ /* need to load a font to get its metrics */ ++ loaded = pango_context_load_font (dia_font_get_context (), font->pfd); ++ font->metrics = pango_font_get_metrics (loaded, NULL); ++ g_clear_object (&loaded); + } + + +@@ -205,15 +181,8 @@ DiaFont * + dia_font_new (const char *family, DiaFontStyle style, double height) + { + DiaFont* font = dia_font_new_from_style(style, height); +- gboolean changed; +- +- changed = family != NULL && g_strcmp0 (pango_font_description_get_family (font->pfd), family) != 0; + pango_font_description_set_family(font->pfd, family); + +- if (changed) { +- _dia_font_adjust_size (font, font->height, TRUE); +- } +- + return font; + } + +@@ -316,9 +285,10 @@ dia_font_new_from_style (DiaFontStyle style, double height) + + retval = g_object_new (DIA_TYPE_FONT, NULL); + retval->pfd = pfd; +- _dia_font_adjust_size (retval, height, FALSE); + retval->legacy_name = NULL; + ++ dia_font_update_metrics (retval); ++ + return retval; + } + +@@ -407,8 +377,9 @@ double + dia_font_get_height (DiaFont *font) + { + g_return_val_if_fail (font != NULL, 0.0); ++ g_return_val_if_fail (pango_font_description_get_size_is_absolute (font->pfd), 0.0); + +- return font->height; ++ return pdu_to_dcm(pango_font_description_get_size(font->pfd)) / 0.8; + } + + +@@ -430,6 +401,23 @@ dia_font_get_size (DiaFont *font) + } + + ++/** ++ * dia_font_set_size: ++ * @font: The font to modify. ++ * @size: The new size in centimetres. ++ * ++ * Sets the size of font to the provided (positive) size. ++ */ ++void ++dia_font_set_size (DiaFont *font, double size) ++{ ++ g_return_if_fail (size >= 0); ++ ++ pango_font_description_set_absolute_size (font->pfd, dcm_to_pdu (size)); ++ dia_font_update_metrics (font); ++} ++ ++ + /** + * dia_font_set_height: + * +@@ -438,7 +426,8 @@ dia_font_get_size (DiaFont *font) + void + dia_font_set_height (DiaFont* font, double height) + { +- _dia_font_adjust_size (font, height, FALSE); ++ /* FIXME For now, assume height is 80% of size. */ ++ dia_font_set_size (font, height / 0.8); + } + + +@@ -493,7 +482,7 @@ dia_font_set_any_family (DiaFont *font, const char *family) + pango_font_description_set_family (font->pfd, family); + if (changed) { + /* force recalculation on name change */ +- _dia_font_adjust_size (font, font->height, TRUE); ++ dia_font_update_metrics (font); + } + + g_clear_pointer (&font->legacy_name, g_free); +@@ -531,7 +520,7 @@ dia_font_set_weight (DiaFont *font, DiaFontWeight weight) + dia_pfd_set_weight(font->pfd,weight); + + if (old_weight != weight) { +- _dia_font_adjust_size (font, font->height, TRUE); ++ dia_font_update_metrics (font); + } + } + +@@ -548,7 +537,7 @@ dia_font_set_slant (DiaFont *font, DiaFontSlant slant) + g_return_if_fail(font != NULL); + dia_pfd_set_slant(font->pfd,slant); + if (slant != old_slant) +- _dia_font_adjust_size (font, font->height, TRUE); ++ dia_font_update_metrics (font); + } + + +@@ -702,7 +691,8 @@ dia_font_ascent (const char *string, DiaFont *font, double height) + { + if (font->metrics) { + double ascent = pdu_to_dcm (pango_font_metrics_get_ascent (font->metrics)); +- return ascent * (height / font->height); ++ double factor = height / dia_font_get_height (font); ++ return ascent * factor; + } else { + /* previous, _expensive_ but string specific way */ + TextLine *text_line = text_line_new (string, font, height); +@@ -723,7 +713,8 @@ dia_font_descent (const char *string, DiaFont *font, double height) + { + if (font->metrics) { + double descent = pdu_to_dcm (pango_font_metrics_get_descent (font->metrics)); +- return descent * (height / font->height); ++ double factor = height / dia_font_get_height (font); ++ return descent * factor; + } else { + /* previous, _expensive_ but string specific way */ + TextLine *text_line = text_line_new (string, font, height); +diff --git a/lib/font.h b/lib/font.h +index aaf19ef6d..bd6868cb3 100644 +--- a/lib/font.h ++++ b/lib/font.h +@@ -103,6 +103,8 @@ const PangoFontDescription *dia_font_get_description (DiaFont *f + double dia_font_get_height (DiaFont *font); + void dia_font_set_height (DiaFont *font, + double height); ++void dia_font_set_size (DiaFont *font, ++ double size); + double dia_font_get_size (DiaFont *font); + void dia_font_set_slant (DiaFont *font, + DiaFontSlant slant); +diff --git a/lib/libdia.def b/lib/libdia.def +index d7f579479..1218a20c9 100644 +--- a/lib/libdia.def ++++ b/lib/libdia.def +@@ -243,6 +243,7 @@ EXPORTS + dia_font_new_from_style + dia_font_set_any_family + dia_font_set_height ++ dia_font_set_size + dia_font_set_slant + dia_font_set_slant_from_string + dia_font_set_weight +-- +GitLab + + +From da5b8963d3bd8f80a50b3bf81ec5d7a59bdbe8a7 Mon Sep 17 00:00:00 2001 +From: Duncan McIntosh +Date: Fri, 20 Oct 2023 17:29:48 -0400 +Subject: [PATCH 3/4] font: add dia_font_new_from_description + +Since we no longer need to keep track of font heights in DiaFont, it +basically wraps descriptions. As such, allow creating fonts from a +string Pango description. + +This uses a string to try and avoid a public dependency on Pango. We +still have public dependencies elsewhere, but it means shifting to +alternative libraries, or incompatible versions (like Pango2, which +appears at least on hold) should be easier. It also doesn't really +add much friction with GTK. +--- + lib/font.c | 21 +++++++++++++++++++++ + lib/font.h | 1 + + lib/libdia.def | 1 + + 3 files changed, 23 insertions(+) + +diff --git a/lib/font.c b/lib/font.c +index 6dec80bb1..ca3953f28 100644 +--- a/lib/font.c ++++ b/lib/font.c +@@ -293,6 +293,27 @@ dia_font_new_from_style (DiaFontStyle style, double height) + } + + ++DiaFont * ++dia_font_new_from_description (const char *desc) ++{ ++ DiaFont *retval; ++ PangoFontDescription *pfd = pango_font_description_from_string (desc); ++ ++ if (!pango_font_description_get_size_is_absolute (pfd)) { ++ double size = pango_font_description_get_size (pfd); ++ pango_font_description_set_absolute_size(pfd, size * global_zoom_factor * 72.0); ++ } ++ ++ retval = g_object_new (DIA_TYPE_FONT, NULL); ++ retval->pfd = pfd; ++ retval->legacy_name = NULL; ++ ++ dia_font_update_metrics (retval); ++ ++ return retval; ++} ++ ++ + DiaFont * + dia_font_copy (DiaFont *font) + { +diff --git a/lib/font.h b/lib/font.h +index bd6868cb3..cc1260815 100644 +--- a/lib/font.h ++++ b/lib/font.h +@@ -95,6 +95,7 @@ DiaFont *dia_font_new (const char *f + DiaFont *dia_font_new_from_style (DiaFontStyle style, + double height); + DiaFont *dia_font_new_from_legacy_name (const char *name); ++DiaFont *dia_font_new_from_description (const char *description); + const char *dia_font_get_legacy_name (DiaFont *font); + DiaFont *dia_font_copy (DiaFont *font); + DiaFontStyle dia_font_get_style (DiaFont *font); +diff --git a/lib/libdia.def b/lib/libdia.def +index 1218a20c9..db1c4ad7a 100644 +--- a/lib/libdia.def ++++ b/lib/libdia.def +@@ -241,6 +241,7 @@ EXPORTS + dia_font_new + dia_font_new_from_legacy_name + dia_font_new_from_style ++ dia_font_new_from_description + dia_font_set_any_family + dia_font_set_height + dia_font_set_size +-- +GitLab + + +From 48c9b9b81d347d3f3c6df4df9c7456f2b74919c8 Mon Sep 17 00:00:00 2001 +From: Duncan McIntosh +Date: Fri, 20 Oct 2023 17:31:58 -0400 +Subject: [PATCH 4/4] lib: remove DiaFontSelector + +We can now use GtkFontButton, which (a) allows removing ~700 lines of code, +and (b) doesn't lock up whenever a property dialog is opened. + +Currently, we don't allow configuring size in the dialog, since the size +of a DiaFont isn't really used. Further refactoring should let us use it +instead of separate spin buttons. +--- + lib/dia-font-selector.c | 646 ------------------------------------- + lib/dia-font-selector.h | 37 --- + lib/libdia.def | 5 - + lib/meson.build | 2 - + lib/prop_attr.c | 17 +- + objects/UML/class_dialog.c | 54 +++- + objects/UML/class_dialog.h | 13 +- + 7 files changed, 56 insertions(+), 718 deletions(-) + delete mode 100644 lib/dia-font-selector.c + delete mode 100644 lib/dia-font-selector.h + +diff --git a/lib/dia-font-selector.c b/lib/dia-font-selector.c +deleted file mode 100644 +index fb59d6c98..000000000 +--- a/lib/dia-font-selector.c ++++ /dev/null +@@ -1,646 +0,0 @@ +-/* Dia -- an diagram creation/manipulation program +- * Copyright (C) 1998 Alexander Larsson +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +- */ +- +-#include "config.h" +- +-#include +-#include +- +-#include +-#include +- +-#include "dia-font-selector.h" +-#include "font.h" +-#include "persistence.h" +- +-#define PERSIST_NAME "font-menu" +- +-struct _DiaFontSelector { +- GtkBox hbox; +-}; +- +- +-typedef struct _DiaFontSelectorPrivate DiaFontSelectorPrivate; +-struct _DiaFontSelectorPrivate { +- GtkWidget *fonts; +- GtkTreeStore *fonts_store; +- GtkTreeIter fonts_default_end; +- GtkTreeIter fonts_custom_end; +- GtkTreeIter fonts_other; +- GtkTreeIter fonts_reset; +- +- const char *looking_for; +- +- GtkWidget *styles; +- GtkListStore *styles_store; +- +- char *current; +- int current_style; +-}; +- +-G_DEFINE_TYPE_WITH_PRIVATE (DiaFontSelector, dia_font_selector, GTK_TYPE_BOX) +- +-enum { +- VALUE_CHANGED, +- LAST_SIGNAL +-}; +- +-static guint signals[LAST_SIGNAL] = { 0 }; +- +- +-/* New and improved font selector: Contains the three standard fonts +- * and an 'Other fonts...' entry that opens the font dialog. The fonts +- * selected in the font dialog are persistently added to the menu. +- * +- * +----------------+ +- * | Sans | +- * | Serif | +- * | Monospace | +- * | -------------- | +- * | Bodini | +- * | CurlyGothic | +- * | OldWestern | +- * | -------------- | +- * | Other fonts... | +- * +----------------+ +- */ +- +-enum { +- STYLE_COL_LABEL, +- STYLE_COL_ID, +- STYLE_N_COL, +-}; +- +- +-enum { +- FONT_COL_FAMILY, +- FONT_N_COL, +-}; +- +- +-static void +-dia_font_selector_finalize (GObject *object) +-{ +- DiaFontSelector *self = DIA_FONT_SELECTOR (object); +- DiaFontSelectorPrivate *priv = dia_font_selector_get_instance_private (self); +- +- g_clear_object (&priv->fonts_store); +- g_clear_object (&priv->styles_store); +- +- g_clear_pointer (&priv->current, g_free); +- +- G_OBJECT_CLASS (dia_font_selector_parent_class)->finalize (object); +-} +- +- +-static void +-dia_font_selector_class_init (DiaFontSelectorClass *klass) +-{ +- GObjectClass *object_class = G_OBJECT_CLASS (klass); +- +- object_class->finalize = dia_font_selector_finalize; +- +- signals[VALUE_CHANGED] = g_signal_new ("value-changed", +- G_TYPE_FROM_CLASS (klass), +- G_SIGNAL_RUN_FIRST, +- 0, NULL, NULL, +- g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0); +-} +- +- +-static int +-sort_fonts (const void *p1, const void *p2) +-{ +- const gchar *n1 = pango_font_family_get_name (PANGO_FONT_FAMILY (*(void**)p1)); +- const gchar *n2 = pango_font_family_get_name (PANGO_FONT_FAMILY (*(void**)p2)); +- return g_ascii_strcasecmp (n1, n2); +-} +- +- +-static char *style_labels[] = { +- "Normal", +- "Oblique", +- "Italic", +- "Ultralight", +- "Ultralight-Oblique", +- "Ultralight-Italic", +- "Light", +- "Light-Oblique", +- "Light-Italic", +- "Medium", +- "Medium-Oblique", +- "Medium-Italic", +- "Demibold", +- "Demibold-Oblique", +- "Demibold-Italic", +- "Bold", +- "Bold-Oblique", +- "Bold-Italic", +- "Ultrabold", +- "Ultrabold-Oblique", +- "Ultrabold-Italic", +- "Heavy", +- "Heavy-Oblique", +- "Heavy-Italic" +-}; +- +- +-static PangoFontFamily * +-get_family_from_name (GtkWidget *widget, const gchar *fontname) +-{ +- PangoFontFamily **families; +- int n_families, i; +- +- pango_context_list_families (dia_font_get_context(), +- &families, &n_families); +- /* Doing it the slow way until I find a better way */ +- for (i = 0; i < n_families; i++) { +- if (!(g_ascii_strcasecmp (pango_font_family_get_name (families[i]), fontname))) { +- PangoFontFamily *fam = families[i]; +- g_clear_pointer (&families, g_free); +- return fam; +- } +- } +- g_warning (_("Couldn't find font family for %s\n"), fontname); +- g_clear_pointer (&families, g_free); +- return NULL; +-} +- +- +-static void +-set_styles (DiaFontSelector *fs, +- const gchar *name, +- DiaFontStyle dia_style) +-{ +- PangoFontFamily *pff; +- DiaFontSelectorPrivate *priv; +- PangoFontFace **faces = NULL; +- int nfaces = 0; +- int i = 0; +- long stylebits = 0; +- +- g_return_if_fail (DIA_IS_FONT_SELECTOR (fs)); +- +- priv = dia_font_selector_get_instance_private (fs); +- +- pff = get_family_from_name (GTK_WIDGET (fs), name); +- +- pango_font_family_list_faces (pff, &faces, &nfaces); +- +- for (i = 0; i < nfaces; i++) { +- PangoFontDescription *pfd = pango_font_face_describe (faces[i]); +- PangoStyle style = pango_font_description_get_style (pfd); +- PangoWeight weight = pango_font_description_get_weight (pfd); +- /* +- * This is a quick and dirty way to pick the styles present, +- * sort them and avoid duplicates. +- * We set a bit for each style present, bit (weight*3+style) +- * From style_labels, we pick #(weight*3+style) +- * where weight and style are the Dia types. +- */ +- /* Account for DIA_WEIGHT_NORMAL hack */ +- int weightnr = (weight-200)/100; +- if (weightnr < 2) weightnr ++; +- else if (weightnr == 2) weightnr = 0; +- stylebits |= 1 << (3*weightnr + style); +- pango_font_description_free (pfd); +- } +- +- g_clear_pointer (&faces, g_free); +- +- if (stylebits == 0) { +- g_warning ("'%s' has no style!", +- pango_font_family_get_name (pff) ? pango_font_family_get_name (pff) : "(null font)"); +- } +- +- gtk_list_store_clear (priv->styles_store); +- +- for (i = DIA_FONT_NORMAL; i <= (DIA_FONT_HEAVY | DIA_FONT_ITALIC); i+=4) { +- GtkTreeIter iter; +- +- /* +- * bad hack continued ... +- */ +- int weight = DIA_FONT_STYLE_GET_WEIGHT (i) >> 4; +- int slant = DIA_FONT_STYLE_GET_SLANT (i) >> 2; +- +- if (DIA_FONT_STYLE_GET_SLANT (i) > DIA_FONT_ITALIC) { +- continue; +- } +- +- if (!(stylebits & (1 << (3 * weight + slant)))) { +- continue; +- } +- +- gtk_list_store_append (priv->styles_store, &iter); +- gtk_list_store_set (priv->styles_store, +- &iter, +- STYLE_COL_LABEL, style_labels[3 * weight + slant], +- STYLE_COL_ID, i, +- -1); +- +- if (dia_style == i || (i == DIA_FONT_NORMAL && dia_style == -1)) { +- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->styles), &iter); +- } +- } +- +- gtk_widget_set_sensitive (GTK_WIDGET (priv->styles), +- gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->styles_store), NULL) > 1); +-} +- +- +-static void +-font_changed (GtkComboBox *widget, +- DiaFontSelector *self) +-{ +- DiaFontSelectorPrivate *priv; +- GtkTreeIter active; +- GtkTreePath *active_path; +- GtkTreePath *path; +- char *family = NULL; +- +- g_return_if_fail (DIA_IS_FONT_SELECTOR (self)); +- +- priv = dia_font_selector_get_instance_private (self); +- +- gtk_combo_box_get_active_iter (widget, &active); +- +- active_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->fonts_store), &active); +- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->fonts_store), &priv->fonts_reset); +- +- if (gtk_tree_path_compare (path, active_path) == 0) { +- GtkTreeIter iter; +- GtkTreePath *end_path; +- DiaFont *font; +- +- persistent_list_clear (PERSIST_NAME); +- +- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->fonts_store), &priv->fonts_default_end); +- +- // Move over the separator +- gtk_tree_path_next (path); +- gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->fonts_store), &iter, path); +- +- end_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->fonts_store), &priv->fonts_custom_end); +- +- while (gtk_tree_path_compare (path, end_path) != 0) { +- gtk_tree_store_remove (priv->fonts_store, &iter); +- +- gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->fonts_store), &iter, path); +- +- gtk_tree_path_free (end_path); +- end_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->fonts_store), &priv->fonts_custom_end); +- } +- +- gtk_tree_path_free (path); +- gtk_tree_path_free (end_path); +- gtk_tree_path_free (active_path); +- +- if (priv->current) { +- font = dia_font_new (priv->current, priv->current_style, 1.0); +- dia_font_selector_set_font (self, font); +- g_clear_object (&font); +- } else { +- gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->fonts_store), &iter); +- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->fonts), &iter); +- } +- +- return; +- } +- +- gtk_tree_model_get (GTK_TREE_MODEL (priv->fonts_store), +- &active, +- FONT_COL_FAMILY, &family, +- -1); +- +- g_clear_pointer (&priv->current, g_free); +- priv->current = g_strdup (family); +- +- set_styles (self, family, -1); +- g_signal_emit (G_OBJECT (self), signals[VALUE_CHANGED], 0); +- +- if (g_strcmp0 (family, "sans") != 0 && +- g_strcmp0 (family, "serif") != 0 && +- g_strcmp0 (family, "monospace") != 0 && +- !persistent_list_add (PERSIST_NAME, family)) { +- GtkTreeIter iter; +- +- gtk_tree_store_insert_before (priv->fonts_store, +- &iter, +- NULL, +- &priv->fonts_custom_end); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, family, +- -1); +- +- gtk_combo_box_set_active_iter (widget, &iter); +- } +- +- gtk_tree_path_free (path); +- gtk_tree_path_free (active_path); +- g_clear_pointer (&family, g_free); +-} +- +- +-static gboolean +-is_separator (GtkTreeModel *model, +- GtkTreeIter *iter, +- gpointer data) +-{ +- gboolean result; +- char *family; +- +- gtk_tree_model_get (model, iter, FONT_COL_FAMILY, &family, -1); +- +- result = g_strcmp0 (family, "separator") == 0; +- +- g_clear_pointer (&family, g_free); +- +- return result; +-} +- +- +-static void +-is_sensitive (GtkCellLayout *cell_layout, +- GtkCellRenderer *cell, +- GtkTreeModel *tree_model, +- GtkTreeIter *iter, +- gpointer data) +-{ +- gboolean sensitive; +- +- sensitive = !gtk_tree_model_iter_has_child (tree_model, iter); +- +- g_object_set (cell, "sensitive", sensitive, NULL); +-} +- +- +-static void +-style_changed (GtkComboBox *widget, +- DiaFontSelector *self) +-{ +- DiaFontSelectorPrivate *priv; +- GtkTreeIter active; +- +- g_return_if_fail (DIA_IS_FONT_SELECTOR (self)); +- +- priv = dia_font_selector_get_instance_private (self); +- +- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->styles), &active)) { +- gtk_tree_model_get (GTK_TREE_MODEL (priv->styles_store), +- &active, +- STYLE_COL_ID, &priv->current_style, +- -1); +- } else { +- priv->current_style = 0; +- } +- +- g_signal_emit (G_OBJECT (self), signals[VALUE_CHANGED], 0); +-} +- +- +-static void +-dia_font_selector_init (DiaFontSelector *fs) +-{ +- DiaFontSelectorPrivate *priv; +- PangoFontFamily **families; +- int n_families,i; +- GtkCellRenderer *renderer; +- GtkTreeIter iter; +- GList *tmplist; +- +- g_return_if_fail (DIA_IS_FONT_SELECTOR (fs)); +- +- priv = dia_font_selector_get_instance_private (fs); +- +- priv->fonts_store = gtk_tree_store_new (FONT_N_COL, G_TYPE_STRING); +- +- gtk_tree_store_append (priv->fonts_store, &iter, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, "sans", +- -1); +- gtk_tree_store_append (priv->fonts_store, &iter, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, "serif", +- -1); +- gtk_tree_store_append (priv->fonts_store, &iter, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, "monospace", +- -1); +- +- gtk_tree_store_append (priv->fonts_store, &priv->fonts_default_end, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &priv->fonts_default_end, +- FONT_COL_FAMILY, "separator", +- -1); +- +- persistence_register_list (PERSIST_NAME); +- +- for (tmplist = persistent_list_get_glist (PERSIST_NAME); +- tmplist != NULL; tmplist = g_list_next (tmplist)) { +- gtk_tree_store_append (priv->fonts_store, &iter, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, tmplist->data, +- -1); +- } +- +- gtk_tree_store_append (priv->fonts_store, &priv->fonts_custom_end, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &priv->fonts_custom_end, +- FONT_COL_FAMILY, "separator", +- -1); +- +- gtk_tree_store_append (priv->fonts_store, &priv->fonts_other, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &priv->fonts_other, +- FONT_COL_FAMILY, _("Other Fonts"), +- -1); +- +- gtk_tree_store_append (priv->fonts_store, &priv->fonts_reset, NULL); +- gtk_tree_store_set (priv->fonts_store, +- &priv->fonts_reset, +- FONT_COL_FAMILY, _("Reset Menu"), +- -1); +- +- priv->fonts = gtk_combo_box_new_with_model (GTK_TREE_MODEL (priv->fonts_store)); +- gtk_widget_set_hexpand (priv->fonts, TRUE); +- gtk_widget_show (priv->fonts); +- +- g_signal_connect (priv->fonts, +- "changed", +- G_CALLBACK (font_changed), +- fs); +- +- renderer = gtk_cell_renderer_text_new (); +- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->fonts), renderer, TRUE); +- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->fonts), renderer, +- "text", FONT_COL_FAMILY, +- "family", FONT_COL_FAMILY, +- NULL); +- +- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (priv->fonts), +- is_separator, NULL, NULL); +- gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (priv->fonts), +- renderer, +- is_sensitive, +- NULL, NULL); +- +- priv->styles_store = gtk_list_store_new (STYLE_N_COL, +- G_TYPE_STRING, +- G_TYPE_INT); +- priv->styles = gtk_combo_box_new_with_model (GTK_TREE_MODEL (priv->styles_store)); +- gtk_widget_show (priv->styles); +- +- g_signal_connect (priv->styles, +- "changed", +- G_CALLBACK (style_changed), +- fs); +- +- renderer = gtk_cell_renderer_text_new (); +- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->styles), renderer, TRUE); +- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->styles), renderer, +- "text", STYLE_COL_LABEL, +- NULL); +- +- pango_context_list_families (dia_font_get_context (), +- &families, +- &n_families); +- +- qsort (families, +- n_families, +- sizeof (PangoFontFamily *), +- sort_fonts); +- +- /* Doing it the slow way until I find a better way */ +- for (i = 0; i < n_families; i++) { +- gtk_tree_store_append (priv->fonts_store, +- &iter, +- &priv->fonts_other); +- gtk_tree_store_set (priv->fonts_store, +- &iter, +- FONT_COL_FAMILY, pango_font_family_get_name (families[i]), +- -1); +- } +- g_clear_pointer (&families, g_free); +- +- gtk_box_pack_start (GTK_BOX (fs), GTK_WIDGET (priv->fonts), FALSE, TRUE, 0); +- gtk_box_pack_start (GTK_BOX (fs), GTK_WIDGET (priv->styles), FALSE, TRUE, 0); +-} +- +- +-GtkWidget * +-dia_font_selector_new (void) +-{ +- return g_object_new (DIA_TYPE_FONT_SELECTOR, NULL); +-} +- +- +-static gboolean +-set_font (GtkTreeModel *model, +- GtkTreePath *path, +- GtkTreeIter *iter, +- gpointer data) +-{ +- DiaFontSelector *self = DIA_FONT_SELECTOR (data); +- DiaFontSelectorPrivate *priv = dia_font_selector_get_instance_private (self); +- char *font; +- gboolean res = FALSE; +- +- gtk_tree_model_get (model, +- iter, +- FONT_COL_FAMILY, &font, +- -1); +- +- res = g_strcmp0 (priv->looking_for, font) == 0; +- if (res) { +- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->fonts), iter); +- } +- +- g_clear_pointer (&font, g_free); +- +- return res; +-} +- +- +-/** +- * dia_font_selector_set_font: +- * +- * Set the current font to be shown in the font selector. +- */ +-void +-dia_font_selector_set_font (DiaFontSelector *self, DiaFont *font) +-{ +- DiaFontSelectorPrivate *priv; +- const gchar *fontname = dia_font_get_family (font); +- +- g_return_if_fail (DIA_IS_FONT_SELECTOR (self)); +- +- priv = dia_font_selector_get_instance_private (self); +- +- priv->looking_for = fontname; +- gtk_tree_model_foreach (GTK_TREE_MODEL (priv->fonts_store), set_font, self); +- priv->looking_for = NULL; +- +- set_styles (self, fontname, dia_font_get_style (font)); +-} +- +- +-DiaFont * +-dia_font_selector_get_font (DiaFontSelector *self) +-{ +- DiaFontSelectorPrivate *priv; +- DiaFontStyle style; +- DiaFont *font; +- GtkTreeIter iter; +- char *fontname = NULL; +- +- g_return_val_if_fail (DIA_IS_FONT_SELECTOR (self), NULL); +- +- priv = dia_font_selector_get_instance_private (self); +- +- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->fonts), &iter)) { +- gtk_tree_model_get (GTK_TREE_MODEL (priv->fonts_store), +- &iter, +- FONT_COL_FAMILY, &fontname, +- -1); +- } else { +- g_warning ("No font selected"); +- } +- +- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->styles), &iter)) { +- gtk_tree_model_get (GTK_TREE_MODEL (priv->styles_store), +- &iter, +- STYLE_COL_ID, &style, +- -1); +- } else { +- style = 0; +- } +- +- font = dia_font_new (fontname, style, 1.0); +- +- g_clear_pointer (&fontname, g_free); +- +- return font; +-} +- +diff --git a/lib/dia-font-selector.h b/lib/dia-font-selector.h +deleted file mode 100644 +index 8ffba0ccb..000000000 +--- a/lib/dia-font-selector.h ++++ /dev/null +@@ -1,37 +0,0 @@ +-/* Dia -- an diagram creation/manipulation program +- * Copyright (C) 1998 Alexander Larsson +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +- * +- * SPDX-License-Identifier: GPL-2.0-or-later +- */ +- +-#pragma once +- +-#include +- +-#include "font.h" +- +-G_BEGIN_DECLS +- +-#define DIA_TYPE_FONT_SELECTOR dia_font_selector_get_type () +-G_DECLARE_FINAL_TYPE (DiaFontSelector, dia_font_selector, DIA, FONT_SELECTOR, GtkBox) +- +-GtkWidget *dia_font_selector_new (void); +-void dia_font_selector_set_font (DiaFontSelector *self, +- DiaFont *font); +-DiaFont *dia_font_selector_get_font (DiaFontSelector *self); +- +-G_END_DECLS +diff --git a/lib/libdia.def b/lib/libdia.def +index db1c4ad7a..7f2364ddd 100644 +--- a/lib/libdia.def ++++ b/lib/libdia.def +@@ -252,11 +252,6 @@ EXPORTS + dia_font_copy + dia_font_string_width + +- dia_font_selector_get_font +- dia_font_selector_get_type +- dia_font_selector_new +- dia_font_selector_set_font +- + dia_guide_new + dia_guide_copy + dia_guide_free +diff --git a/lib/meson.build b/lib/meson.build +index f1ffb9659..7d2058c41 100644 +--- a/lib/meson.build ++++ b/lib/meson.build +@@ -167,8 +167,6 @@ libdia_sources = stdprop_sources + [ + 'dia-colour-cell-renderer.h', + 'dia-colour-selector.c', + 'dia-colour-selector.h', +- 'dia-font-selector.c', +- 'dia-font-selector.h', + 'dia-graphene.h', + 'dia-guide.c', + 'dia-guide.h', +diff --git a/lib/prop_attr.c b/lib/prop_attr.c +index 18a850a41..2362813a0 100644 +--- a/lib/prop_attr.c ++++ b/lib/prop_attr.c +@@ -29,11 +29,11 @@ + + #include + #include "dia_xml.h" ++#include "font.h" + #include "properties.h" + #include "propinternals.h" + #include "dia-arrow-selector.h" + #include "dia-colour-selector.h" +-#include "dia-font-selector.h" + #include "dia-line-style-selector.h" + + /***************************/ +@@ -421,22 +421,27 @@ fontprop_copy(FontProperty *src) + static WIDGET * + fontprop_get_widget(FontProperty *prop, PropDialog *dialog) + { +- GtkWidget *ret = dia_font_selector_new(); +- prophandler_connect(&prop->common, G_OBJECT(ret), "value-changed"); ++ GtkWidget *ret = gtk_font_button_new(); ++ gtk_font_chooser_set_level (GTK_FONT_CHOOSER (ret), GTK_FONT_CHOOSER_LEVEL_FAMILY | GTK_FONT_CHOOSER_LEVEL_STYLE); ++ prophandler_connect(&prop->common, G_OBJECT(ret), "font-set"); + return ret; + } + + static void + fontprop_reset_widget(FontProperty *prop, WIDGET *widget) + { +- dia_font_selector_set_font (DIA_FONT_SELECTOR (widget), +- prop->font_data); ++ const PangoFontDescription *desc = dia_font_get_description (prop->font_data); ++ gtk_font_chooser_set_font_desc (GTK_FONT_CHOOSER (widget), desc); + } + + static void + fontprop_set_from_widget(FontProperty *prop, WIDGET *widget) + { +- prop->font_data = dia_font_selector_get_font (DIA_FONT_SELECTOR (widget)); ++ char *desc = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (widget)); ++ DiaFont *new_font = dia_font_new_from_description (desc); ++ ++ g_clear_pointer (&desc, g_free); ++ g_set_object (&prop->font_data, new_font); + } + + static void +diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c +index 163cc2949..56af1d84b 100644 +--- a/objects/UML/class_dialog.c ++++ b/objects/UML/class_dialog.c +@@ -40,6 +40,7 @@ + #include + #include + ++#include "font.h" + #include "object.h" + #include "class.h" + #include "diaoptionmenu.h" +@@ -196,6 +197,28 @@ _class_set_comment (GtkTextView *view, gchar *text) + } + + ++static DiaFont * ++_font_from_button (GtkFontButton *btn) ++{ ++ char *font_desc; ++ DiaFont *ret; ++ ++ font_desc = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (btn)); ++ ret = dia_font_new_from_description (font_desc); ++ g_clear_pointer (&font_desc, g_free); ++ ++ return ret; ++} ++ ++ ++static void ++_set_selector_font (GtkFontButton *btn, DiaFont *font) ++{ ++ gtk_font_chooser_set_font_desc (GTK_FONT_CHOOSER (btn), ++ dia_font_get_description (font)); ++} ++ ++ + static void + class_read_from_dialog(UMLClass *umlclass, UMLClassDialog *prop_dialog) + { +@@ -243,12 +266,12 @@ class_read_from_dialog(UMLClass *umlclass, UMLClassDialog *prop_dialog) + dia_colour_selector_get_colour (DIA_COLOUR_SELECTOR (prop_dialog->fill_color), + ¨class->fill_color); + +- umlclass->normal_font = dia_font_selector_get_font (prop_dialog->normal_font); +- umlclass->polymorphic_font = dia_font_selector_get_font (prop_dialog->polymorphic_font); +- umlclass->abstract_font = dia_font_selector_get_font (prop_dialog->abstract_font); +- umlclass->classname_font = dia_font_selector_get_font (prop_dialog->classname_font); +- umlclass->abstract_classname_font = dia_font_selector_get_font (prop_dialog->abstract_classname_font); +- umlclass->comment_font = dia_font_selector_get_font (prop_dialog->comment_font); ++ umlclass->normal_font = _font_from_button(prop_dialog->normal_font); ++ umlclass->polymorphic_font = _font_from_button(prop_dialog->polymorphic_font); ++ umlclass->abstract_font = _font_from_button(prop_dialog->abstract_font); ++ umlclass->classname_font = _font_from_button (prop_dialog->classname_font); ++ umlclass->abstract_classname_font = _font_from_button (prop_dialog->abstract_classname_font); ++ umlclass->comment_font = _font_from_button (prop_dialog->comment_font); + + umlclass->font_height = gtk_spin_button_get_value (prop_dialog->normal_font_height); + umlclass->abstract_font_height = gtk_spin_button_get_value (prop_dialog->abstract_font_height); +@@ -291,12 +314,12 @@ class_fill_in_dialog(UMLClass *umlclass) + dia_colour_selector_set_colour (prop_dialog->text_color, ¨class->text_color); + dia_colour_selector_set_colour (prop_dialog->line_color, ¨class->line_color); + dia_colour_selector_set_colour (prop_dialog->fill_color, ¨class->fill_color); +- dia_font_selector_set_font (prop_dialog->normal_font, umlclass->normal_font); +- dia_font_selector_set_font (prop_dialog->polymorphic_font, umlclass->polymorphic_font); +- dia_font_selector_set_font (prop_dialog->abstract_font, umlclass->abstract_font); +- dia_font_selector_set_font (prop_dialog->classname_font, umlclass->classname_font); +- dia_font_selector_set_font (prop_dialog->abstract_classname_font, umlclass->abstract_classname_font); +- dia_font_selector_set_font (prop_dialog->comment_font, umlclass->comment_font); ++ _set_selector_font (prop_dialog->normal_font, umlclass->normal_font); ++ _set_selector_font (prop_dialog->polymorphic_font, umlclass->polymorphic_font); ++ _set_selector_font (prop_dialog->abstract_font, umlclass->abstract_font); ++ _set_selector_font (prop_dialog->classname_font, umlclass->classname_font); ++ _set_selector_font (prop_dialog->abstract_classname_font, umlclass->abstract_classname_font); ++ _set_selector_font (prop_dialog->comment_font, umlclass->comment_font); + gtk_spin_button_set_value (prop_dialog->normal_font_height, umlclass->font_height); + gtk_spin_button_set_value (prop_dialog->polymorphic_font_height, umlclass->polymorphic_font_height); + gtk_spin_button_set_value (prop_dialog->abstract_font_height, umlclass->abstract_font_height); +@@ -311,7 +334,7 @@ create_font_props_row (GtkGrid *grid, + gint row, + DiaFont *font, + real height, +- DiaFontSelector **fontsel, ++ GtkFontButton **fontsel, + GtkSpinButton **heightsel) + { + GtkWidget *label; +@@ -320,9 +343,10 @@ create_font_props_row (GtkGrid *grid, + label = gtk_label_new (kind); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_grid_attach (grid, label, 0, row, 1, 1); +- *fontsel = DIA_FONT_SELECTOR (dia_font_selector_new ()); ++ *fontsel = GTK_FONT_BUTTON (gtk_font_button_new ()); + gtk_widget_set_hexpand (GTK_WIDGET (*fontsel), TRUE); +- dia_font_selector_set_font (DIA_FONT_SELECTOR (*fontsel), font); ++ gtk_font_chooser_set_font_desc (GTK_FONT_CHOOSER (*fontsel), dia_font_get_description (font)); ++ gtk_font_chooser_set_level (GTK_FONT_CHOOSER (*fontsel), GTK_FONT_CHOOSER_LEVEL_FAMILY | GTK_FONT_CHOOSER_LEVEL_STYLE); + gtk_grid_attach (GTK_GRID (grid), GTK_WIDGET(*fontsel), 1, row, 1, 1); + + adj = GTK_ADJUSTMENT (gtk_adjustment_new (height, 0.1, 10.0, 0.1, 1.0, 0)); +diff --git a/objects/UML/class_dialog.h b/objects/UML/class_dialog.h +index 6bbb4b404..bf38b5613 100644 +--- a/objects/UML/class_dialog.h ++++ b/objects/UML/class_dialog.h +@@ -1,7 +1,6 @@ + #pragma once + + #include "dia-colour-selector.h" +-#include "dia-font-selector.h" + + G_BEGIN_DECLS + +@@ -32,12 +31,12 @@ struct _UMLClassDialog { + GtkToggleButton *op_supp; + GtkToggleButton *comments_vis; + GtkToggleButton *op_wrap; +- DiaFontSelector *normal_font; +- DiaFontSelector *abstract_font; +- DiaFontSelector *polymorphic_font; +- DiaFontSelector *classname_font; +- DiaFontSelector *abstract_classname_font; +- DiaFontSelector *comment_font; ++ GtkFontButton *normal_font; ++ GtkFontButton *abstract_font; ++ GtkFontButton *polymorphic_font; ++ GtkFontButton *classname_font; ++ GtkFontButton *abstract_classname_font; ++ GtkFontButton *comment_font; + GtkSpinButton *normal_font_height; + GtkSpinButton *abstract_font_height; + GtkSpinButton *polymorphic_font_height; +-- +GitLab + diff --git a/helpers/make-dia b/helpers/make-dia new file mode 100644 index 0000000..fcaee2b --- /dev/null +++ b/helpers/make-dia @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Copyright (C) 2025 Luis Guznán +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +VERSION=1 + +. ./config + +apply_patch_changes +# See more at: https://gitlab.gnome.org/GNOME/dia/-/merge_requests/114 + +changelog "Apply MR 114 on GNOME to fix delay to open text properties" + +package +