[gnome-builder] symbol-tree: Only enable use-underline when it's a mnemonic label



commit df1fe6e65f7ecdef05db9a9edeacb7906d198053
Author: vanadiae <vanadiae35 gmail com>
Date:   Fri Jul 23 21:32:20 2021 +0200

    symbol-tree: Only enable use-underline when it's a mnemonic label
    
    Currently any C -like functions using underscores gets them removed and
    instead use them as mnemonic underlines. Of course that's not expected
    so this commit fixes it properly.

 src/plugins/symbol-tree/gbp-symbol-menu-button.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/plugins/symbol-tree/gbp-symbol-menu-button.c 
b/src/plugins/symbol-tree/gbp-symbol-menu-button.c
index 56260f181..7e3669ace 100644
--- a/src/plugins/symbol-tree/gbp-symbol-menu-button.c
+++ b/src/plugins/symbol-tree/gbp-symbol-menu-button.c
@@ -296,6 +296,7 @@ gbp_symbol_menu_button_set_symbol (GbpSymbolMenuButton *self,
 {
   const gchar *title = NULL;
   const gchar *icon_name = NULL;
+  gboolean use_underline = FALSE;
 
   IDE_ENTRY;
 
@@ -312,6 +313,7 @@ gbp_symbol_menu_button_set_symbol (GbpSymbolMenuButton *self,
   if (dzl_str_empty0 (title))
     {
       title = _("_Select Symbol…");
+      use_underline = TRUE;
       icon_name = NULL;
       symbol = NULL;
     }
@@ -322,6 +324,7 @@ gbp_symbol_menu_button_set_symbol (GbpSymbolMenuButton *self,
                 NULL);
 
   gtk_label_set_label (self->symbol_title, title);
+  gtk_label_set_use_underline (self->symbol_title, use_underline);
 
   IDE_EXIT;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]