Project

General

Profile

Bug #10924

drawFillInBorder hover is always false

Added by Alexandru Lungu 8 months ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

Related issues

Related to User Interface - Feature #10848: custom theme improvements New

History

#1 Updated by Alexandru Lungu 8 months ago

In any theme, hover parameter from drawFillInBorder is always false. It is called from FillInGuiImpl.drawBorder, FillInGuiImpl.draw. The widget has MOUSE_ENTERED, MOUSE_EXITED, MouseEvt.MOUSE_HOVERABLE set to mouse actions, but there are no implementations for mouseEntered and mouseExited so we can capture the hover state. This makes the theme API unresponsive to the action of hovering the mouse over a fill-in. In some themes (i.e. MaterialUI), the underline should become thicker on hover.

I added Serban and Hynek as watchers. I suspect this is a side effect of not registering the fill-in as a hoverableWidget? If it is registered, then maybe the support is simply not complete as mouseEntered and mouseExited are not implemented.

#2 Updated by Alexandru Lungu 8 months ago

#3 Updated by Șerban Bursuc 8 months ago

Are you testing on the web client? The source of the mouse events might be a parent component, like a scroll pane. For editors there is this code:

   private void processParentMouseEvent(MouseEvent e)
   {
      Widget<?> parent = parent();
      if (isDirectManipulationActive() || parent == null || parent.isDirectManipulationActive())
      {
         return;
      }

      if (parent instanceof EditorGuiImpl || parent instanceof BrowseGuiImpl)
      {
         // editors get a text cursor while being hovered, notify the editor
         MouseHandler.handleMouseEvent(parent.getId().asInt(), e);
      }
   }

This was implemented to give the text cursor for editors on hover.

The rules for registering the widget as hoverable as in AbstractWidget._setEnabled:

if ((parent() != null || this instanceof Frame) &&
              supportsCustomMousePointer()               && 
              (!(this instanceof Frame) || cfg.realized) &&
              getId() != null                            &&
              mouseHoverAction == null)
         {
            mouseHoverAction = createMouseHoverAction();
            mouseHoverAction.register();
         }

Is one of these conditions false for the fill-in?

#4 Updated by Hynek Cihlar 8 months ago

+Eugenie

#5 Updated by Alexandru Lungu 8 months ago

Are you testing on the web client? The source of the mouse events might be a parent component, like a scroll pane. For editors there is this code:

My concern is:

   protected void drawBorder(GuiColorResolver gcd,
                             int x,
                             int y,
                             NativeDimension dim,
                             boolean threeDBorder)
   {
      ThemeManager.getCurrentTheme().drawFillInBorder(gd, gcd,
               x, y, dim.width, dim.height, threeDBorder, hasFocus(), false);
   }

That hardcodes hover to false. I don't deny the fact that the fill-in might be sensitive to hovers, but I don't find a flag "hover" to input into this method.

Also available in: Atom PDF