[gnome-builder] plugins/editorui: use caption object for language



commit ead54e42b8a0931f11405dc6f17f472eca99df6e
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 29 11:57:56 2022 -0700

    plugins/editorui: use caption object for language

 src/plugins/editorui/gbp-editorui-tweaks-addin.c | 15 ---------------
 src/plugins/editorui/tweaks-language.ui          |  6 +++---
 2 files changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-tweaks-addin.c 
b/src/plugins/editorui/gbp-editorui-tweaks-addin.c
index 4c721fd86..24d212256 100644
--- a/src/plugins/editorui/gbp-editorui-tweaks-addin.c
+++ b/src/plugins/editorui/gbp-editorui-tweaks-addin.c
@@ -70,20 +70,6 @@ editorui_create_style_scheme_selector (GbpEditoruiTweaksAddin *self,
                        NULL);
 }
 
-static GtkWidget *
-create_language_caption (IdeTweaks       *tweaks,
-                         IdeTweaksWidget *widget,
-                         IdeTweaksWidget *instance)
-{
-  return g_object_new (GTK_TYPE_LABEL,
-                       "css-classes", IDE_STRV_INIT ("caption", "dim-label"),
-                       /* translators: .editorconfig is a file used in programming projects and modelines 
are tweaks specified within a file header or footer */
-                       "label", _("Settings provided by .editorconfig and modelines take precedence over 
those below."),
-                       "xalign", .0f,
-                       "wrap", TRUE,
-                       NULL);
-}
-
 static int
 compare_by_section (gconstpointer a,
                     gconstpointer b,
@@ -126,7 +112,6 @@ gbp_editorui_tweaks_addin_load (IdeTweaksAddin *addin,
                                                       "/plugins/editorui/tweaks-language.ui"));
   ide_tweaks_addin_bind_callback (IDE_TWEAKS_ADDIN (self), editorui_create_style_scheme_preview);
   ide_tweaks_addin_bind_callback (IDE_TWEAKS_ADDIN (self), editorui_create_style_scheme_selector);
-  ide_tweaks_addin_bind_callback (IDE_TWEAKS_ADDIN (self), create_language_caption);
   ide_tweaks_expose_object (tweaks, "GtkSourceLanguages", G_OBJECT (store));
 
   IDE_TWEAKS_ADDIN_CLASS (gbp_editorui_tweaks_addin_parent_class)->load (addin, tweaks);
diff --git a/src/plugins/editorui/tweaks-language.ui b/src/plugins/editorui/tweaks-language.ui
index b56375574..92a961697 100644
--- a/src/plugins/editorui/tweaks-language.ui
+++ b/src/plugins/editorui/tweaks-language.ui
@@ -28,10 +28,10 @@
                           </lookup>
                         </binding>
                         <child>
-                          <object class="IdeTweaksGroup" id="language_top_group">
+                          <object class="IdeTweaksGroup">
                             <child>
-                              <object class="IdeTweaksWidget" id="language_caption">
-                                <signal name="create-for-item" handler="create_language_caption" 
swapped="true" object="IdeTweaks"/>
+                              <object class="IdeTweaksCaption">
+                                <property name="text" translatable="yes">Settings provided by .editorconfig 
and modelines take precedence over those below.</property>
                               </object>
                             </child>
                           </object>


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