Changeset 246732 in webkit


Ignore:
Timestamp:
Jun 24, 2019 7:34:47 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Navigation gesture should use dark fallback bg color on dark themes
https://bugs.webkit.org/show_bug.cgi?id=199104

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-24
Reviewed by Michael Catanzaro.

Use theme_base_color instead of white background for swipe gesture fallback if no snapshot is found and
the page did not specify a color. This allows it to use dark colors for dark themes. If the color was
not found, still fall back to white.

  • UIProcess/gtk/ViewGestureControllerGtk.cpp:

(WebKit::ViewGestureController::beginSwipeGesture):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246726 r246732  
     12019-06-24  Alexander Mikhaylenko  <exalm7659@gmail.com>
     2
     3        [GTK] Navigation gesture should use dark fallback bg color on dark themes
     4        https://bugs.webkit.org/show_bug.cgi?id=199104
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Use theme_base_color instead of white background for swipe gesture fallback if no snapshot is found and
     9        the page did not specify a color. This allows it to use dark colors for dark themes. If the color was
     10        not found, still fall back to white.
     11
     12        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
     13        (WebKit::ViewGestureController::beginSwipeGesture):
     14
    1152019-06-23  Dan Bernstein  <mitz@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp

    r246677 r246732  
    313313    }
    314314
     315    if (!m_currentSwipeSnapshotPattern) {
     316        GdkRGBA color;
     317        auto* context = gtk_widget_get_style_context(m_webPageProxy.viewWidget());
     318        if (gtk_style_context_lookup_color(context, "theme_base_color", &color))
     319            m_currentSwipeSnapshotPattern = adoptRef(cairo_pattern_create_rgba(color.red, color.green, color.blue, color.alpha));
     320    }
     321
    315322    if (!m_currentSwipeSnapshotPattern)
    316323        m_currentSwipeSnapshotPattern = adoptRef(cairo_pattern_create_rgb(1, 1, 1));
Note: See TracChangeset for help on using the changeset viewer.