[gtk] RomDataView: Set RFT_STRING_warning_quark *before* calling set_label_format_type().

Otherwise, the description label won't get the "warning" formatting.
This commit is contained in:
David Korth 2025-03-22 12:38:07 -04:00
parent c17389f007
commit 15d7ae00eb
2 changed files with 11 additions and 8 deletions

View File

@ -60,6 +60,8 @@
* Affects: v2.4 - v2.4.1
* Dreamcast: Fix typo that broke GDI parsing.
* Affects: V2.4 - v2.4.1
* GTK UI frontends: Ensure the description label is also bold+red if the
field is a "warning" field.
* Other changes:
* CMake: Added an ENABLE_NETWORKING option to control whether or not

View File

@ -1475,16 +1475,10 @@ rp_rom_data_view_update_display(RpRomDataView *page)
// Add the widget to the table.
auto &tab = tabs[tabIdx];
// tr: Field description label.
// tr: Field description label
const string txt = fmt::format(FRUN(desc_label_fmt), field.name);
GtkWidget *const lblDesc = gtk_label_new(txt.c_str());
// NOTE: No name for this GtkWidget.
gtk_label_set_use_underline(GTK_LABEL(lblDesc), false);
set_label_format_type(page, GTK_LABEL(lblDesc));
page->cxx->vecDescLabels.push_back(GTK_LABEL(lblDesc));
#if !GTK_CHECK_VERSION(4, 0, 0)
gtk_widget_show(lblDesc);
#endif /* !GTK_CHECK_VERSION(4, 0, 0) */
// Check if this is an RFT_STRING with warning set.
// If it is, set the "RFT_STRING_warning" flag.
@ -1492,7 +1486,14 @@ rp_rom_data_view_update_display(RpRomDataView *page)
(field.flags & RomFields::STRF_WARNING));
g_object_set_qdata(G_OBJECT(lblDesc), RFT_STRING_warning_quark, GUINT_TO_POINTER((guint)is_warning));
// Value widget.
gtk_label_set_use_underline(GTK_LABEL(lblDesc), false);
set_label_format_type(page, GTK_LABEL(lblDesc));
page->cxx->vecDescLabels.push_back(GTK_LABEL(lblDesc));
#if !GTK_CHECK_VERSION(4, 0, 0)
gtk_widget_show(lblDesc);
#endif /* !GTK_CHECK_VERSION(4, 0, 0) */
// Value widget
int &row = tabRowCount[tabIdx];
#if USE_GTK_GRID
// TODO: GTK_FILL