From 18058f2ea20c0e7f66f1959e762060f85c638be3 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Tue, 3 Sep 2019 10:28:59 +0200 Subject: [PATCH] List implementation --- .../com/formdev/flatlaf/ui/FlatListUI.java | 36 +++++++++++++++++++ .../formdev/flatlaf/FlatDarkLaf.properties | 5 +++ .../com/formdev/flatlaf/FlatLaf.properties | 2 ++ .../formdev/flatlaf/FlatLightLaf.properties | 5 +++ .../formdev/flatlaf/FlatTestLaf.properties | 1 + 5 files changed, 49 insertions(+) create mode 100644 flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java new file mode 100644 index 00000000..7f58e5de --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatListUI.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.formdev.flatlaf.ui; + +import javax.swing.JComponent; +import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.basic.BasicListUI; + +/** + * Provides the Flat LaF UI delegate for {@link javax.swing.JList}. + * + * TODO document used UI defaults of superclass + * + * @author Karl Tauber + */ +public class FlatListUI + extends BasicListUI +{ + public static ComponentUI createUI( JComponent c ) { + return new FlatListUI(); + } +} diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties index 1d8912ac..6535c667 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarkLaf.properties @@ -106,6 +106,11 @@ Component.focusedBorderColor=466d94 Component.focusColor=3d6185 +#---- List ---- + +List.background=@textComponentBackground + + #---- Menu ---- Menu.icon.arrowColor=A7A7A7 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index eaf8fe12..9145c0ad 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -23,6 +23,7 @@ ComboBoxUI=com.formdev.flatlaf.ui.FlatComboBoxUI EditorPaneUI=com.formdev.flatlaf.ui.FlatEditorPaneUI FormattedTextFieldUI=com.formdev.flatlaf.ui.FlatFormattedTextFieldUI LabelUI=com.formdev.flatlaf.ui.FlatLabelUI +ListUI=com.formdev.flatlaf.ui.FlatListUI MenuUI=com.formdev.flatlaf.ui.FlatMenuUI MenuBarUI=com.formdev.flatlaf.ui.FlatMenuBarUI MenuItemUI=com.formdev.flatlaf.ui.FlatMenuItemUI @@ -99,6 +100,7 @@ FormattedTextField.margin=@textComponentMargin #---- List ---- +List.border=1,0,1,0 List.cellNoFocusBorder=1,6,1,6 List.focusCellHighlightBorder=1,6,1,6,@cellFocusColor List.focusSelectedCellHighlightBorder=1,6,1,6,@cellFocusColor diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index 8984d47e..c5736928 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -106,6 +106,11 @@ Component.focusedBorderColor=87afda Component.focusColor=97c3f3 +#---- List ---- + +List.background=@textComponentBackground + + #---- Menu ---- Menu.icon.arrowColor=666666 diff --git a/flatlaf-core/src/test/resources/com/formdev/flatlaf/FlatTestLaf.properties b/flatlaf-core/src/test/resources/com/formdev/flatlaf/FlatTestLaf.properties index c89d2af8..c68d3f9a 100644 --- a/flatlaf-core/src/test/resources/com/formdev/flatlaf/FlatTestLaf.properties +++ b/flatlaf-core/src/test/resources/com/formdev/flatlaf/FlatTestLaf.properties @@ -100,6 +100,7 @@ Label.disabledForeground=000088 #---- List ---- +List.background=f0ffff List.cellNoFocusBorder=1,6,1,6 List.focusSelectedCellHighlightBorder=1,6,1,6,880000 List.focusCellHighlightBorder=1,6,1,6,880000