swingx
  1. swingx
  2. SWINGX-1458

Buttons on JXMonthView aren't drawn as disabled

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
      None
    • Environment:

      All

      Description

      If you make a JXMonthView traversable such that buttons are shown at the top, when you disabled the JXMonthView the buttons are drawn as enabled. You can't click on them - they are actually disabled - so it is just a display issue.

      Also, the black box signalling today isn't drawn disabled either.

      See this image:

      http://i.imgur.com/OmNSM.png

        Activity

        Hide
        kleopatra added a comment -

        boils down to: Borders don't have a notion of enablement, colors and icons are hard-coded.

        1) the arrows in the title region are icons in an IconBorder, always the same as set-to/returned from the uiManager. We don't have disabled-looking variants

        2) the bounding box around today is a LineBorder configured with the monthView's todayBackground color ... which is null always.

        The place those Borders are created, is the CalendarCellContext which is created/used in the BasicCalendarRenderingHandler .. all package private as the switch to painting by renderers isn't yet fully done.

        No quick-fix available (except replacing ui delegate and let it return a custom renderingHandler written from scratch, BasicMonthViewVisualCheck in the test package and probably the demos project as well have an example). The 2) could be hacked by letting JXMonthView return the todayBackground conditionally on enablement state.

        Need to think of how-to fix it for the longer run. Options:

        • make IconBorder enablement-aware, similarly as JLabel greys its icon if disabled?
        • add disabled-looking icons?
        • ..?

        Ideas welcome.

        BTW (and notes to myself):

        • the weekOfYear/dayOfWeek separators are painted black always
        • the header used for zoomable monthView isn't disabled at all

        Cheers
        Jeanette

        Show
        kleopatra added a comment - boils down to: Borders don't have a notion of enablement, colors and icons are hard-coded. 1) the arrows in the title region are icons in an IconBorder, always the same as set-to/returned from the uiManager. We don't have disabled-looking variants 2) the bounding box around today is a LineBorder configured with the monthView's todayBackground color ... which is null always. The place those Borders are created, is the CalendarCellContext which is created/used in the BasicCalendarRenderingHandler .. all package private as the switch to painting by renderers isn't yet fully done. No quick-fix available (except replacing ui delegate and let it return a custom renderingHandler written from scratch, BasicMonthViewVisualCheck in the test package and probably the demos project as well have an example). The 2) could be hacked by letting JXMonthView return the todayBackground conditionally on enablement state. Need to think of how-to fix it for the longer run. Options: make IconBorder enablement-aware, similarly as JLabel greys its icon if disabled? add disabled-looking icons? ..? Ideas welcome. BTW (and notes to myself): the weekOfYear/dayOfWeek separators are painted black always the header used for zoomable monthView isn't disabled at all Cheers Jeanette

          People

          • Assignee:
            kleopatra
            Reporter:
            boomah
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: