Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5077296

GTK L&F: Creating a customer renderer with the appropriate colors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs
    • Cause Known
    • x86
    • linux

      ###@###.### 2004-07-22

      There is a bug with GTK L&F and custom combo box renderers.

      To create a subclass of DefaultComboBoxRenderer, and set it as the
      custom cell renderer of a combo box, the background color of the combo
      box is not its usual color; it instead has the same color background as
      its parent.
      ###@###.### 10/19/04 17:04 GMT

      My previous evaluation is wrong, this problem still exists.
      Run the test case and notice the background color of the 2nd combobox is wrong. If you show the popup (with 1.5) the colors in the list are correct. This is happening because native GTK uses different colors for the different states, and as BasicComboBoxRenderer doesn't have a way to express the different states you get the wrong color.

      One way to fix this is to add background/foreground colors for when the popup is not shown and have GTK populate these correctly. That way the colors would match when you create a BasicComboBoxRenderer.

      Additionally we should look into changing the renderering for comboboxs such that the border part of the label is painted by the combobox itself, not the renderer. This would make plugging in custom renderers a bit easier.
      ###@###.### 10/19/04 18:44 GMT

            peterz Peter Zhelezniakov
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: