[gnome-builder] plugins/color-picker: partial port to GTK 4



commit aff432ba5ddb7b7f6d8281ee97de36bb0a62d8f4
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 11 22:21:22 2022 -0700

    plugins/color-picker: partial port to GTK 4
    
    This plugin will probably be disabled for the GTK 4 port, but it is
    partially ported here until we can do more about it.

 src/plugins/color-picker/color-picker.plugin                 | 1 -
 src/plugins/color-picker/gb-color-picker-document-monitor.c  | 6 ------
 src/plugins/color-picker/gb-color-picker-editor-addin.c      | 6 ++----
 src/plugins/color-picker/gb-color-picker-prefs-palette-row.c | 6 +++---
 src/plugins/color-picker/gb-color-picker-prefs-palette-row.h | 4 ++--
 5 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/src/plugins/color-picker/color-picker.plugin b/src/plugins/color-picker/color-picker.plugin
index ba3500512..61bccb57d 100644
--- a/src/plugins/color-picker/color-picker.plugin
+++ b/src/plugins/color-picker/color-picker.plugin
@@ -2,7 +2,6 @@
 Authors=Sébastien Lafargue <slafargue gnome org>
 Builtin=true
 Copyright=Copyright © 2016 Sébastien Lafargue
-Depends=editor
 Description=Show a color picker to inspect or change text color codes
 Embedded=_gb_color_picker_register_types
 Module=color-picker
diff --git a/src/plugins/color-picker/gb-color-picker-document-monitor.c 
b/src/plugins/color-picker/gb-color-picker-document-monitor.c
index 143365349..9a8d6b9e3 100644
--- a/src/plugins/color-picker/gb-color-picker-document-monitor.c
+++ b/src/plugins/color-picker/gb-color-picker-document-monitor.c
@@ -675,8 +675,6 @@ gb_color_picker_document_monitor_queue_oper_cb (gpointer data)
  * This queues a region to be recolorized but does so after returning
  * to the main loop. This can be useful for situations where you do not
  * know if you are in a path that must retain a valid GtkTextIter.
