Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-5530

Mac style doesn't honour QStyle::State_HasFocus for non-widgets (e.g. webkit)

    XMLWordPrintable

Details

    • macOS
    • 63e248aae7aecce2299bfd7941bd37fdfc136dcf

    Description

      [there is no component "Widget Styles"?]

      The Mac Widget Style (qmacstyle_mac.mm) doesn't draw the focus rect around lineedits when drawContents(PE_FrameLineEdit, option with QStyle::State_HasFocus) is called.
      Instead, it creates a QFocusFrame around the qwidget when it gets focus.
      This works ok for widgets, but it breaks other callers of drawContents(PE_FrameLineEdit), like webkit showing a form lineedit.

      Webkit testcase: <input/>
      Expected result: when the lineedit is focused, the standard mac blue focus-rect should be shown.
      Actual result: no focus frame shown

      I wanted to work on the fix for this, but it seems awfully complex/intrusive.
      Any change inside the webkit code (RenderThemeQt::paintTextField) would have to be mac-specific, which seems really ugly, that code (painting the focus rect) really belongs to the widget style...
      OTOH the widget style can't paint outside the given rect, inside CE_PanelLineEdit, I suppose... or can it?
      Maybe that's the fix: if (!frame->widget && frame->state & State_HasFocus)

      { draw focus rect, since we know that no QFocusFrame has been created }

      ?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pullatti Prasanth Ullattil
            dfaure David Faure (Private)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes