[file-roller/wip/jtojnar/gtk4: 3/3] Use literal string for style classes




commit 7abc37acc0e9f7ad0f46a9f2dc9ff617c1c21add
Author: Jan Tojnar <jtojnar gmail com>
Date:   Mon Dec 13 18:10:33 2021 +0100

    Use literal string for style classes

 src/dlg-add.c          | 6 +++---
 src/dlg-ask-password.c | 2 +-
 src/dlg-delete.c       | 2 +-
 src/dlg-password.c     | 2 +-
 src/fr-location-bar.c  | 4 ++--
 src/fr-window.c        | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/dlg-add.c b/src/dlg-add.c
index d8a76e96..3a1adb39 100644
--- a/src/dlg-add.c
+++ b/src/dlg-add.c
@@ -217,7 +217,7 @@ dlg_add (FrWindow *window)
        button = gtk_dialog_add_button (GTK_DIALOG (data->dialog),
                                        _GTK_LABEL_ADD,
                                        GTK_RESPONSE_OK);
-       gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_SUGGESTED_ACTION);
+       gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
 
        if (use_header)
                gtk_header_bar_pack_end (GTK_HEADER_BAR (gtk_dialog_get_header_bar (GTK_DIALOG 
(data->dialog))),
@@ -761,10 +761,10 @@ load_options_activate_cb (GSimpleAction *action,
        aod_data->aod_treeview = _gtk_builder_get_widget (aod_data->builder, "aod_treeview");
 
        ok_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (aod_data->dialog), GTK_RESPONSE_OK);
-       gtk_style_context_add_class (gtk_widget_get_style_context (ok_button), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
+       gtk_style_context_add_class (gtk_widget_get_style_context (ok_button), "suggested-action");
        cancel_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (aod_data->dialog), 
GTK_RESPONSE_CANCEL);
        remove_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (aod_data->dialog), 
RESPONSE_DELETE_OPTIONS);
-       gtk_style_context_add_class (gtk_widget_get_style_context (remove_button), 
GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
+       gtk_style_context_add_class (gtk_widget_get_style_context (remove_button), "destructive-action");
 
        /* Set the signals handlers. */
 
diff --git a/src/dlg-ask-password.c b/src/dlg-ask-password.c
index 76af55ef..551fd779 100644
--- a/src/dlg-ask-password.c
+++ b/src/dlg-ask-password.c
@@ -127,7 +127,7 @@ dlg_ask_password__common (FrWindow       *window,
        gtk_dialog_set_default_response (GTK_DIALOG (data->dialog),
                                         GTK_RESPONSE_OK);
        gtk_style_context_add_class (gtk_widget_get_style_context (gtk_dialog_get_widget_for_response 
(GTK_DIALOG (data->dialog), GTK_RESPONSE_OK)),
-                                    GTK_STYLE_CLASS_SUGGESTED_ACTION);
+                                    "suggested-action");
 
        data->password_entry = GET_WIDGET ("password_entry");
 
diff --git a/src/dlg-delete.c b/src/dlg-delete.c
index eea8e700..f39c29b1 100644
--- a/src/dlg-delete.c
+++ b/src/dlg-delete.c
@@ -137,7 +137,7 @@ dlg_delete__common (FrWindow *window,
                                NULL);
 
        ok_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK);
-       gtk_style_context_add_class (gtk_widget_get_style_context (ok_button), 
GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
+       gtk_style_context_add_class (gtk_widget_get_style_context (ok_button), "destructive-action");
 
        delete_box = _gtk_builder_get_widget (data->builder, "delete_box");
 
diff --git a/src/dlg-password.c b/src/dlg-password.c
index 46f357fb..cc5898ec 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -103,7 +103,7 @@ dlg_password (GtkWidget *widget,
                                NULL);
        gtk_dialog_set_default_response (GTK_DIALOG (data->dialog), GTK_RESPONSE_OK);
        gtk_style_context_add_class (gtk_widget_get_style_context (gtk_dialog_get_widget_for_response 
(GTK_DIALOG (data->dialog), GTK_RESPONSE_OK)),
-                                    GTK_STYLE_CLASS_SUGGESTED_ACTION);
+                                    "suggested-action");
 
        basename = _g_file_get_display_basename (fr_archive_get_file (window->archive));
        title = g_strdup_printf (_("Enter a password for ā€œ%sā€"), basename);
diff --git a/src/fr-location-bar.c b/src/fr-location-bar.c
index a85100f3..6adb384b 100644
--- a/src/fr-location-bar.c
+++ b/src/fr-location-bar.c
@@ -85,8 +85,8 @@ fr_location_bar_init (FrLocationBar *self)
        gtk_box_set_spacing (GTK_BOX (self), 6);
 
        style_context = gtk_widget_get_style_context (GTK_WIDGET (self));
-       gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_TOOLBAR);
-       gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
+       gtk_style_context_add_class (style_context, "toolbar");
+       gtk_style_context_add_class (style_context, "primary-toolbar");
        gtk_style_context_add_class (style_context, "location-bar");
 
        css_provider = gtk_css_provider_new ();
diff --git a/src/fr-window.c b/src/fr-window.c
index 34b4333d..37e88228 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5836,8 +5836,8 @@ fr_window_construct (FrWindow *window)
                            FALSE,
                            0);
        gtk_widget_show_all (navigation_commands);
-       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), 
GTK_STYLE_CLASS_RAISED);
-       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), 
GTK_STYLE_CLASS_LINKED);
+       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), "raised");
+       gtk_style_context_add_class (gtk_widget_get_style_context (navigation_commands), "linked");
        gtk_box_pack_start (GTK_BOX (location_bar_content), navigation_commands, FALSE, FALSE, 0);
 
        gtk_box_pack_start (GTK_BOX (location_bar_content),


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