- *
- * Since: 3.26
  */
 static void
 gb_color_picker_document_monitor_queue_oper (GbColorPickerDocumentMonitor *self,
@@ -723,8 +721,6 @@ gb_color_picker_document_monitor_queue_oper (GbColorPickerDocumentMonitor *self,
  * This queues a region to be recolorized but does so after returning
  * to the main loop. This can be useful for situations where you do not
  * know if you are in a path that must retain a valid GtkTextIter.
- *
- * Since: 3.26
  */
 void
 gb_color_picker_document_monitor_queue_colorize (GbColorPickerDocumentMonitor *self,
@@ -741,8 +737,6 @@ gb_color_picker_document_monitor_queue_colorize (GbColorPickerDocumentMonitor *s
  * This queues a region to be uncolorized but does so after returning
  * to the main loop. This can be useful for situations where you do not
  * know if you are in a path that must retain a valid GtkTextIter.
- *
- * Since: 3.26
  */
 void
 gb_color_picker_document_monitor_queue_uncolorize (GbColorPickerDocumentMonitor *self,
diff --git a/src/plugins/color-picker/gb-color-picker-editor-addin.c 
b/src/plugins/color-picker/gb-color-picker-editor-addin.c
index 11028c6db..1b89441da 100644
--- a/src/plugins/color-picker/gb-color-picker-editor-addin.c
+++ b/src/plugins/color-picker/gb-color-picker-editor-addin.c
@@ -174,7 +174,7 @@ gb_color_picker_editor_addin_set_panel (GbColorPickerEditorAddin *self)
                               NULL);
   g_signal_connect (self->panel,
                     "destroy",
-                    G_CALLBACK (gtk_widget_destroyed),
+                    G_CALLBACK (ide_gtk_widget_destroyed),
                     &self->panel);
   g_signal_connect_object (self->panel,
                            "notify::rgba",
@@ -294,7 +294,7 @@ gb_color_picker_editor_addin_load (IdeEditorAddin       *addin,
                              NULL);
   g_signal_connect (self->dock,
                     "destroy",
-                    G_CALLBACK (gtk_widget_destroyed),
+                    G_CALLBACK (ide_gtk_widget_destroyed),
                     &self->dock);
 
   sidebar = ide_editor_surface_get_transient_sidebar (self->editor);
@@ -392,8 +392,6 @@ gb_color_picker_editor_addin_init (GbColorPickerEditorAddin *self)
  * If no editor view is focused, %NULL is returned.
  *
  * Returns: (transfer full): a #GstylePalette or %NULL.
- *
- * Since: 3.26
  */
 GstylePalette *
 gb_color_picker_editor_addin_create_palette (GbColorPickerEditorAddin *self)
diff --git a/src/plugins/color-picker/gb-color-picker-prefs-palette-row.c 
b/src/plugins/color-picker/gb-color-picker-prefs-palette-row.c
index 918bbab02..fefe20742 100644
--- a/src/plugins/color-picker/gb-color-picker-prefs-palette-row.c
+++ b/src/plugins/color-picker/gb-color-picker-prefs-palette-row.c
@@ -28,7 +28,7 @@
 
 struct _GbColorPickerPrefsPaletteRow
 {
-  DzlPreferencesBin  parent_instance;
+  AdwPreferencesRow  parent_instance;
 
   GtkLabel          *palette_name;
   GtkImage          *image;
@@ -47,7 +47,7 @@ struct _GbColorPickerPrefsPaletteRow
   guint              needs_attention : 1;
 };
 
-G_DEFINE_FINAL_TYPE (GbColorPickerPrefsPaletteRow, gb_color_picker_prefs_palette_row, 
DZL_TYPE_PREFERENCES_BIN)
+G_DEFINE_FINAL_TYPE (GbColorPickerPrefsPaletteRow, gb_color_picker_prefs_palette_row, 
ADW_TYPE_PREFERENCES_ROW)
 
 enum {
   PROP_0,
@@ -281,7 +281,7 @@ gb_color_picker_prefs_palette_row_set_palette_name (GbColorPickerPrefsPaletteRow
 
   g_assert (GB_IS_COLOR_PICKER_PREFS_PALETTE_ROW (self));
 
-  if (dzl_str_empty0 (new_text))
+  if (!new_text || !new_text[0])
     {
       gtk_label_set_text (self->palette_name, "No name");
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PALETTE_NAME]);
diff --git a/src/plugins/color-picker/gb-color-picker-prefs-palette-row.h 
b/src/plugins/color-picker/gb-color-picker-prefs-palette-row.h
index 183ef0d7e..293dff655 100644
--- a/src/plugins/color-picker/gb-color-picker-prefs-palette-row.h
+++ b/src/plugins/color-picker/gb-color-picker-prefs-palette-row.h
@@ -19,13 +19,13 @@
  */
 #pragma once
 
-#include <dazzle.h>
+#include <adwaita.h>
 
 G_BEGIN_DECLS
 
 #define GB_TYPE_COLOR_PICKER_PREFS_PALETTE_ROW (gb_color_picker_prefs_palette_row_get_type())
 
-G_DECLARE_FINAL_TYPE (GbColorPickerPrefsPaletteRow, gb_color_picker_prefs_palette_row, GB, 
COLOR_PICKER_PREFS_PALETTE_ROW, DzlPreferencesBin)
+G_DECLARE_FINAL_TYPE (GbColorPickerPrefsPaletteRow, gb_color_picker_prefs_palette_row, GB, 
COLOR_PICKER_PREFS_PALETTE_ROW, AdwPreferencesRow)
 
 gboolean                      gb_color_picker_prefs_palette_row_get_needs_attention 
(GbColorPickerPrefsPaletteRow    *self);
 void                          gb_color_picker_prefs_palette_row_set_needs_attention 
(GbColorPickerPrefsPaletteRow    *self,


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