[evince/687-adwaita-dark-while-typing-font-in-forms-is-unreadable-white-on-white] remove '.flat' style from PDF forms GtkEntry's



commit 736b28a7c3b845a1f887458a18c17265ac920603
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Sun Dec 23 17:30:44 2018 +0000

    remove '.flat' style from PDF forms GtkEntry's
    
    As that style adds a transparent background which
    causes a white-on-white effect when using a
    white-on-black theme (eg. Adwaita dark).
    
    Issue #687

 libview/ev-view.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 602cc24c..61394882 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2472,6 +2472,7 @@ ev_view_form_field_text_create_widget (EvView      *view,
        EvFormFieldText *field_text = EV_FORM_FIELD_TEXT (field);
        GtkWidget       *text = NULL;
        gchar           *txt;
+       GtkStyleContext *context;
 
        txt = ev_document_forms_form_field_text_get_text (EV_DOCUMENT_FORMS (view->document),
                                                          field);
@@ -2482,6 +2483,10 @@ ev_view_form_field_text_create_widget (EvView      *view,
                case EV_FORM_FIELD_TEXT_NORMAL:
                        text = gtk_entry_new ();
                        gtk_entry_set_has_frame (GTK_ENTRY (text), FALSE);
+                       /* Remove '.flat' style added by previous call
+                        * gtk_entry_set_has_frame(FALSE) which caused bug #687 */
+                       context = gtk_widget_get_style_context (text);
+                       gtk_style_context_remove_class (context, GTK_STYLE_CLASS_FLAT);
                        gtk_entry_set_max_length (GTK_ENTRY (text), field_text->max_len);
                        gtk_entry_set_visibility (GTK_ENTRY (text), !field_text->is_password);
                        


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